From 9d057d936e9f78085e9045820c611dd5111adad4 Mon Sep 17 00:00:00 2001 From: Louis Poinsignon Date: Tue, 28 Aug 2018 15:13:38 -0700 Subject: [PATCH] Fix EOF issue --- lib/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/server.go b/lib/server.go index d23cc11..e6bc592 100644 --- a/lib/server.go +++ b/lib/server.go @@ -632,11 +632,12 @@ func (c *Client) Start() { buf := make([]byte, 8000) for c.connected { length, err := c.tcpconn.Read(buf) - if err != nil { + if err != nil || length == 0 { log.Debugf("Error %v", err) c.Disconnect() return } + pkt := buf[0:length] dec, _ := DecodeBytes(pkt) if !c.disableVersionCheck {