httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1773779 - /httpd/httpd/trunk/modules/http/http_filters.c
Date Mon, 12 Dec 2016 12:06:07 GMT
Author: ylavic
Date: Mon Dec 12 12:06:06 2016
New Revision: 1773779

URL: http://svn.apache.org/viewvc?rev=1773779&view=rev
Log:
Follow up to r1773761: don't check_headers() more than once.

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

Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=1773779&r1=1773778&r2=1773779&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Mon Dec 12 12:06:06 2016
@@ -1199,15 +1199,17 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
     if (!ctx) {
         ctx = f->ctx = apr_pcalloc(r->pool, sizeof(header_filter_ctx));
     }
-    else if (ctx->headers_sent) {
-        /* r->header_only or HTTP_NO_CONTENT case below, don't let
-         * the body pass trhough.
-         */
-        apr_brigade_cleanup(b);
-        return APR_SUCCESS;
-    }
 
-    if (!ctx->headers_error && !check_headers(r)) {
+    if (ctx->headers_sent) {
+        if (r->header_only || r->status == HTTP_NO_CONTENT) {
+            /* r->header_only or HTTP_NO_CONTENT case below, don't let
+             * the body pass trhough.
+             */
+            apr_brigade_cleanup(b);
+            return APR_SUCCESS;
+        }
+    }
+    else if (!ctx->headers_error && !check_headers(r)) {
         /* Eat body until EOS */
         ctx->headers_error = 1;
     }
@@ -1382,10 +1384,10 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
     terminate_header(b2);
 
     ap_pass_brigade(f->next, b2);
+    ctx->headers_sent = 1;
 
     if (r->header_only || r->status == HTTP_NO_CONTENT) {
         apr_brigade_cleanup(b);
-        ctx->headers_sent = 1;
         return APR_SUCCESS;
     }
 



Mime
View raw message