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:
@@ -1016,15 +1016,20 @@ func leaveGroup(c *webClient) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.setRequested(map[string]uint32{})
|
|
||||||
if c.up != nil {
|
if c.up != nil {
|
||||||
for id := range c.up {
|
for id := range c.up {
|
||||||
delUpConn(c, id, c.id, true)
|
delUpConn(c, id, c.id, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if c.down != nil {
|
||||||
|
for id := range c.down {
|
||||||
|
delDownConn(c, id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group.DelClient(c)
|
group.DelClient(c)
|
||||||
c.permissions = group.ClientPermissions{}
|
c.permissions = group.ClientPermissions{}
|
||||||
|
c.requested = map[string]uint32{}
|
||||||
c.group = nil
|
c.group = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user