mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
fix a lock access in ResumeManager
This commit is contained in:
parent
8fc588375b
commit
f10ed05f86
@ -18,7 +18,7 @@ type resumeTokenPair struct {
|
||||
}
|
||||
|
||||
type ResumeManager struct {
|
||||
sync.RWMutex // level 2
|
||||
sync.Mutex // level 2
|
||||
|
||||
resumeIDtoCreds map[string]resumeTokenPair
|
||||
server *Server
|
||||
@ -59,8 +59,8 @@ func (rm *ResumeManager) VerifyToken(token string) (client *Client) {
|
||||
return
|
||||
}
|
||||
|
||||
rm.RLock()
|
||||
defer rm.RUnlock()
|
||||
rm.Lock()
|
||||
defer rm.Unlock()
|
||||
|
||||
id := token[:utils.SecretTokenLength]
|
||||
pair, ok := rm.resumeIDtoCreds[id]
|
||||
|
Loading…
Reference in New Issue
Block a user