Check if connection name was already set when storing it

Signed-off-by: Waldemar Quevedo <wally@nats.io>
This commit is contained in:
Waldemar Quevedo
2023-01-27 11:04:38 -08:00
parent c2d3d9c467
commit c6e263f910

View File

@@ -1883,7 +1883,7 @@ func (c *client) processConnect(arg []byte) error {
}
}
if ncs != _EMPTY_ {
c.ncs.Store(fmt.Sprintf("%s - %q", c, ncs))
c.ncs.CompareAndSwap(nil, fmt.Sprintf("%s - %q", c, ncs))
}
}