return error in OnDecodeError when there are oversized UDP packets

This commit is contained in:
aler9
2022-10-31 15:38:23 +01:00
parent 5a5f454814
commit b1f72f9392
8 changed files with 93 additions and 20 deletions

View File

@@ -222,7 +222,7 @@ func (sc *ServerConn) readFuncTCP(readRequest chan readReq) error {
processFunc = func(trackID int, isRTP bool, payload []byte) error {
if !isRTP {
if len(payload) > maxPacketSize {
return fmt.Errorf("payload size (%d) greater than maximum allowed (%d)",
return fmt.Errorf("payload size (%d) is greater than maximum allowed (%d)",
len(payload), maxPacketSize)
}
@@ -274,7 +274,7 @@ func (sc *ServerConn) readFuncTCP(readRequest chan readReq) error {
}
} else {
if len(payload) > maxPacketSize {
return fmt.Errorf("payload size (%d) greater than maximum allowed (%d)",
return fmt.Errorf("payload size (%d) is greater than maximum allowed (%d)",
len(payload), maxPacketSize)
}