mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
webrtc peer do not set nil conn.
This commit is contained in:
parent
5a2fcc1c8a
commit
43f8fe339f
@ -487,7 +487,7 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, bitrate int,
|
|||||||
session.SetWebRTCConnected(peer, true)
|
session.SetWebRTCConnected(peer, true)
|
||||||
case webrtc.PeerConnectionStateDisconnected,
|
case webrtc.PeerConnectionStateDisconnected,
|
||||||
webrtc.PeerConnectionStateFailed:
|
webrtc.PeerConnectionStateFailed:
|
||||||
connection.Close()
|
peer.Destroy()
|
||||||
case webrtc.PeerConnectionStateClosed:
|
case webrtc.PeerConnectionStateClosed:
|
||||||
// ensure we only run this once
|
// ensure we only run this once
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
|
@ -106,11 +106,8 @@ func (peer *WebRTCPeerCtx) Destroy() {
|
|||||||
peer.mu.Lock()
|
peer.mu.Lock()
|
||||||
defer peer.mu.Unlock()
|
defer peer.mu.Unlock()
|
||||||
|
|
||||||
if peer.connection != nil {
|
err := peer.connection.Close()
|
||||||
err := peer.connection.Close()
|
peer.logger.Err(err).Msg("peer connection destroyed")
|
||||||
peer.logger.Err(err).Msg("peer connection destroyed")
|
|
||||||
peer.connection = nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (peer *WebRTCPeerCtx) estimatorReader() {
|
func (peer *WebRTCPeerCtx) estimatorReader() {
|
||||||
|
Loading…
Reference in New Issue
Block a user