diff --git a/server.go b/server.go index e2c4800..0f25708 100644 --- a/server.go +++ b/server.go @@ -126,15 +126,15 @@ func handleConnection(s *server, conn net.Conn) { logging.Logger.Debug(fmt.Sprintf("Server: Client[%s] is connected.", conn.RemoteAddr())) clientStopChan := make(chan struct{}) - handleDoneCnah := make(chan struct{}) - go s.sh.Handle(conn, clientStopChan, handleDoneCnah) + handleDoneChan := make(chan struct{}) + go s.sh.Handle(conn, clientStopChan, handleDoneChan) select { case <-s.stopChan: close(clientStopChan) conn.Close() - <-handleDoneCnah - case <-handleDoneCnah: + <-handleDoneChan + case <-handleDoneChan: close(clientStopChan) conn.Close() logging.Logger.Debug(fmt.Sprintf("Server: Client[%s] is disconnected.", conn.RemoteAddr()))