mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
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:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user