Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2020-04-14 09:26:35 -07:00
parent dda1046305
commit aff10aa16b
2 changed files with 177 additions and 0 deletions

View File

@@ -1056,6 +1056,10 @@ func (s *Server) initLeafNodeSmap(c *client) int {
} else {
acc.sl.All(&subs)
}
// Check if we have an existing service import reply.
siReply := acc.siReply
// Since leaf nodes only send on interest, if the bound
// account has import services we need to send those over.
for isubj := range acc.imports.services {
@@ -1117,6 +1121,13 @@ func (s *Server) initLeafNodeSmap(c *client) int {
// if this is coming back to us.
c.leaf.smap[lds]++
// Check if we need to add an existing siReply to our map.
// This will be a prefix so add on the wildcard.
if siReply != nil {
wcsub := append(siReply, '>')
c.leaf.smap[string(wcsub)]++
}
lenMap := len(c.leaf.smap)
c.mu.Unlock()
return lenMap