Commit 2af00eb6 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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: default avatarAndrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent 6f43a989
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment