File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 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() {
18851885// onReadTimeout is run on its own goroutine (from time.AfterFunc) 
18861886// when the stream's ReadTimeout has fired. 
18871887func  (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+ 	}
18911893}
18921894
18931895// onWriteTimeout is run on its own goroutine (from time.AfterFunc) 
@@ -2005,9 +2007,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error {
20052007	// (in Go 1.8), though. That's a more sane option anyway. 
20062008	if  sc .hs .ReadTimeout  !=  0  {
20072009		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 )
20112011	}
20122012
20132013	go  sc .runHandler (rw , req , handler )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments