瀏覽代碼

Fix dangling goroutine on session expiration

The timer channel may already have been drained by `case <-timer.C`. In
this case, we need not to drain it again or we'll block forever.

To fix this, stop draining the timer channel. Since we're not going to
use the timer again anyway, it should be fine.
master
Simon Ser 4 年之前
父節點
當前提交
e6e457e4a7
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: FDE7BE0E88F5E48
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. +1
    -3
      session.go

+ 1
- 3
session.go 查看文件

@@ -237,9 +237,7 @@ func (sm *SessionManager) Put(username, password string) (*Session, error) {
}
}

if !timer.Stop() {
<-timer.C
}
timer.Stop()

s.locker.Lock()
if s.imapConn != nil {


Loading…
取消
儲存