File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1885,9 +1885,11 @@ func (st *stream) copyTrailersToHandlerRequest() {
1885
1885
// onReadTimeout is run on its own goroutine (from time.AfterFunc)
1886
1886
// when the stream's ReadTimeout has fired.
1887
1887
func (st * stream ) onReadTimeout () {
1888
- // Wrap the ErrDeadlineExceeded to avoid callers depending on us
1889
- // returning the bare error.
1890
- st .body .CloseWithError (fmt .Errorf ("%w" , os .ErrDeadlineExceeded ))
1888
+ if st .body != nil {
1889
+ // Wrap the ErrDeadlineExceeded to avoid callers depending on us
1890
+ // returning the bare error.
1891
+ st .body .CloseWithError (fmt .Errorf ("%w" , os .ErrDeadlineExceeded ))
1892
+ }
1891
1893
}
1892
1894
1893
1895
// onWriteTimeout is run on its own goroutine (from time.AfterFunc)
@@ -2005,9 +2007,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error {
2005
2007
// (in Go 1.8), though. That's a more sane option anyway.
2006
2008
if sc .hs .ReadTimeout != 0 {
2007
2009
sc .conn .SetReadDeadline (time.Time {})
2008
- if st .body != nil {
2009
- st .readDeadline = time .AfterFunc (sc .hs .ReadTimeout , st .onReadTimeout )
2010
- }
2010
+ st .readDeadline = time .AfterFunc (sc .hs .ReadTimeout , st .onReadTimeout )
2011
2011
}
2012
2012
2013
2013
go sc .runHandler (rw , req , handler )
You can’t perform that action at this time.
0 commit comments