mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
server: remove useless code
This commit is contained in:
@@ -304,20 +304,13 @@ func (ss *ServerSession) run() {
|
||||
}
|
||||
|
||||
case sc := <-ss.connRemove:
|
||||
if _, ok := ss.conns[sc]; ok {
|
||||
delete(ss.conns, sc)
|
||||
|
||||
select {
|
||||
case sc.sessionRemove <- ss:
|
||||
case <-sc.ctx.Done():
|
||||
}
|
||||
}
|
||||
delete(ss.conns, sc)
|
||||
|
||||
// if session is not in state RECORD or PLAY, or transport is TCP
|
||||
if (ss.state != ServerSessionStateRecord &&
|
||||
ss.state != ServerSessionStatePlay) ||
|
||||
*ss.setuppedTransport == TransportTCP {
|
||||
// close if there are no associated connections
|
||||
// close session if there are no associated connections
|
||||
if len(ss.conns) == 0 {
|
||||
return liberrors.ErrServerSessionNotInUse{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user