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

index 176a0227f4f52f64fa1bc9c21bde07465d3c5011..1295d1ceef2d27a3bd76eaf993921bfee0a1d622 100644 (file)
@@ -91,7 +91,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();
        }
        
@@ -253,7 +253,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 d496eaa9468c34384ebef5290f5496d6441ec295..8021064990401aceecbc54acc28c61dbd18df225 100644 (file)
@@ -88,7 +88,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. */
@@ -258,7 +258,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);
@@ -545,7 +545,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);