@@ -434,7 +434,7 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) {
434
434
// passes the connection off to us with the deadline already set.
435
435
// Write deadlines are set per stream in serverConn.newStream.
436
436
// Disarm the net.Conn write deadline here.
437
- if sc .hs .WriteTimeout != 0 {
437
+ if sc .hs .WriteTimeout > 0 {
438
438
sc .conn .SetWriteDeadline (time.Time {})
439
439
}
440
440
@@ -2017,7 +2017,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error {
2017
2017
// similar to how the http1 server works. Here it's
2018
2018
// technically more like the http1 Server's ReadHeaderTimeout
2019
2019
// (in Go 1.8), though. That's a more sane option anyway.
2020
- if sc .hs .ReadTimeout != 0 {
2020
+ if sc .hs .ReadTimeout > 0 {
2021
2021
sc .conn .SetReadDeadline (time.Time {})
2022
2022
st .readDeadline = time .AfterFunc (sc .hs .ReadTimeout , st .onReadTimeout )
2023
2023
}
@@ -2038,7 +2038,7 @@ func (sc *serverConn) upgradeRequest(req *http.Request) {
2038
2038
2039
2039
// Disable any read deadline set by the net/http package
2040
2040
// prior to the upgrade.
2041
- if sc .hs .ReadTimeout != 0 {
2041
+ if sc .hs .ReadTimeout > 0 {
2042
2042
sc .conn .SetReadDeadline (time.Time {})
2043
2043
}
2044
2044
@@ -2116,7 +2116,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream
2116
2116
st .flow .conn = & sc .flow // link to conn-level counter
2117
2117
st .flow .add (sc .initialStreamSendWindowSize )
2118
2118
st .inflow .init (sc .srv .initialStreamRecvWindowSize ())
2119
- if sc .hs .WriteTimeout != 0 {
2119
+ if sc .hs .WriteTimeout > 0 {
2120
2120
st .writeDeadline = time .AfterFunc (sc .hs .WriteTimeout , st .onWriteTimeout )
2121
2121
}
2122
2122
0 commit comments