diff --git a/agent.go b/agent.go index 8c435738..571cd5bf 100644 --- a/agent.go +++ b/agent.go @@ -1096,6 +1096,8 @@ func (a *Agent) handleInbound(m *stun.Message, local Candidate, remote net.Addr) a.selector.HandleSuccessResponse(m, local, remoteCandidate, remote) } else if m.Type.Class == stun.ClassRequest { + a.log.Tracef("Inbound STUN (Request) from %s to %s, useCandidate: %v", remote.String(), local.String(), m.Contains(stun.AttrUseCandidate)) + if err = stunx.AssertUsername(m, a.localUfrag+":"+a.remoteUfrag); err != nil { a.log.Warnf("Discard message from (%s), %v", remote, err) return @@ -1131,8 +1133,6 @@ func (a *Agent) handleInbound(m *stun.Message, local Candidate, remote net.Addr) a.addRemoteCandidate(remoteCandidate) } - a.log.Tracef("Inbound STUN (Request) from %s to %s", remote.String(), local.String()) - a.selector.HandleBindingRequest(m, local, remoteCandidate) } diff --git a/candidatepair.go b/candidatepair.go index 3041da1e..93470fec 100644 --- a/candidatepair.go +++ b/candidatepair.go @@ -35,8 +35,8 @@ func (p *CandidatePair) String() string { return "" } - return fmt.Sprintf("prio %d (local, prio %d) %s <-> %s (remote, prio %d)", - p.priority(), p.Local.Priority(), p.Local, p.Remote, p.Remote.Priority()) + return fmt.Sprintf("prio %d (local, prio %d) %s <-> %s (remote, prio %d), state: %s, nominated: %v, nominateOnBindingSuccess: %v", + p.priority(), p.Local.Priority(), p.Local, p.Remote, p.Remote.Priority(), p.state, p.nominated, p.nominateOnBindingSuccess) } func (p *CandidatePair) equal(other *CandidatePair) bool {