From 6f9d542393ec0da692012877988378a515084ff8 Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Tue, 26 Jul 2016 12:25:33 -0600 Subject: [PATCH] Minor changes based on comments --- server/client.go | 2 ++ server/server.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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