summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2014-01-14 09:46:40 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2014-01-14 09:46:40 -0800
commit41488d667752f631afeeac266d1a28987ba47378 (patch)
tree0b112f4bbea87899e968c94591d4e46e3bef2fd2 /api
parentca975445f4b9d38fd82bd672e43eeef8a5543720 (diff)
downloadgo-41488d667752f631afeeac266d1a28987ba47378.tar.gz
net/http: fix another data race when sharing Request.Body
Fix another issue (similar to Issue 6995) where there was a data race when sharing a server handler's Request.Body with another goroutine that out-lived the Handler's goroutine. In some cases we were not closing the incoming Request.Body (which would've required reading it until the end) if we thought it we thought we were going to be forcibly closing the underlying net.Conn later anyway. But that optimization largely moved to the transfer.go *body later, and locking was added to *body which then detected read-after-close, so now calling the (*body).Close always is both cheap and correct. No new test because TestTransportAndServerSharedBodyRace caught it, albeit only sometimes. Running: while ./http.test -test.cpu=8 -test.run=TestTransportAndServerSharedBodyRace; do true; done ... would reliably cause a race before, but not now. Update Issue 6995 Fixes Issue 7092 R=golang-codereviews, khr CC=golang-codereviews https://codereview.appspot.com/51700043
Diffstat (limited to 'api')
0 files changed, 0 insertions, 0 deletions