diff --git a/server/client.go b/server/client.go
index 85b4c19f771..9b98a5d3000 100644
--- a/server/client.go
+++ b/server/client.go
@@ -110,6 +110,7 @@ type client struct {
parseState
route *route
+ debug bool
trace bool
flags clientFlag // Compact booleans into a single field. Size will be increased when needed.
@@ -179,6 +180,7 @@ func (c *client) initClient() {
c.cid = atomic.AddUint64(&s.gcid, 1)
c.bw = bufio.NewWriterSize(c.nc, startBufSize)
c.subs = make(map[string]*subscription)
+ c.debug = (atomic.LoadInt32(&debug) != 0)
c.trace = (atomic.LoadInt32(&trace) != 0)
// This is a scratch buffer used for processMsg()
diff --git a/server/server.go b/server/server.go
index 254e833f64a..f93d7792e37 100644
--- a/server/server.go
+++ b/server/server.go
@@ -341,7 +341,7 @@ func (s *Server) Shutdown() {
}
// AcceptLoop is exported for easier testing.
-func (s *Server) AcceptLoop(clientListenReady chan struct{}) {
+func (s *Server) AcceptLoop(clr chan struct{}) {
hp := net.JoinHostPort(s.opts.Host, strconv.Itoa(s.opts.Port))
Noticef("Listening for client connections on %s", hp)
l, e := net.Listen("tcp", hp)
@@ -383,7 +383,7 @@ func (s *Server) AcceptLoop(clientListenReady chan struct{}) {
s.mu.Unlock()
// Let the caller know that we are ready
- close(clientListenReady)
+ close(clr)
tmpDelay := ACCEPT_MIN_SLEEP