Snapshot connected users under client lock
This commit is contained in:
committed by
Brandon McGinty
parent
98a29a6470
commit
0766178277
@@ -124,7 +124,14 @@ func (b *Barnard) OnConnect(e *gumble.ConnectEvent) {
|
||||
b.UiTree.Rebuild()
|
||||
b.Ui.Refresh()
|
||||
|
||||
for _, u := range b.Client.Users {
|
||||
var users []*gumble.User
|
||||
b.Client.Do(func() {
|
||||
users = make([]*gumble.User, 0, len(b.Client.Users))
|
||||
for _, u := range b.Client.Users {
|
||||
users = append(users, u)
|
||||
}
|
||||
})
|
||||
for _, u := range users {
|
||||
b.UserConfig.UpdateUser(u)
|
||||
b.rememberUserChannel(u)
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ Priority 3: configuration, UI, and binding hardening
|
||||
seconds for the protocol, creating a huge ban duration. Reject negative
|
||||
durations and validate mask/address before sending.
|
||||
|
||||
36. Admin, tree, and client code read mutable maps outside Client.Do
|
||||
[x] 36. Admin, tree, and client code read mutable maps outside Client.Do
|
||||
Files: admin.go, ui_tree.go, client.go
|
||||
UI code ranges Client.Users, Channels, Channel.Users, and Children while
|
||||
network handlers mutate them. This overlaps issue 2 but must be fixed on
|
||||
|
||||
Reference in New Issue
Block a user