mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Cancel selection timeout if Agent is closed
We would always wait 10 seconds even if the ICE Agent was closed, instead return early right when the agent is closed. Closes pion/webrtc#897
This commit is contained in:
+6
-1
@@ -27,7 +27,12 @@ type controllingSelector struct {
|
||||
func (s *controllingSelector) Start() {
|
||||
s.startTime = time.Now()
|
||||
go func() {
|
||||
time.Sleep(s.agent.candidateSelectionTimeout)
|
||||
select {
|
||||
case <-s.agent.done:
|
||||
return
|
||||
case <-time.After(s.agent.candidateSelectionTimeout):
|
||||
}
|
||||
|
||||
err := s.agent.run(func(a *Agent) {
|
||||
if s.nominatedPair == nil {
|
||||
p := s.agent.getBestValidCandidatePair()
|
||||
|
||||
Reference in New Issue
Block a user