mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 23:47:07 -05:00
cancel immediately when timeout = 0
This commit is contained in:
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
Block a user