better logging around negotiations

This commit is contained in:
David Zhao
2021-02-02 01:16:13 -08:00
parent 70574deaf7
commit a4266478c5
5 changed files with 78 additions and 2 deletions
+3 -1
View File
@@ -134,6 +134,7 @@ func NewParticipant(identity string, pc types.PeerConnection, rs routing.Message
// only set after answered
pc.OnNegotiationNeeded(func() {
logger.Debugw("negotiation needed", "participant", participant.Identity())
if !participant.IsReady() {
// ignore negotiation requests before connected
return
@@ -462,6 +463,8 @@ func (p *ParticipantImpl) negotiate() {
// skip when disconnected
return
}
logger.Debugw("starting server negotiation", "participant", p.Identity())
p.negotiationCond.L.Lock()
for p.negotiationState != negotiationStateNone {
p.negotiationCond.Wait()
@@ -469,7 +472,6 @@ func (p *ParticipantImpl) negotiate() {
}
p.negotiationCond.L.Unlock()
logger.Debugw("starting server negotiation", "participant", p.Identity())
offer, err := p.peerConn.CreateOffer(nil)
if err != nil {
logger.Errorw("could not create offer", "err", err)