mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
Moving the Request.Body.Close call out from the ClientConn mutex results in some cases where RoundTrip returns while the Close is still in progress. This should be legal (RoundTrip explicitly allows for this), but net/http relies on Close never being called after RoundTrip returns. Add additional synchronization to ensure Close calls complete before RoundTrip returns. Fixes golang/go#55896 Change-Id: Ie3d4773966745e83987d219927929cb56ec1a7ad Reviewed-on: https://go-review.googlesource.com/c/net/+/435535 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>