]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1] net/http/httputil: fix race in DumpRequestOut
authorDave Cheney <dave@cheney.net>
Fri, 21 Sep 2012 19:54:50 +0000 (05:54 +1000)
committerDave Cheney <dave@cheney.net>
Fri, 21 Sep 2012 19:54:50 +0000 (05:54 +1000)
commitaec9af0acba6c997b9bb61e5c3287fae2bb783bf
tree751ca3f6a88cefdf67cb72bbc07a9a5ffb3bf442
parent8851c499892c74faf670927538576fc674ff9d4a
[release-branch.go1] net/http/httputil: fix race in DumpRequestOut

««« backport 3b78b41a4b50
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