Incorporating comments.

c -> client
defer in oneliner
argument order

Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
Matthias Hanel
2020-03-04 15:48:19 -05:00
parent f5bd07b36c
commit fe373ac597
4 changed files with 5 additions and 5 deletions

View File

@@ -2562,7 +2562,7 @@ func (c *client) deliverMsg(sub *subscription, subject, mh, msg []byte, gwrply b
c.pcd[client] = needFlush
}
if c.trace {
if client.trace {
client.traceOutOp(string(mh[:len(mh)-LEN_CR_LF]), nil)
}

View File

@@ -1723,7 +1723,7 @@ func (c *client) processGatewayAccountSub(accName string) error {
// the sublist if present.
// <Invoked from outbound connection's readLoop>
func (c *client) processGatewayRUnsub(arg []byte, trace bool) error {
accName, subject, queue, err := c.parseUnsubProto(trace, arg)
accName, subject, queue, err := c.parseUnsubProto(arg, trace)
if err != nil {
return fmt.Errorf("processGatewaySubjectUnsub %s", err.Error())
}

View File

@@ -895,8 +895,8 @@ func (s *Server) reloadClientTraceLevel() {
update := func(c *client) {
// client.trace is commonly read while holding the lock
c.mu.Lock()
defer c.mu.Unlock()
c.setTraceLevel()
c.mu.Unlock()
}
// Iterate over every client and update

View File

@@ -668,7 +668,7 @@ func (c *client) removeRemoteSubs() {
}
}
func (c *client) parseUnsubProto(trace bool, arg []byte) (string, []byte, []byte, error) {
func (c *client) parseUnsubProto(arg []byte, trace bool) (string, []byte, []byte, error) {
if trace {
c.traceInOp("RS-", arg)
}
@@ -695,7 +695,7 @@ func (c *client) processRemoteUnsub(arg []byte, trace bool) (err error) {
if srv == nil {
return nil
}
accountName, subject, _, err := c.parseUnsubProto(trace, arg)
accountName, subject, _, err := c.parseUnsubProto(arg, trace)
if err != nil {
return fmt.Errorf("processRemoteUnsub %s", err.Error())
}