]> Cypherpunks.ru repositories - gostls13.git/commit
net/http: support full-duplex HTTP/1 responses
authorDamien Neil <dneil@google.com>
Wed, 1 Mar 2023 23:17:35 +0000 (15:17 -0800)
committerDamien Neil <dneil@google.com>
Tue, 7 Mar 2023 22:52:18 +0000 (22:52 +0000)
commit457fd1d52d17fc8e73d4890150eadab3128de64d
tree63f4721598847e5a894b82dd1c52ba6d08d765a8
parent73ca5c0dace9e43330d92b751547759075d3b828
net/http: support full-duplex HTTP/1 responses

Add support for concurrently reading from an HTTP/1 request body
while writing the response.

Normally, the HTTP/1 server automatically consumes any remaining
request body before starting to write a response, to avoid deadlocking
clients which attempt to write a complete request before reading the
response.

Add a ResponseController.EnableFullDuplex method which disables this
behavior.

For #15527
For #57786

Change-Id: Ie7ee8267d8333e9b32b82b9b84d4ad28ab8edf01
Reviewed-on: https://go-review.googlesource.com/c/go/+/472636
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
api/next/57786.txt [new file with mode: 0644]
src/net/http/responsecontroller.go
src/net/http/responsecontroller_test.go
src/net/http/server.go