1
0
mirror of https://github.com/bgp/stayrtr.git synced 2024-05-06 15:54:54 +00:00

Fix EOF issue

This commit is contained in:
Louis Poinsignon
2018-08-28 15:13:38 -07:00
parent 11b089f474
commit 9d057d936e

View File

@ -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 {