diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/net/http/transport.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net/http/transport.go b/src/net/http/transport.go index 782f7cd395..b751ffbcfc 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -1087,7 +1087,9 @@ WaitResponse: break WaitResponse } if d := pc.t.ResponseHeaderTimeout; d > 0 { - respHeaderTimer = time.After(d) + timer := time.NewTimer(d) + defer timer.Stop() // prevent leaks + respHeaderTimer = timer.C } case <-pconnDeadCh: // The persist connection is dead. This shouldn't |
