Try to fix race condition in sessions.reset

This commit is contained in:
Neil Alexander 2019-09-18 14:03:31 +01:00
parent f4e326f5dd
commit 40204caab6
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -414,11 +414,10 @@ func (sinfo *sessionInfo) _updateNonce(theirNonce *crypto.BoxNonce) {
// Resets all sessions to an uninitialized state. // Resets all sessions to an uninitialized state.
// Called after coord changes, so attemtps to use a session will trigger a new ping and notify the remote end of the coord change. // Called after coord changes, so attemtps to use a session will trigger a new ping and notify the remote end of the coord change.
// Only call this from the router actor.
func (ss *sessions) reset() { func (ss *sessions) reset() {
for _, sinfo := range ss.sinfos { for _, sinfo := range ss.sinfos {
sinfo.Act(ss.router, func() { sinfo.reset = true
sinfo.reset = true
})
} }
} }