diff --git a/transport/internet/kcp/connection.go b/transport/internet/kcp/connection.go index f31e54f0b227..60e597cf2371 100644 --- a/transport/internet/kcp/connection.go +++ b/transport/internet/kcp/connection.go @@ -302,7 +302,7 @@ func (c *Connection) waitForDataInput() error { select { case <-c.dataInput.Wait(): case <-timeout.C: - if !c.rd.IsZero() && c.rd.Before(time.Now()) { + if c.rd.IsZero() || c.rd.Before(time.Now()) { return ErrIOTimeout } }