From: Ilia Alshanetsky Date: Fri, 1 Aug 2003 20:21:21 +0000 (+0000) Subject: MFH: Fixed bug #22072 (Apache2 sapis do not detect aborted connections) X-Git-Tag: php-4.3.3RC3~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f7f4f5bb88f958b3afa5b6eef2df38b7d0e225e;p=php MFH: Fixed bug #22072 (Apache2 sapis do not detect aborted connections) --- diff --git a/NEWS b/NEWS index b1b00e7941..8ded101e50 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ PHP 4 NEWS register_shutdown_function()). (Ilia) - Fixed bug #22154 (Possible crash when memory_limit is reached and output buffering in addition to session.use_trans_sid is used). (Ilia) +- Fixed bug #22072 (Apache2 sapis do not detect aborted connections). (Ilia) 30 Jul 2003, Version 4.3.3RC2 - Improved the NSAPI SAPI module (Uwe Schindler) diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index 677e89e1f1..66fd5700bc 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -86,7 +86,7 @@ php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) APR_BRIGADE_INSERT_TAIL(bb, b); #endif - if (ap_pass_brigade(f->next, bb) != APR_SUCCESS) { + if (ap_pass_brigade(f->next, bb) != APR_SUCCESS || ctx->r->connection->aborted) { php_handle_aborted_connection(); } @@ -248,7 +248,7 @@ php_apache_sapi_flush(void *server_context) bb = apr_brigade_create(ctx->r->pool, ba); b = apr_bucket_flush_create(ba); APR_BRIGADE_INSERT_TAIL(bb, b); - if (ap_pass_brigade(f->next, bb) != APR_SUCCESS) { + if (ap_pass_brigade(f->next, bb) != APR_SUCCESS || ctx->r->connection->aborted) { php_handle_aborted_connection(); } } @@ -477,7 +477,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) rv = ap_pass_brigade(f->next, prebb); /* XXX: destroy the prebb, since we know we're * done with it? */ - if (rv != APR_SUCCESS) { + if (rv != APR_SUCCESS || ctx->r->connection->aborted) { php_handle_aborted_connection(); } } diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 5e64c5161c..1494a2f407 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -86,7 +86,7 @@ php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) APR_BRIGADE_INSERT_TAIL(brigade, bucket); - if (ap_pass_brigade(r->output_filters, brigade) != APR_SUCCESS) { + if (ap_pass_brigade(r->output_filters, brigade) != APR_SUCCESS || r->connection->aborted) { php_handle_aborted_connection(); } /* Ensure this brigade is empty for the next usage. */ @@ -263,7 +263,7 @@ php_apache_sapi_flush(void *server_context) /* Send a flush bucket down the filter chain. */ bucket = apr_bucket_flush_create(r->connection->bucket_alloc); APR_BRIGADE_INSERT_TAIL(brigade, bucket); - if (ap_pass_brigade(r->output_filters, brigade) != APR_SUCCESS) { + if (ap_pass_brigade(r->output_filters, brigade) != APR_SUCCESS || r->connection->aborted) { php_handle_aborted_connection(); } apr_brigade_cleanup(brigade); @@ -550,7 +550,7 @@ static int php_handler(request_rec *r) APR_BRIGADE_INSERT_TAIL(brigade, bucket); rv = ap_pass_brigade(r->output_filters, brigade); - if (rv != APR_SUCCESS) { + if (rv != APR_SUCCESS || r->connection->aborted) { php_handle_aborted_connection(); } apr_brigade_cleanup(brigade);