]> granicus.if.org Git - apache/commitdiff
Improved fix to PR#41120: send a clean error response when aborting
authorNick Kew <niq@apache.org>
Sun, 4 Jan 2009 23:58:57 +0000 (23:58 +0000)
committerNick Kew <niq@apache.org>
Sun, 4 Jan 2009 23:58:57 +0000 (23:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@731388 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_ext_filter.c

index 81cd70bf39c93ff666a62b6357018edc0795416d..bdb1b464a2e3233794c7893c37c0cf9679ee225f 100644 (file)
@@ -879,8 +879,18 @@ static apr_status_t ef_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
                 return ap_pass_brigade(f->next, bb);
             }
             else {
-                f->r->status = HTTP_INTERNAL_SERVER_ERROR;
-                return HTTP_INTERNAL_SERVER_ERROR;
+                apr_bucket *e;
+                f->r->status_line = "500 Internal Server Error";
+
+                apr_brigade_cleanup(bb);
+                e = ap_bucket_error_create(HTTP_INTERNAL_SERVER_ERROR,
+                                           NULL, r->pool,
+                                           f->c->bucket_alloc);
+                APR_BRIGADE_INSERT_TAIL(bb, e);
+                e = apr_bucket_eos_create(f->c->bucket_alloc);
+                APR_BRIGADE_INSERT_TAIL(bb, e);
+                ap_pass_brigade(f->next, bb);
+                return AP_FILTER_ERROR;
             }
         }
         ctx = f->ctx;