]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: close hijacked connections when CloseWrite not available
authorDamien Neil <dneil@google.com>
Thu, 6 Mar 2025 21:24:58 +0000 (13:24 -0800)
committerGopher Robot <gobot@golang.org>
Mon, 10 Mar 2025 15:11:43 +0000 (08:11 -0700)
commit22d5d09f1e39bf0ef77bfcf80388c676e7e91574
tree0b954411e0ffe53785d642942f315660f2a3e273
parentbc5f4a555e933e6861d12edba4c2d87ef6caf8e6
net/http/httputil: close hijacked connections when CloseWrite not available

CL 637939 changed ReverseProxy's handling of hijacked connections:
After copying all data in one direction, it half-closes the outbound
connection rather than fully closing both.

Revert to the old behavior when the outbound connection does not support
CloseWrite, avoiding a case where one side of the proxied connection closes
but the other remains open.

Fixes #72140

Change-Id: Ic0cacaa6323290f89ba48fd6cae737e86045a435
Reviewed-on: https://go-review.googlesource.com/c/go/+/655595
Reviewed-by: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go