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 887b10f.
  • Loading branch information
edaniels committed Aug 14, 2024
1 parent cef1db8 commit a49914b
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 @@ -2113,7 +2113,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 @@ -2170,6 +2169,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 a49914b

Please sign in to comment.