]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: fix deadlock in DumpRequestOut
authorSteven Hartland <steven.hartland@multiplay.co.uk>
Thu, 7 May 2020 10:08:08 +0000 (10:08 +0000)
committerBryan C. Mills <bcmills@google.com>
Wed, 6 Jan 2021 15:02:50 +0000 (15:02 +0000)
commitd2131704a6fda781bd3b823dbe8f57741663f466
tree623d9180ebcc8e50b6d17e4928271204d90ce4c2
parent3e1e13ce6d1271f49f3d8ee359689145a6995bad
net/http/httputil: fix deadlock in DumpRequestOut

Fix a deadlock in DumpRequestOut which can occur if the request is
cancelled between response being sent and it being processed.

Also:
* Ensure we don't get a reader leak when an error is reported by the
  transport before the body is consumed.
* Add leaked goroutine retries to avoid false test failures.

Fixes #38352

Change-Id: I83710791b2985b997f61fe5b49eadee0bb51bdee
Reviewed-on: https://go-review.googlesource.com/c/go/+/232798
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Damien Neil <dneil@google.com>
src/net/http/httputil/dump.go
src/net/http/httputil/dump_test.go