]> Cypherpunks repositories - gostls13.git/commit
net/http: close Request.Body when pconn write loop exits early
authorDamien Neil <dneil@google.com>
Wed, 11 Jan 2023 21:47:38 +0000 (13:47 -0800)
committerDamien Neil <dneil@google.com>
Fri, 20 Jan 2023 01:06:03 +0000 (01:06 +0000)
commit045b33ecfe4db7af6344cb5227c3d31501eb8cba
tree3b96c5f9ec8fa44cc6f321a75e0c6ef0b253e1c6
parent78558d5e10a30c88c0b564e69963a0f0188c1dbd
net/http: close Request.Body when pconn write loop exits early

The pconn write loop closes a request's body after sending the
request, but in the case where the write loop exits with an
unsent request in writech the body is never closed.

Close the request body in this case.

Fixes #49621

Change-Id: Id94a92937bbfc0beb1396446f4dee32fd2059c7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/461675
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/transport.go
src/net/http/transport_test.go