]> Cypherpunks repositories - gostls13.git/commit
net/http: fix cancelation of requests with a readTrackingBody wrapper
authorDamien Neil <dneil@google.com>
Tue, 28 Jul 2020 19:49:52 +0000 (12:49 -0700)
committerDamien Neil <dneil@google.com>
Tue, 4 Aug 2020 19:27:13 +0000 (19:27 +0000)
commitf235275097eb68b36d171908cea6a0be23351a94
tree537aa71c84c473878557a8b22d95b79195c99d2e
parentf92337422ef2ca27464c198bb3426d2dc4661653
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.

Fixes #40453.

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>
src/net/http/transport.go
src/net/http/transport_test.go