Skip to content

Commit 9253a53

Browse files
czoczobelak
authored andcommitted
Fix connection kill, when IdleTimeout given without setting MaxTimeout.
1 parent ef6d890 commit 9253a53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

conn.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (c *serverConn) updateDeadline() {
4444
switch {
4545
case c.idleTimeout > 0:
4646
idleDeadline := time.Now().Add(c.idleTimeout)
47-
if idleDeadline.Unix() < c.maxDeadline.Unix() {
47+
if idleDeadline.Unix() < c.maxDeadline.Unix() || c.maxDeadline.IsZero() {
4848
c.Conn.SetDeadline(idleDeadline)
4949
return
5050
}

0 commit comments

Comments
 (0)