1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00

fix activity timer on timeout = 0

This commit is contained in:
Darien Raymond 2018-05-28 13:55:20 +02:00
parent 9321210bcf
commit 6dbe2644a9
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -44,7 +44,7 @@ func (t *ActivityTimer) finish() {
t.onTimeout()
}
if t.checkTask != nil {
t.checkTask.Close()
t.checkTask.Close() // nolint: errcheck
t.checkTask = nil
}
}
@ -52,6 +52,7 @@ func (t *ActivityTimer) finish() {
func (t *ActivityTimer) SetTimeout(timeout time.Duration) {
if timeout == 0 {
t.finish()
return
}
t.Lock()