From e319b5f6a52cabae648681f178eafde3229a266d Mon Sep 17 00:00:00 2001 From: "Thies C. Arntzen" Date: Thu, 25 May 2000 07:01:34 +0000 Subject: [PATCH] @- ignore_user_abort() & friends should now work in CGI mode as well. @ (Patch by daniel.braun@ercom.fr) --- sapi/cgi/cgi_main.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 1be7665563..d36a862663 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -86,13 +86,31 @@ extern int ap_php_optind; static int sapi_cgibin_ub_write(const char *str, uint str_length) { - return fwrite(str, 1, str_length, stdout); + int ret; + PLS_FETCH(); + + ret = fwrite(str, 1, str_length, stdout); + if (ret != str_length) { + PG(connection_status) = PHP_CONNECTION_ABORTED; + if (!PG(ignore_user_abort)) { + zend_bailout(); + } + } + + return ret; } static void sapi_cgibin_flush(void *server_context) { - fflush(stdout); + PLS_FETCH(); + + if (fflush(stdout)) { + PG(connection_status) = PHP_CONNECTION_ABORTED; + if (!PG(ignore_user_abort)) { + zend_bailout(); + } + } } -- 2.40.0