From 9a8f381923ee8c93363158dc17d0f92c35ab6d29 Mon Sep 17 00:00:00 2001 From: Ola Bini Date: Fri, 20 Dec 2019 18:06:27 +0000 Subject: [PATCH] The work group should have different entries if we are listening to the web port or not --- server/server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index 7bfd923..539f0c5 100644 --- a/server/server.go +++ b/server/server.go @@ -1498,7 +1498,12 @@ func (server *Server) Start() (err error) { // for the servers. Each network goroutine defers a call to // netwg.Done(). In the Stop() we close all the connections // and call netwg.Wait() to wait for the goroutines to end. - server.netwg.Add(3) + numWG := 2 + if shouldListenWeb { + numWG++ + } + + server.netwg.Add(numWG) go server.udpListenLoop() go server.acceptLoop(server.tlsl) if shouldListenWeb {