mirror of https://github.com/v2ray/v2ray-core
cancel immediately when timeout = 0
parent
1226f3ce39
commit
0aa48e6c5a
|
@ -39,6 +39,11 @@ func (t *ActivityTimer) run() {
|
|||
case <-t.ctx.Done():
|
||||
return
|
||||
case timeout := <-t.timeout:
|
||||
if timeout == 0 {
|
||||
t.cancel()
|
||||
return
|
||||
}
|
||||
|
||||
ticker.Stop()
|
||||
ticker = time.NewTicker(timeout)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue