Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 2d16529

Browse files
committed
fix: Network error RTC race on flush
1 parent 00667ef commit 2d16529

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wsnet/rtc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ func proxyICECandidates(conn *webrtc.PeerConnection, w io.Writer) func() {
171171
if i == nil {
172172
return
173173
}
174+
mut.Lock()
175+
defer mut.Unlock()
174176
if !flushed {
175-
mut.Lock()
176-
defer mut.Unlock()
177177
queue = append(queue, i)
178178
return
179179
}

0 commit comments

Comments
 (0)