summaryrefslogtreecommitdiff
path: root/sapi/cgi
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2004-05-06 15:23:53 +0000
committerStanislav Malyshev <stas@php.net>2004-05-06 15:23:53 +0000
commit74ab20817a1e940ca5c463e465e9ce7a3e919bd8 (patch)
treeb96d6ab87f63d57cbab386329977cf26f6553a03 /sapi/cgi
parent0dae58bb2a648747bb1326a06285c0210dcc6a45 (diff)
downloadphp-git-74ab20817a1e940ca5c463e465e9ce7a3e919bd8.tar.gz
Fix fastCGI breakage: due to calling flush on unitialized requests,
request was aborted unless ignore_user_abort is set
Diffstat (limited to 'sapi/cgi')
-rw-r--r--sapi/cgi/cgi_main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 760101d969..9624f92adb 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -486,11 +486,17 @@ static void sapi_cgi_log_message(char *message)
static int sapi_cgi_deactivate(TSRMLS_D)
{
- sapi_cgibin_flush(SG(server_context));
+ /* flush only when SAPI was started. The reasons are:
+ 1. SAPI Deactivate is called from two places: module init and request shutdown
+ 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));
+ }
return SUCCESS;
}
-
static int php_cgi_startup(sapi_module_struct *sapi_module)
{
if (php_module_startup(sapi_module, NULL, 0) == FAILURE) {