]> Cypherpunks repositories - gostls13.git/commit
net/http: fix server/transport data race when sharing the request body
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 3 Aug 2015 08:04:42 +0000 (10:04 +0200)
committerIan Lance Taylor <iant@golang.org>
Mon, 3 Aug 2015 16:06:17 +0000 (16:06 +0000)
commit7aa4e29dce2b941644ff1f19e528ccc4790c519e
tree27c98c6c3ea85ec4b04fd3e7c5c2563264c99357
parent5e15e28e0ed0c70a9c97310d3a7b408cae8f2e23
net/http: fix server/transport data race when sharing the request body

Introduced in https://go-review.googlesource.com/12865 (git rev c2db5f4c).

This fix doesn't add any new lock acquistions: it just moves the
existing one taken by the unreadDataSize method and moves it out
wider.

It became flaky at rev c2db5f4c, but now reliably passes again:
$ go test -v -race -run=TestTransportAndServerSharedBodyRace -count=100 net/http

Fixes #11985

Change-Id: I6956d62839fd7c37e2f7441b1d425793f4a0db30
Reviewed-on: https://go-review.googlesource.com/12909
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/http/server.go
src/net/http/transfer.go