mirror of
https://github.com/golang/go
synced 2024-11-17 20:04:47 -07:00
net/http: stop timeout timer if user cancels a request
Change-Id: I84faeae69f294b9a70e545faac6a070feba67770 Reviewed-on: https://go-review.googlesource.com/28074 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
6f43a989b0
commit
2af00eb63c
@ -329,6 +329,7 @@ func setRequestCancel(req *Request, rt RoundTripper, deadline time.Time) (stopTi
|
||||
select {
|
||||
case <-initialReqCancel:
|
||||
doCancel()
|
||||
timer.Stop()
|
||||
case <-timer.C:
|
||||
doCancel()
|
||||
case <-stopTimerCh:
|
||||
|
Loading…
Reference in New Issue
Block a user