allow invalid RTCP packets in both client and server

(https://github.com/aler9/rtsp-simple-server/issues/1085)

Invalid RTCP packets, in both server and client, do not trigger a fatal
error anymore but they're just blocked. OnDecodeError() is called in
order to emit a warning.
This commit is contained in:
aler9
2022-12-09 12:45:51 +01:00
parent 00efb912aa
commit 99855bd3a2
5 changed files with 40 additions and 6 deletions

View File

@@ -251,7 +251,8 @@ func (sc *ServerConn) readFuncTCP(readRequest chan readReq) error {
packets, err := rtcp.Unmarshal(payload)
if err != nil {
return err
onDecodeError(sc.session, err)
return nil
}
if h, ok := sc.s.Handler.(ServerHandlerOnPacketRTCP); ok {
@@ -294,7 +295,8 @@ func (sc *ServerConn) readFuncTCP(readRequest chan readReq) error {
packets, err := rtcp.Unmarshal(payload)
if err != nil {
return err
onDecodeError(sc.session, err)
return nil
}
for _, pkt := range packets {