Don't require lock for check no echo status

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-04-08 20:05:33 -07:00
parent c6b2a97ef4
commit 722a48d726

View File

@@ -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