fix various race conditions

This commit is contained in:
aler9
2021-05-10 21:33:23 +02:00
parent ae3e3b19c0
commit c878b68b70
4 changed files with 8 additions and 0 deletions

View File

@@ -301,6 +301,8 @@ outer:
}
}
cc.ctxCancel()
cc.doClose(false)
}

View File

@@ -336,6 +336,8 @@ outer:
}
}
s.ctxCancel()
if s.udpRTCPListener != nil {
s.udpRTCPListener.close()
}

View File

@@ -235,6 +235,8 @@ func (sc *ServerConn) run() {
}
}()
sc.ctxCancel()
if sc.tcpFrameEnabled {
sc.tcpFrameWriteBuffer.Close()
<-sc.tcpFrameBackgroundWriteDone

View File

@@ -318,6 +318,8 @@ func (ss *ServerSession) run() {
}
}()
ss.ctxCancel()
switch ss.state {
case ServerSessionStatePlay:
if *ss.setupProtocol == StreamProtocolUDP {