httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r722213 - /httpd/httpd/trunk/modules/http/http_request.c
Date Mon, 01 Dec 2008 20:27:27 GMT
Author: rpluem
Date: Mon Dec  1 12:27:27 2008
New Revision: 722213

URL: http://svn.apache.org/viewvc?rev=722213&view=rev
Log:
* Avoid sending no answer at all if a custom error page causes an
  AP_FILTER_ERROR.

Modified:
    httpd/httpd/trunk/modules/http/http_request.c

Modified: httpd/httpd/trunk/modules/http/http_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_request.c?rev=722213&r1=722212&r2=722213&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_request.c (original)
+++ httpd/httpd/trunk/modules/http/http_request.c Mon Dec  1 12:27:27 2008
@@ -79,7 +79,31 @@
     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) {



Mime
View raw message