From f27c1b9d07f05c49cbcabc5637a2da223885886b Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 15 Feb 2008 14:45:42 +0000 Subject: optimization --- sapi/cgi/cgi_main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sapi/cgi/cgi_main.c') diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 4277ed05cc..257e6fcbb4 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -756,7 +756,17 @@ static int sapi_cgi_deactivate(TSRMLS_D) 2. When the first call occurs and the request is not set up, flush fails on FastCGI. */ if (SG(sapi_started)) { - sapi_cgibin_flush(SG(server_context)); + if (fcgi_is_fastcgi()) { + if ( +#ifndef PHP_WIN32 + !parent && +#endif + !fcgi_finish_request((fcgi_request*)SG(server_context))) { + php_handle_aborted_connection(); + } + } else { + sapi_cgibin_flush(SG(server_context)); + } } return SUCCESS; } -- cgit v1.2.1