Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

Commit

Permalink
Fix idle timeout < 1
Browse files Browse the repository at this point in the history
  • Loading branch information
vcabbage committed Jun 1, 2018
1 parent 390d7ea commit b9bf967
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,9 @@ func (c *conn) connReader() {
// need to read more if buf doesn't contain the complete frame
// or there's not enough in buf to parse the header
if frameInProgress || buf.len() < frameHeaderSize {
_ = c.net.SetReadDeadline(time.Now().Add(c.idleTimeout))
if c.idleTimeout > 0 {
_ = c.net.SetReadDeadline(time.Now().Add(c.idleTimeout))
}
err := buf.readFromOnce(c.net)
if err != nil {
select {
Expand Down

0 comments on commit b9bf967

Please sign in to comment.