Skip to content

Commit

Permalink
Fix connection kill, when IdleTimeout given without setting MaxTimeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
czoczo authored and belak committed Mar 31, 2019
1 parent ef6d890 commit 9253a53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *serverConn) updateDeadline() {
switch {
case c.idleTimeout > 0:
idleDeadline := time.Now().Add(c.idleTimeout)
if idleDeadline.Unix() < c.maxDeadline.Unix() {
if idleDeadline.Unix() < c.maxDeadline.Unix() || c.maxDeadline.IsZero() {
c.Conn.SetDeadline(idleDeadline)
return
}
Expand Down

0 comments on commit 9253a53

Please sign in to comment.