Skip to content

Commit

Permalink
Revert "Run ops.GracefulClose earlier in pc.Close"
Browse files Browse the repository at this point in the history
This reverts commit ec6b6f1.
  • Loading branch information
edaniels committed Aug 14, 2024
1 parent 130b6ae commit 48a2e5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion peerconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,6 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error {
}
if shouldGracefullyClose && !alreadyGracefullyClosed {
defer close(pc.isGracefulClosedDone)
pc.ops.GracefulClose()
}

// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #3)
Expand Down Expand Up @@ -2180,6 +2179,8 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error {
pc.updateConnectionState(pc.ICEConnectionState(), pc.dtlsTransport.State())

if shouldGracefullyClose {
pc.ops.GracefulClose()

// note that it isn't canon to stop gracefully
pc.sctpTransport.lock.Lock()
for _, d := range pc.sctpTransport.dataChannels {
Expand Down

0 comments on commit 48a2e5a

Please sign in to comment.