From 722a48d726bc2734aefdae97134e21a172ef4806 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Sat, 8 Apr 2023 20:05:33 -0700 Subject: [PATCH] Don't require lock for check no echo status Signed-off-by: Derek Collison --- server/client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/client.go b/server/client.go index cb01533e..410a9676 100644 --- a/server/client.go +++ b/server/client.go @@ -3097,9 +3097,11 @@ var needFlush = struct{}{} // deliverMsg will deliver a message to a matching subscription and its underlying client. // We process all connection/client types. mh is the part that will be protocol/client specific. func (c *client) deliverMsg(prodIsMQTT bool, sub *subscription, acc *Account, subject, reply, mh, msg []byte, gwrply bool) bool { - if sub.client == nil { + // Check sub client and check echo + if sub.client == nil || c == sub.client && !sub.client.echo { return false } + client := sub.client client.mu.Lock() @@ -4151,7 +4153,7 @@ func (c *client) processMsgResults(acc *Account, r *SublistResult, msg, deliver, // delivery subject for clients var dsubj []byte // Used as scratch if mapping - var _dsubj [64]byte + var _dsubj [128]byte // For stats, we will keep track of the number of messages that have been // delivered and then multiply by the size of that message and update