1
0
mirror of https://github.com/golang/go synced 2024-11-27 04:41:33 -07:00
go/src/net/http
Hilko Bengen fff236e659 net/http/fcgi: eliminate race, keep request id until end of stdin
There was a race condition that could lead to child.serveRequest
removing the request ID before child.handleRequest had read the empty
FCGI_STDIN message that indicates end-of-stream which in turn could
lead to child.serveRequest blocking while trying to consume the
request body.

Now, we remove the request ID from within child.handleRequest after
the end of stdin has been detected, eliminating the race condition.

Since there are no more concurrent modifications/accesses
to child.requests, we remove the accompanying sync.Mutex.

Change-Id: I80c68e65904a988dfa9e3cceec1829496628ff34
GitHub-Last-Rev: b3976111ae
GitHub-Pull-Request: golang/go#42840
Reviewed-on: https://go-review.googlesource.com/c/go/+/273366
Trust: Damien Neil <dneil@google.com>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
2021-04-16 19:34:33 +00:00
..
cgi net/http/cgi: Remove hard-coded ServeHTTP timeout 2021-04-16 18:46:27 +00:00
cookiejar
fcgi net/http/fcgi: eliminate race, keep request id until end of stdin 2021-04-16 19:34:33 +00:00
httptest net/http/httptest: panic on non-3 digit (XXX) status code in Recorder.WriteHeader 2021-04-14 21:58:06 +00:00
httptrace
httputil all: fix spellings 2021-04-10 01:46:41 +00:00
internal
pprof all: fix spellings 2021-04-10 01:46:41 +00:00
testdata
alpn_test.go
client_test.go all: fix spellings 2021-04-10 01:46:41 +00:00
client.go
clientserver_test.go
clone.go
cookie_test.go
cookie.go
doc.go
example_filesystem_test.go
example_handle_test.go
example_test.go
export_test.go
filetransport_test.go
filetransport.go
fs_test.go net/http: using errors.Is in fs error detection 2021-04-16 16:36:57 +00:00
fs.go net/http: using errors.Is in fs error detection 2021-04-16 16:36:57 +00:00
h2_bundle.go
header_test.go
header.go
http_test.go
http.go
jar.go
main_test.go
method.go
omithttp2.go
proxy_test.go
range_test.go
readrequest_test.go
request_test.go net/http: make ReadRequest return an error when requests have multiple Host headers 2021-04-16 16:40:34 +00:00
request.go net/http: make ReadRequest return an error when requests have multiple Host headers 2021-04-16 16:40:34 +00:00
requestwrite_test.go
response_test.go
response.go
responsewrite_test.go
roundtrip_js.go
roundtrip.go
serve_test.go
server_test.go
server.go net/http: make ReadRequest return an error when requests have multiple Host headers 2021-04-16 16:40:34 +00:00
sniff_test.go
sniff.go
socks_bundle.go
status.go
transfer_test.go
transfer.go
transport_internal_test.go
transport_test.go net/http: allow multiple dials in TestTransportMaxConnsPerHost 2021-04-15 16:09:16 +00:00
transport.go all: fix spellings 2021-04-10 01:46:41 +00:00
triv.go