]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1774286 from trunk:
authorJim Jagielski <jim@apache.org>
Thu, 15 Dec 2016 12:18:59 +0000 (12:18 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 15 Dec 2016 12:18:59 +0000 (12:18 +0000)
Follow up to r1773761: restore EOC semantic.

Submitted by: ylavic
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1774429 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/http/http_filters.c

diff --git a/STATUS b/STATUS
index bf002ada3ae9f621ea3d36d61e51e391b38a8e06..4a918d19a8b181c5bbcd486347baed717c1419fb 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -117,10 +117,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) Follow up on check_headers() (r1773995) to restore EOC semantic.
-     trunk patch: http://svn.apache.org/r1774286
-     2.4.x patch: trunk works
-     +1: ylavic, rpluem, jim
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 92ab36dd49ff8672e94578e261edc9486be0c200..f6a19aef75d930e20b3c4e18abd657743993a8f4 100644 (file)
@@ -744,13 +744,10 @@ static APR_INLINE int check_headers(request_rec *r)
 
 static int check_headers_recursion(request_rec *r)
 {
-    request_rec *rr;
-    for (rr = r; rr; rr = rr->prev) {
-        void *dying = NULL;
-        apr_pool_userdata_get(&dying, "check_headers_recursion", rr->pool);
-        if (dying) {
-            return 1;
-        }
+    void *check = NULL;
+    apr_pool_userdata_get(&check, "check_headers_recursion", r->pool);
+    if (check) {
+        return 1;
     }
     apr_pool_userdata_setn("true", "check_headers_recursion", NULL, r->pool);
     return 0;
@@ -1262,7 +1259,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
     header_filter_ctx *ctx = f->ctx;
     const char *ctype;
     ap_bucket_error *eb = NULL;
-    int eos = 0;
+    apr_bucket *eos = NULL;
 
     AP_DEBUG_ASSERT(!r->main);
 
@@ -1283,13 +1280,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
          e != APR_BRIGADE_SENTINEL(b);
          e = APR_BUCKET_NEXT(e))
     {
-        if (ctx->headers_error) {
-            if (APR_BUCKET_IS_EOS(e)) {
-                eos = 1;
-                break;
-            }
-            continue;
-        }
         if (AP_BUCKET_IS_ERROR(e) && !eb) {
             eb = e->data;
             continue;
@@ -1302,6 +1292,9 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
             ap_remove_output_filter(f);
             return ap_pass_brigade(f->next, b);
         }
+        if (ctx->headers_error && APR_BUCKET_IS_EOS(e)) {
+            eos = e;
+        }
     }
     if (ctx->headers_error) {
         if (!eos) {
@@ -1327,10 +1320,9 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
             ap_die(HTTP_INTERNAL_SERVER_ERROR, r);
             return AP_FILTER_ERROR;
         }
-        AP_DEBUG_ASSERT(APR_BUCKET_IS_EOS(e));
-        APR_BUCKET_REMOVE(e);
+        APR_BUCKET_REMOVE(eos);
         apr_brigade_cleanup(b);
-        APR_BRIGADE_INSERT_TAIL(b, e);
+        APR_BRIGADE_INSERT_TAIL(b, eos);
         r->status = HTTP_INTERNAL_SERVER_ERROR;
         r->content_type = r->content_encoding = NULL;
         r->content_languages = NULL;