]> granicus.if.org Git - apache/commitdiff
* Avoid sending no answer at all if a custom error page causes an
authorRuediger Pluem <rpluem@apache.org>
Mon, 1 Dec 2008 20:27:27 +0000 (20:27 +0000)
committerRuediger Pluem <rpluem@apache.org>
Mon, 1 Dec 2008 20:27:27 +0000 (20:27 +0000)
  AP_FILTER_ERROR.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722213 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_request.c

index 28d237a6e8a75a3f393b76354a2308178d0af3c0..8ca18d5b4c06e011dafe4e7e55925df7916b5508 100644 (file)
@@ -79,7 +79,31 @@ AP_DECLARE(void) ap_die(int type, request_rec *r)
     request_rec *r_1st_err = r;
 
     if (type == AP_FILTER_ERROR) {
-        return;
+        ap_filter_t *next;
+
+        /*
+         * Check if we still have the ap_http_header_filter in place. If
+         * this is the case we should not ignore AP_FILTER_ERROR here because
+         * it means that we have not sent any response at all and never
+         * will. This is bad. Sent an internal server error instead.
+         */
+        next = r->output_filters;
+        while (next && (next->frec != ap_http_header_filter_handle)) {
+               next = next->next;
+        }
+
+        /*
+         * If next != NULL then we left the while above because of
+         * next->frec == ap_http_header_filter
+         */
+        if (next) {
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                          "Custom error page caused AP_FILTER_ERROR");
+            type = HTTP_INTERNAL_SERVER_ERROR;
+        }
+        else {
+            return;
+        }
     }
 
     if (type == DONE) {