summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2016-12-12 13:06:06 +0100
committerYann Ylavic <ylavic@apache.org>2016-12-12 13:06:06 +0100
commit64350668a2c1a8d83f65cace8a5f0a41c1babae0 (patch)
treed6479984c554403744f4d64f55e3a670d416b015 /modules
parentFollow up to r1773293. (diff)
downloadapache2-64350668a2c1a8d83f65cace8a5f0a41c1babae0.tar.xz
apache2-64350668a2c1a8d83f65cace8a5f0a41c1babae0.zip
Follow up to r1773761: don't check_headers() more than once.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1773779 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/http/http_filters.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c
index c2548ec88b..1c00115fe7 100644
--- a/modules/http/http_filters.c
+++ b/modules/http/http_filters.c
@@ -1199,15 +1199,17 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
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_http_header_filter(ap_filter_t *f,
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;
}