From 734613015ec77a852d4fe685fc36c5fce1f95eb0 Mon Sep 17 00:00:00 2001 From: dingjun Date: Wed, 14 Oct 2020 17:01:10 +0800 Subject: [PATCH] fix possible dead loop --- server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 52a5b50..7c31ca8 100644 --- a/server.go +++ b/server.go @@ -72,8 +72,10 @@ func forwardWS2TCP(conn1 *websocket.Conn, conn2 net.Conn) { for { n, err := conn2.Read(buf) - if err != nil && err != io.EOF { - log.Errorln(err) + if err != nil { + if err != io.EOF { + log.Errorln(err) + } break }