Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Fix EOF issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lspgn committed Aug 28, 2018
1 parent 11b089f commit 9d057d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9d057d9

Please sign in to comment.