mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 12:32:01 -08:00
remove useless checks
This commit is contained in:
parent
509bed355a
commit
be54bed373
1 changed files with 5 additions and 16 deletions
|
|
@ -167,22 +167,11 @@ func (s *rtspSession) OnAnnounce(c *rtspConn, ctx *gortsplib.ServerHandlerOnAnno
|
|||
// OnSetup is called by rtspServer.
|
||||
func (s *rtspSession) OnSetup(c *rtspConn, ctx *gortsplib.ServerHandlerOnSetupCtx,
|
||||
) (*base.Response, *gortsplib.ServerStream, error) {
|
||||
switch ctx.Transport {
|
||||
case gortsplib.TransportUDP:
|
||||
if _, ok := s.protocols[conf.Protocol(gortsplib.TransportUDP)]; !ok {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusUnsupportedTransport,
|
||||
}, nil, nil
|
||||
}
|
||||
|
||||
case gortsplib.TransportUDPMulticast:
|
||||
if _, ok := s.protocols[conf.Protocol(gortsplib.TransportUDPMulticast)]; !ok {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusUnsupportedTransport,
|
||||
}, nil, nil
|
||||
}
|
||||
|
||||
default: // TCP
|
||||
// in case the client is setupping a stream with UDP or UDP-multicast, and these
|
||||
// transport protocols are disabled, gortsplib already blocks the request.
|
||||
// we have only to handle the case in which the transport protocol is TCP
|
||||
// and it is disabled.
|
||||
if ctx.Transport == gortsplib.TransportTCP {
|
||||
if _, ok := s.protocols[conf.Protocol(gortsplib.TransportTCP)]; !ok {
|
||||
return &base.Response{
|
||||
StatusCode: base.StatusUnsupportedTransport,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue