From 67efdb6831aacd3f4937e82e2513ccc27f75b7fc Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 25 Oct 2020 19:50:10 +0100 Subject: [PATCH] do not terminate session during protocol negotiation, allowing clients to connect without explicitly set the protocol --- client/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/client.go b/client/client.go index f72f1745..b90b7c2b 100644 --- a/client/client.go +++ b/client/client.go @@ -519,7 +519,7 @@ func (c *Client) handleRequest(req *base.Request) error { if th.Protocol == gortsplib.StreamProtocolUDP { if _, ok := c.protocols[gortsplib.StreamProtocolUDP]; !ok { c.writeResError(cseq, base.StatusUnsupportedTransport, fmt.Errorf("UDP streaming is disabled")) - return errRunTerminate + return nil } if len(c.streamTracks) > 0 && c.streamProtocol != gortsplib.StreamProtocolUDP { @@ -582,7 +582,7 @@ func (c *Client) handleRequest(req *base.Request) error { } else { if _, ok := c.protocols[gortsplib.StreamProtocolTCP]; !ok { c.writeResError(cseq, base.StatusUnsupportedTransport, fmt.Errorf("TCP streaming is disabled")) - return errRunTerminate + return nil } if len(c.streamTracks) > 0 && c.streamProtocol != gortsplib.StreamProtocolTCP { @@ -651,7 +651,7 @@ func (c *Client) handleRequest(req *base.Request) error { if th.Protocol == gortsplib.StreamProtocolUDP { if _, ok := c.protocols[gortsplib.StreamProtocolUDP]; !ok { c.writeResError(cseq, base.StatusUnsupportedTransport, fmt.Errorf("UDP streaming is disabled")) - return errRunTerminate + return nil } if len(c.streamTracks) > 0 && c.streamProtocol != gortsplib.StreamProtocolUDP { @@ -699,7 +699,7 @@ func (c *Client) handleRequest(req *base.Request) error { } else { if _, ok := c.protocols[gortsplib.StreamProtocolTCP]; !ok { c.writeResError(cseq, base.StatusUnsupportedTransport, fmt.Errorf("TCP streaming is disabled")) - return errRunTerminate + return nil } if len(c.streamTracks) > 0 && c.streamProtocol != gortsplib.StreamProtocolTCP {