Skip to content

Commit de209c7

Browse files
committed
Add logs for setting the description
1 parent ebb94b8 commit de209c7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

peer/conn.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ func (c *Conn) negotiate() {
264264
_ = c.CloseWithError(xerrors.Errorf("create offer: %w", err))
265265
return
266266
}
267+
c.opts.Logger.Debug(context.Background(), "setting local description")
267268
err = c.rtc.SetLocalDescription(offer)
268269
if err != nil {
269270
_ = c.CloseWithError(xerrors.Errorf("set local description: %w", err))
@@ -283,6 +284,7 @@ func (c *Conn) negotiate() {
283284
case remoteDescription = <-c.remoteSessionDescriptionChannel:
284285
}
285286

287+
c.opts.Logger.Debug(context.Background(), "setting remote description")
286288
err := c.rtc.SetRemoteDescription(remoteDescription)
287289
if err != nil {
288290
c.pendingCandidatesMutex.Unlock()
@@ -305,6 +307,7 @@ func (c *Conn) negotiate() {
305307
_ = c.CloseWithError(xerrors.Errorf("create answer: %w", err))
306308
return
307309
}
310+
c.opts.Logger.Debug(context.Background(), "setting local description")
308311
err = c.rtc.SetLocalDescription(answer)
309312
if err != nil {
310313
_ = c.CloseWithError(xerrors.Errorf("set local description: %w", err))
@@ -350,6 +353,7 @@ func (c *Conn) flushPendingCandidates() error {
350353
}
351354

352355
c.pendingLocalCandidates = make([]webrtc.ICECandidateInit, 0)
356+
c.pendingRemoteCandidates = make([]webrtc.ICECandidateInit, 0)
353357
c.pendingCandidatesFlushed = true
354358
c.opts.Logger.Debug(context.Background(), "flushed candidates")
355359
return nil

0 commit comments

Comments
 (0)