httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r722642 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/http/http_filters.c modules/http/http_request.c server/config.c
Date Tue, 02 Dec 2008 22:28:21 GMT
Author: covener
Date: Tue Dec  2 14:28:21 2008
New Revision: 722642

URL: http://svn.apache.org/viewvc?rev=722642&view=rev
Log:
Merge r722213,r722081, and r721679 from trunk:

* Avoid sending no answer at all if a custom error page causes an
  AP_FILTER_ERROR.

* allow ap_invoke_handler() to pass-through AP_FILTER_ERROR as if it were
  a reserved status code (OK/DECLINED/SUSPENDED). Prevents ap_die() from seeing a
  500 error when the http header filter has already taken care of the proper
  error response

* To be safe, consume the entire brigade after processing an error bucket in
  the HTTP output filter.


Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/http/http_filters.c
    httpd/httpd/branches/2.2.x/modules/http/http_request.c
    httpd/httpd/branches/2.2.x/server/config.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=722642&r1=722641&r2=722642&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Tue Dec  2 14:28:21 2008
@@ -1,6 +1,16 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.11
 
+  *) core: When the ap_http_header_filter processes an error bucket, cleanup
+     the passed brigade before returning AP_FILTER_ERROR down the filter 
+     chain. This unambiguously ensures the same error bucket isn't revisited
+     [Ruediger Pluem]
+
+  *) core: Error responses set by filters were being coerced into 500 errors,
+     sometimes appended to the original error response. Log entry of:
+     'Handler for (null) returned invalid result code -3'
+     [Eric Covener]
+
   *) configure: Don't reject libtool 2.x
      PR 44817 [Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA gmail.com>]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=722642&r1=722641&r2=722642&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Tue Dec  2 14:28:21 2008
@@ -86,27 +86,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * core: Allow ap_invoke_handler to pass AP_FILTER_ERROR through as if it
-     were a reserved return code (OK/DECLINED) instead of converting it to 
-     internal server error. 
-     Additionally:
-       * Clear the brigade in ap_http_header_filter when handling an error bucket.
-       * Avoid sending no answer at all if a custom error page causes 
-         an AP_FILTER_ERROR.
-      Trunk version of patch:
-        http://svn.apache.org/viewvc?rev=721679&view=rev
-        http://svn.apache.org/viewvc?rev=722081&view=rev
-        http://svn.apache.org/viewvc?rev=722213&view=rev
-      Backport version for 2.2.x of updated patch:
-        http://people.apache.org/~covener/2.2.x-ap_filter_error+722081+722213.diff
-      +1: covener, rpluem, niq
-      rpluem says: 1. There is a bogus entry in your patch to CHANGES
-                   2. I guess we should also consider r722213, because
-                      with the current state of the patch we IMHO create
-                      a regression in the case that a custom error page
-                      results in AP_FILTER_ERROR before sending the page.
-      covener says: r722213 added and extra CHANGES entry removed (reset niq's +1)
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 

Modified: httpd/httpd/branches/2.2.x/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/http/http_filters.c?rev=722642&r1=722641&r2=722642&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/http/http_filters.c (original)
+++ httpd/httpd/branches/2.2.x/modules/http/http_filters.c Tue Dec  2 14:28:21 2008
@@ -1135,7 +1135,11 @@
         }
     }
     if (eb) {
-        ap_die(eb->status, r);
+        int status;
+
+        status = eb->status;
+        apr_brigade_cleanup(b);
+        ap_die(status, r);
         return AP_FILTER_ERROR;
     }
 

Modified: httpd/httpd/branches/2.2.x/modules/http/http_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/http/http_request.c?rev=722642&r1=722641&r2=722642&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/http/http_request.c (original)
+++ httpd/httpd/branches/2.2.x/modules/http/http_request.c Tue Dec  2 14:28:21 2008
@@ -80,7 +80,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) {

Modified: httpd/httpd/branches/2.2.x/server/config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/config.c?rev=722642&r1=722641&r2=722642&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/config.c (original)
+++ httpd/httpd/branches/2.2.x/server/config.c Tue Dec  2 14:28:21 2008
@@ -378,6 +378,7 @@
             "handler \"%s\" not found for: %s", r->handler, r->filename);
     }
     if ((result != OK) && (result != DONE) && (result != DECLINED)
+        && (result != AP_FILTER_ERROR)
         && !ap_is_HTTP_VALID_RESPONSE(result)) {
         /* If a module is deliberately returning something else
          * (request_rec in non-HTTP or proprietary extension?)



Mime
View raw message