php/php-src — pull request #709 by dmitry-saprykin (2014-07-07 10:27:26+00:00)
Title: * double fastcgi_end_request on max_children limit

Php sends 2 fastcgi FCGI_END_REQUEST records instead of one when `fastcgi_finish_request();` called and fpm param max_requests exceeded.

* one is sent on `fastcgi_finish_request();` call
* other is sent in block
`
fpm_main.c:1951
requests++;
if (max_requests && (requests == max_requests)) {
fcgi_finish_request(&request, 1);
break;
}
`

It confuses fastcgi client (i.e. nginx) receiving 2 FCGI_END_REQUEST records one after another.
So I have set `request->closed` flag to prevent second FastCGI record sending.