patch potential race condition requesting topic before upstream has connected

--HG--
branch : nmdc-ircfrontend
This commit is contained in:
. 2016-05-05 19:28:12 +12:00
parent 62487dd437
commit cc22ee33ae

View File

@ -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