arrfab / rpms / httpd

Forked from rpms/httpd 5 years ago
Clone

Blame SOURCES/httpd-2.4.6-r1650677.patch

07ea28
--- a/modules/proxy/mod_proxy_fcgi.c	2015/01/09 21:25:26	1650676
07ea28
+++ b/modules/proxy/mod_proxy_fcgi.c	2015/01/09 21:33:12	1650677
07ea28
@@ -367,7 +367,7 @@
07ea28
                              request_rec *r, int request_id)
07ea28
 {
07ea28
     apr_bucket_brigade *ib, *ob;
07ea28
-    int seen_end_of_headers = 0, done = 0;
07ea28
+    int seen_end_of_headers = 0, done = 0, ignore_body = 0;
07ea28
     apr_status_t rv = APR_SUCCESS;
07ea28
     int script_error_status = HTTP_OK;
07ea28
     conn_rec *c = r->connection;
07ea28
@@ -577,9 +577,16 @@
07ea28
                                 APR_BRIGADE_INSERT_TAIL(ob, tmp_b);
07ea28
                                 r->status = status;
07ea28
                                 ap_pass_brigade(r->output_filters, ob);
07ea28
-                                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)
07ea28
-                                              "Error parsing script headers");
07ea28
-                                rv = APR_EINVAL;
07ea28
+                                if (status == HTTP_NOT_MODIFIED) {
07ea28
+                                    /* The 304 response MUST NOT contain
07ea28
+                                     * a message-body, ignore it. */
07ea28
+                                    ignore_body = 1;
07ea28
+                                }
07ea28
+                                else {
07ea28
+                                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)
07ea28
+                                                    "Error parsing script headers");
07ea28
+                                    rv = APR_EINVAL;
07ea28
+                                }
07ea28
                                 break;
07ea28
                             }
07ea28
 
07ea28
@@ -598,7 +605,7 @@
07ea28
                                 r->status = HTTP_OK;
07ea28
                             }
07ea28
 
07ea28
-                            if (script_error_status == HTTP_OK) {
07ea28
+                            if (script_error_status == HTTP_OK && !ignore_body) {
07ea28
                                 rv = ap_pass_brigade(r->output_filters, ob);
07ea28
                                 if (rv != APR_SUCCESS) {
07ea28
                                     break;
07ea28
@@ -626,7 +633,7 @@
07ea28
                          * but that could be a huge amount of data; so we pass
07ea28
                          * along smaller chunks
07ea28
                          */
07ea28
-                        if (script_error_status == HTTP_OK) {
07ea28
+                        if (script_error_status == HTTP_OK && !ignore_body) {
07ea28
                             rv = ap_pass_brigade(r->output_filters, ob);
07ea28
                             if (rv != APR_SUCCESS) {
07ea28
                                 break;