Disable close by dtls to fix migration (#3220)
Pion v4 imports new feature that will close peerconnection on dtls.close to detects remote peer closed quickly, it breaks the session migration.
This commit is contained in:
@@ -285,6 +285,10 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
|
||||
// https://github.com/pion/dtls/pull/474
|
||||
se.SetDTLSEllipticCurves(elliptic.X25519, elliptic.P384, elliptic.P256)
|
||||
|
||||
// Disable close by dtls to avoid peerconnection close too early in migration
|
||||
// https://github.com/pion/webrtc/pull/2961
|
||||
se.DisableCloseByDTLS(true)
|
||||
|
||||
//
|
||||
// Disable SRTP replay protection (https://datatracker.ietf.org/doc/html/rfc3711#page-15).
|
||||
// Needed due to lack of RTX stream support in Pion.
|
||||
@@ -706,11 +710,6 @@ func (t *PCTransport) onPeerConnectionStateChange(state webrtc.PeerConnectionSta
|
||||
case webrtc.PeerConnectionStateFailed:
|
||||
t.clearConnTimer()
|
||||
t.handleConnectionFailed(false)
|
||||
case webrtc.PeerConnectionStateClosed:
|
||||
// peerconnection closed by client
|
||||
if !t.isClosed.Load() {
|
||||
t.params.Handler.OnClosed()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user