diff options
| -rw-r--r-- | sapi/isapi/php4isapi.c | 2 | ||||
| -rw-r--r-- | sapi/nsapi/nsapi.c | 5 | ||||
| -rw-r--r-- | sapi/phttpd/phttpd.c | 4 | ||||
| -rw-r--r-- | sapi/pi3web/pi3web_sapi.c | 3 | ||||
| -rw-r--r-- | sapi/roxen/roxen.c | 3 |
5 files changed, 10 insertions, 7 deletions
diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c index b776b9b5a6..1985bd63c9 100644 --- a/sapi/isapi/php4isapi.c +++ b/sapi/isapi/php4isapi.c @@ -151,7 +151,7 @@ static int sapi_isapi_ub_write(const char *str, uint str_length) ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC ) == FALSE) { - zend_bailout(); + php_handle_aborted_connection(); } return num_bytes; } diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 70b002b6c3..e7bd45ea83 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -141,9 +141,8 @@ sapi_nsapi_ub_write(const char *str, unsigned int str_length) rc = (nsapi_request_context *)SG(server_context); retval = net_write(rc->sn->csd, (char *)str, str_length); if (retval == IO_ERROR /*-1*/ || retval == IO_EOF /*0*/) - return -1; - else - return retval; + php_handle_aborted_connection(); + return retval; } static int diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c index e8be996d6b..29733bcfd4 100644 --- a/sapi/phttpd/phttpd.c +++ b/sapi/phttpd/phttpd.c @@ -69,7 +69,9 @@ php_phttpd_sapi_ub_write(const char *str, uint str_length) sent_bytes = fd_write(PHG(cip)->fd,str,str_length); - if (sent_bytes == -1) perror("fd_write\n"); + if (sent_bytes == -1) { + php_handle_aborted_connection(); + } return sent_bytes; } diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index 0f148f632a..cb009ed29b 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -145,6 +145,9 @@ static int zend_pi3web_ub_write(const char *str, uint str_length) if ( !IWasLoaded ) return 0; cb->WriteClient(cb->ConnID, (char *) str, &num_bytes, 0 ); + + if (num_bytes != str_length) + php_handle_aborted_connection(); return num_bytes; } diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c index 594ca16819..4b6feac3b0 100644 --- a/sapi/roxen/roxen.c +++ b/sapi/roxen/roxen.c @@ -233,8 +233,7 @@ php_roxen_low_ub_write(const char *str, uint str_length) { pop_stack(); if(sent_bytes != str_length) { /* This means the connection is closed. Dead. Gone. *sniff* */ - PG(connection_status) = PHP_CONNECTION_ABORTED; - zend_bailout(); + php_handle_aborted_connection(); } return sent_bytes; } |
