Descriptionnet/http/fcgi: fix handling of request ID reuse
Request ID reuse is allowed by the FastCGI spec [1]. In particular nginx uses
the same request ID, 1, for all requests on a given connection. Because
serveRequest does not remove the request from conn.requests, this causes it to
treat the second request as a duplicate and drops the connection immediately
after beginRequest. This manifests with nginx option 'fastcgi_keep_conn on' as
the following message in nginx error log:
2014/03/17 01:39:13 [error] 730#0: *109 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: x.x.x.x, server: example.org, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "example.org"
Because handleRecord and serveRequest run in different goroutines, access to
conn.requests must now be synchronized.
[1] http://www.fastcgi.com/drupal/node/6?q=node/22#S3.3
Patch Set 1 #Patch Set 2 : diff -r 32b8c26e4414 https://code.google.com/p/go/ #Patch Set 3 : diff -r 32b8c26e4414 https://code.google.com/p/go/ #
Total comments: 2
Patch Set 4 : diff -r 32b8c26e4414 https://code.google.com/p/go/ #MessagesTotal messages: 5
|