Commit c3a19c91 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Avoid race between closing connections and terminating client.

We need to terminate all down connections synchronously, otherwise
we risk leaving open connections lying around.
parent 66de0d16
......@@ -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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment