]> granicus.if.org Git - php/commitdiff
Handle user aborts
authorSascha Schumann <sas@php.net>
Sun, 29 Oct 2000 15:10:49 +0000 (15:10 +0000)
committerSascha Schumann <sas@php.net>
Sun, 29 Oct 2000 15:10:49 +0000 (15:10 +0000)
sapi/apache2filter/sapi_apache2.c

index b80b12cd25953f1c7b55b25d6c14e6b4f01e40f7..f46bbe29df59c14cee56eca163a5b7cf2fb8316b 100644 (file)
@@ -42,7 +42,14 @@ php_apache_sapi_ub_write(const char *str, uint str_length)
                str += now;
                str_length -= now;
        }
-       ap_pass_brigade(ctx->f->next, bb);
+       if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) {
+               PLS_FETCH();
+               PG(connection_status) = PHP_CONNECTION_ABORTED;
+
+               if (!PG(ignore_user_abort)) {
+                       zend_bailout();
+               }
+       }
        
        return str_length;
 }
@@ -152,7 +159,14 @@ php_apache_sapi_flush(void *server_context)
        bb = ap_brigade_create(ctx->f->r->pool);
        b = ap_bucket_create_flush();
        AP_BRIGADE_INSERT_TAIL(bb, b);
-       ap_pass_brigade(ctx->f->next, bb);
+       if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) {
+               PLS_FETCH();
+               PG(connection_status) = PHP_CONNECTION_ABORTED;
+
+               if (!PG(ignore_user_abort)) {
+                       zend_bailout();
+               }
+       }
 }
 
 static void php_apache_sapi_log_message(char *msg)