]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: fix race in DumpRequestOut
authorDave Cheney <dave@cheney.net>
Tue, 28 Aug 2012 23:05:30 +0000 (09:05 +1000)
committerDave Cheney <dave@cheney.net>
Tue, 28 Aug 2012 23:05:30 +0000 (09:05 +1000)
commitf8d4bb884fdb7dc98ee9fb12a9847cb1f322ecbc
tree9c8ef0b3540df389b2eeb1ede3dd2fd721c2500a
parentd199c34cf0b9c536ffd0167159fa50be2261935c
net/http/httputil: fix race in DumpRequestOut

Fixes #3892.

Swapping the order of the writers inside the MultiWriter ensures
the request will be written to buf before http.ReadRequest completes.

The fencedBuffer is not required to make the test pass on
any machine that I have access too, but as the buf is shared
across goroutines, I think it is necessary for correctness.

R=bradfitz, fullung, franciscossouza
CC=golang-dev
https://golang.org/cl/6483061
src/pkg/net/http/httputil/dump.go