File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -287,18 +287,14 @@ func (c *Conn) negotiate() {
287
287
c .opts .Logger .Debug (context .Background (), "setting remote description" )
288
288
err := c .rtc .SetRemoteDescription (remoteDescription )
289
289
if err != nil {
290
- c .pendingCandidatesMutex .Unlock ()
291
290
_ = c .CloseWithError (xerrors .Errorf ("set remote description (closed %v): %w" , c .isClosed (), err ))
292
291
return
293
292
}
294
-
295
- if c .offerrer {
296
- // ICE candidates reset when an offer/answer is set for the first
297
- // time. If candidates flush before this point, a connection could fail.
298
- err = c .flushPendingCandidates ()
299
- if err != nil {
300
- _ = c .CloseWithError (xerrors .Errorf ("flush pending candidates: %w" , err ))
301
- }
293
+ // ICE candidates reset when an offer/answer is set for the first
294
+ // time. If candidates flush before this point, a connection could fail.
295
+ err = c .flushPendingCandidates ()
296
+ if err != nil {
297
+ _ = c .CloseWithError (xerrors .Errorf ("flush pending candidates: %w" , err ))
302
298
}
303
299
304
300
if ! c .offerrer {
@@ -321,12 +317,6 @@ func (c *Conn) negotiate() {
321
317
return
322
318
case c .localSessionDescriptionChannel <- answer :
323
319
}
324
-
325
- // Wait until the local description is set to flush candidates.
326
- err = c .flushPendingCandidates ()
327
- if err != nil {
328
- _ = c .CloseWithError (xerrors .Errorf ("flush pending candidates: %w" , err ))
329
- }
330
320
}
331
321
}
332
322
You can’t perform that action at this time.
0 commit comments