mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Holding lock when accessing leaf node account for filtering
Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
@@ -1765,8 +1765,13 @@ func (s *Server) Leafz(opts *LeafzOptions) (*Leafz, error) {
|
||||
if len(s.leafs) > 0 {
|
||||
lconns = make([]*client, 0, len(s.leafs))
|
||||
for _, ln := range s.leafs {
|
||||
if opts != nil && opts.Account != "" && ln.acc.Name != opts.Account {
|
||||
continue
|
||||
if opts != nil && opts.Account != "" {
|
||||
ln.mu.Lock()
|
||||
ok := ln.acc.Name == opts.Account
|
||||
ln.mu.Unlock()
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
}
|
||||
lconns = append(lconns, ln)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user