Skip to content

Commit

Permalink
Increase readTimeout tolerance according to RFC
Browse files Browse the repository at this point in the history
About Heart Beating, RFC states that:
 > because of timing inaccuracies, the receiver SHOULD be tolerant and take into account an error margin
Adapt the readTimeout to be more tolerant
  • Loading branch information
anthonyraymond committed Jan 6, 2021
1 parent ca15f4f commit 69b583e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/client/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (c *Conn) readLoop() {
// infinite timeout
c.rw.SetReadDeadline(time.Time{})
} else {
c.rw.SetReadDeadline(time.Now().Add(readTimeout))
c.rw.SetReadDeadline(time.Now().Add(readTimeout * 2))
}
f, err := reader.Read()
if err != nil {
Expand Down

0 comments on commit 69b583e

Please sign in to comment.