]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.14] net/http: fix cancelation of requests with a readTrackingBody...
authorDamien Neil <dneil@google.com>
Tue, 28 Jul 2020 19:49:52 +0000 (12:49 -0700)
committerDmitri Shuralyov <dmitshur@golang.org>
Thu, 27 Aug 2020 20:20:31 +0000 (20:20 +0000)
commit90176421eca9d1c8dc6b8560c56ed42abf51ed76
tree2c64a3208d795e0de321e68a490e3d76d04499eb
parentfae8e09d26f3bb065475abd44b47f54e25179cdc
[release-branch.go1.14] net/http: fix cancelation of requests with a readTrackingBody wrapper

Use the original *Request in the reqCanceler map, not the transient
wrapper created to handle body rewinding.

Change the key of reqCanceler to a struct{*Request}, to make it more
difficult to accidentally use the wrong request as the key.

Updates #40453.
Fixes #41016.

Change-Id: I4e61ee9ff2c794fb4c920a3a66c9a0458693d757
Reviewed-on: https://go-review.googlesource.com/c/go/+/245357
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/250299
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/http/transport.go
src/net/http/transport_test.go