mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
server: remove useless code
This commit is contained in:
@@ -127,15 +127,8 @@ func (sc *ServerConn) run() {
|
||||
return err
|
||||
|
||||
case ss := <-sc.sessionRemove:
|
||||
if _, ok := sc.sessions[ss.secretID]; ok {
|
||||
delete(sc.sessions, ss.secretID)
|
||||
|
||||
select {
|
||||
case ss.connRemove <- sc:
|
||||
case <-ss.ctx.Done():
|
||||
}
|
||||
}
|
||||
|
||||
case <-sc.ctx.Done():
|
||||
return liberrors.ErrServerTerminated{}
|
||||
}
|
||||
|
@@ -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():
|
||||
}
|
||||
}
|
||||
|
||||
// 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