mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Don't require lock for check no echo status
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user