mirror of
https://github.com/jech/galene.git
synced 2024-11-25 10:05:58 +01:00
Avoid race between closing connections and terminating client.
We need to terminate all down connections synchronously, otherwise we risk leaving open connections lying around.
This commit is contained in:
parent
66de0d16e7
commit
c3a19c9128
1 changed files with 6 additions and 1 deletions
|
@ -1016,15 +1016,20 @@ func leaveGroup(c *webClient) {
|
|||
return
|
||||
}
|
||||
|
||||
c.setRequested(map[string]uint32{})
|
||||
if c.up != nil {
|
||||
for id := range c.up {
|
||||
delUpConn(c, id, c.id, true)
|
||||
}
|
||||
}
|
||||
if c.down != nil {
|
||||
for id := range c.down {
|
||||
delDownConn(c, id)
|
||||
}
|
||||
}
|
||||
|
||||
group.DelClient(c)
|
||||
c.permissions = group.ClientPermissions{}
|
||||
c.requested = map[string]uint32{}
|
||||
c.group = nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue