Fix network.forEachDownstream exiting on first non-match
This fixes a serious bug where we stop executing forEachDownstream on the first downstream that does not match the network. Instead we want to simply continue; it's a basic filter.
This commit is contained in:
parent
2a0cc57e3a
commit
5ae1ec5381
4
user.go
4
user.go
@ -158,10 +158,10 @@ func newNetwork(user *user, record *Network, channels []Channel) *network {
|
|||||||
func (net *network) forEachDownstream(f func(*downstreamConn)) {
|
func (net *network) forEachDownstream(f func(*downstreamConn)) {
|
||||||
for _, dc := range net.user.downstreamConns {
|
for _, dc := range net.user.downstreamConns {
|
||||||
if dc.network == nil && !dc.isMultiUpstream {
|
if dc.network == nil && !dc.isMultiUpstream {
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
if dc.network != nil && dc.network != net {
|
if dc.network != nil && dc.network != net {
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
f(dc)
|
f(dc)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user