]> Cypherpunks repositories - gostls13.git/commit
net/http: document concurrency expectations for Request.Body
authorRoss Light <ross@zombiezen.com>
Thu, 27 Aug 2020 20:08:29 +0000 (13:08 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 16 Oct 2020 16:52:13 +0000 (16:52 +0000)
commitdfee3332e66bd3f3afd76615767d2cd9b1905b26
treefb7a6089b31875a62093ed3ff102f86e254bd25d
parentc06a699fb69e17274905bc8d9942de4a4ab8b31b
net/http: document concurrency expectations for Request.Body

This is primarily aimed at client requests where the user can supply
their own io.ReadCloser, but also clarifies server request behavior.
A server request body can be one of:

- *body
- *http2RequestBody
- *expectContinueReader
- *maxBytesReader

Of those, *expectContinueReader did not meet these expectations, so this
change also removes the data race.

Change-Id: Id4f1ae573d938347b1123a7b612b271aabb045a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/251087
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/net/http/request.go
src/net/http/server.go