return
}
- if d := c.server.idleTimeout(); d != 0 {
+ if d := c.server.idleTimeout(); d > 0 {
c.rwc.SetReadDeadline(time.Now().Add(d))
} else {
c.rwc.SetReadDeadline(time.Time{})
// ReadHeaderTimeout is the amount of time allowed to read
// request headers. The connection's read deadline is reset
// after reading the headers and the Handler can decide what
- // is considered too slow for the body. If ReadHeaderTimeout
- // is zero, the value of ReadTimeout is used. If both are
- // zero, there is no timeout.
+ // is considered too slow for the body. If zero, the value of
+ // ReadTimeout is used. If negative, or if zero and ReadTimeout
+ // is zero or negative, there is no timeout.
ReadHeaderTimeout time.Duration
// WriteTimeout is the maximum duration before timing out
WriteTimeout time.Duration
// IdleTimeout is the maximum amount of time to wait for the
- // next request when keep-alives are enabled. If IdleTimeout
- // is zero, the value of ReadTimeout is used. If both are
- // zero, there is no timeout.
+ // next request when keep-alives are enabled. If zero, the value
+ // of ReadTimeout is used. If negative, or if zero and ReadTimeout
+ // is zero or negative, there is no timeout.
IdleTimeout time.Duration
// MaxHeaderBytes controls the maximum number of bytes the