From 41139cdd729689b5655e9c9caa8116c699be4aaf Mon Sep 17 00:00:00 2001 From: "." <.@.> Date: Sat, 7 May 2016 17:50:39 +1200 Subject: [PATCH] fix infinite loop on client disconnected socket --HG-- branch : nmdc-ircfrontend --- server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index a688d7c..fd01c45 100644 --- a/server.go +++ b/server.go @@ -101,8 +101,12 @@ func (s *Server) RunWorker() { if err == io.EOF { break // abandon thread } + + // If this was a /timeout/, send a KA and continue. + + // But otherwise, it was a real error (e.g. unexpected disconnect) s.verboseln(err.Error()) - continue + break // abandon } rawLines := buf[:ln]