From cc22ee33aec1810f92a405c537b5dffeae0e717d Mon Sep 17 00:00:00 2001 From: "." <.@.> Date: Thu, 5 May 2016 19:28:12 +1200 Subject: [PATCH] patch potential race condition requesting topic before upstream has connected --HG-- branch : nmdc-ircfrontend --- server.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server.go b/server.go index 7068119..4ecd93c 100644 --- a/server.go +++ b/server.go @@ -112,9 +112,6 @@ func (s *Server) RunWorker() { func (s *Server) upstreamWorker() { - // Initiate connection - s.upstream = s.upstreamLauncher.Connect() - // Read loop for { select { @@ -208,6 +205,7 @@ func (s *Server) handleCommand(command string, args []string) { s.clientRegistered = true // Spawn upstream connection + s.upstream = s.upstreamLauncher.Connect() go s.upstreamWorker() // Tell the user that they themselves joined the chat channel