]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #22072 (Apache2 sapis do not detect aborted connections)
authorIlia Alshanetsky <iliaa@php.net>
Fri, 1 Aug 2003 20:21:21 +0000 (20:21 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 1 Aug 2003 20:21:21 +0000 (20:21 +0000)
NEWS
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c

diff --git a/NEWS b/NEWS
index b1b00e7941c485e5110fab4d4d8f977ca5e162b2..8ded101e50f8d1ae9875d3962b0e00e97cdd5843 100644 (file)
--- 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)
index 677e89e1f1189c004d621fecfd196d335d4e7e05..66fd5700bc3304637af23ae924d962ec84a4c329 100644 (file)
@@ -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();
                                }
                        }
index 5e64c5161c690f456e4ec9786033d5e9e7877c5e..1494a2f407d0f02dc2f4795cb623a8451d0abc3f 100644 (file)
@@ -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);