From b9047fe38bca184b68be52548cb6de4d0a66aeb7 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 8 Apr 2014 20:07:04 +0000 Subject: [PATCH] mod_proxy_fcgi: Fix sending of response without some HTTP headers that might be set by filters. The problem occurs when no body bytes were read while reading the response headers, resulting in an empty brigade being sent down the filter stack. One particualr filter that mishandles the empty initial brigade is mod_deflate. It neglects to add to the response header fields. PR: 55558 Submitted by: Jim Riggs Reviewed by: trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1585824 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/proxy/mod_proxy_fcgi.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2517204d713..6d63e906a17 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_proxy_fcgi: Fix sending of response without some HTTP headers + that might be set by filters. [Jim Riggs ] + *) mod_rewrite: Add 'BNF' (backreferences-no-plus) flag to RewriteRule to allow spaces in backreferences to be encoded as %20 instead of '+'. [Eric Covener] diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index fff02ba59c5..c36071e08a4 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -593,7 +593,11 @@ recv_again: r->status = HTTP_OK; } - if (script_error_status == HTTP_OK) { + if (script_error_status == HTTP_OK + && !APR_BRIGADE_EMPTY(ob)) { + /* Send the part of the body that we read while + * reading the headers. + */ rv = ap_pass_brigade(r->output_filters, ob); if (rv != APR_SUCCESS) { break; -- 2.47.3