Commit f96fa06d authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http/fcgi: fix race between serveRequest and cleanUp

Fixes #11552

Change-Id: I87904e9e3fb4bd1fb4c7075a4e2d0151e5bd37df
Reviewed-on: https://go-review.googlesource.com/11890
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarMikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
parent b3a8b057
...@@ -289,6 +289,8 @@ func (c *child) serveRequest(req *request, body io.ReadCloser) { ...@@ -289,6 +289,8 @@ func (c *child) serveRequest(req *request, body io.ReadCloser) {
} }
func (c *child) cleanUp() { func (c *child) cleanUp() {
c.mu.Lock()
defer c.mu.Unlock()
for _, req := range c.requests { for _, req := range c.requests {
if req.pw != nil { if req.pw != nil {
// race with call to Close in c.serveRequest doesn't matter because // race with call to Close in c.serveRequest doesn't matter because
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment