]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: stop timeout timer if user cancels a request
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 30 Aug 2016 01:09:32 +0000 (01:09 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 30 Aug 2016 02:06:07 +0000 (02:06 +0000)
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>

src/net/http/client.go

index 58b584c8abe262dc4fd4309795d9088868a6e874..facfb41e3807e933e535cb8a08ac2c6ee9501f10 100644 (file)
@@ -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: