From: Ben Mansell Date: Fri, 7 Mar 2003 14:48:28 +0000 (+0000) Subject: Fix bug whereby a webserver closing stdout from the CGI/FastCGI binary X-Git-Tag: RELEASE_0_5~562 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d8283fa570da8f1296dd1be54b962b18db02d25;p=php Fix bug whereby a webserver closing stdout from the CGI/FastCGI binary would cause PHP to get caught in an infinite loop of failing write() syscalls. --- diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index e540039ee4..2eb0e4cd5b 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -254,6 +254,7 @@ static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC) ret = sapi_cgibin_single_write(ptr, remaining TSRMLS_CC); if (!ret) { php_handle_aborted_connection(); + return str_length - remaining; } ptr += ret; remaining -= ret;