Add error message when no pairs

Add error message if pingAllCandidates is called and we
have no candidate pairs. This may help users when debugging.
This commit is contained in:
Sean DuBois
2020-02-21 16:45:15 -08:00
committed by Sean DuBois
parent 8c0827e13c
commit aa3fe7c6a3
2 changed files with 6 additions and 3 deletions
+6
View File
@@ -654,6 +654,12 @@ func (a *Agent) setSelectedPair(p *candidatePair) {
}
func (a *Agent) pingAllCandidates() {
a.log.Trace("pinging all candidates")
if len(a.checklist) == 0 {
a.log.Warn("pingAllCandidates called with no candidate pairs. Connection is not possible yet.")
}
for _, p := range a.checklist {
if p.state == CandidatePairStateWaiting {
p.state = CandidatePairStateInProgress
-3
View File
@@ -92,8 +92,6 @@ func (s *controllingSelector) ContactCandidates() {
s.nominatePair(p)
return
}
s.log.Trace("pinging all candidates")
s.agent.pingAllCandidates()
}
}
@@ -215,7 +213,6 @@ func (s *controlledSelector) ContactCandidates() {
s.log.Trace("check timeout reached and no valid candidate pair found, marking connection as failed")
s.agent.updateConnectionState(ConnectionStateFailed)
} else {
s.log.Trace("pinging all candidates")
s.agent.pingAllCandidates()
}
}