You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by el...@apache.org on 2016/07/12 21:13:37 UTC

svn commit: r1752347 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_fcgi.c

Author: elukey
Date: Tue Jul 12 21:13:37 2016
New Revision: 1752347

URL: http://svn.apache.org/viewvc?rev=1752347&view=rev
Log:
Force mod_proxy_fcgi to read the whole FCGI response 
even when the content has not been modified (HTTP 304).

The problem is described in PR 59838. This patch should 
avoid bogus reads causing the following issues with
HTTP 304 responses:
- AH01068: Got bogus version X, expected 1
- AH01069: Got bogus rid X, expected 1
- AH01075: Error dispatching request to :
- HTTP 503 logged instead of 304 (even if the external 
  client gets correctly a 304)

As discussed on IRC the HTTP_PRECONDITION_FAILED use case
should be handled like the HTTP_NOT_MODIFIED one but it will
be done in a separate commit.


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1752347&r1=1752346&r2=1752347&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Jul 12 21:13:37 2016
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_fcgi: read the whole FCGI response even when the content has
+     not been modified (HTTP 304) to avoid subsequent bougus reads and
+     confusing error messages logged. [Luca Toscano]
+
   *) mod_http2: removing timeouts on master connection while requests are
      being processed. Requests may timeout, but the master only times out when
      no more requests are active. [Stefan Eissing]

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c?rev=1752347&r1=1752346&r2=1752347&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c Tue Jul 12 21:13:37 2016
@@ -658,18 +658,24 @@ recv_again:
                                 rv = ap_pass_brigade(r->output_filters, ob);
                                 if (rv != APR_SUCCESS) {
                                     *err = "passing headers brigade to output filters";
+                                    break;
                                 }
                                 else if (status == HTTP_NOT_MODIFIED) {
                                     /* The 304 response MUST NOT contain
-                                     * a message-body, ignore it. */
+                                     * a message-body, ignore it.
+                                     * The break is not added since there might
+                                     * be more bytes to read from the FCGI
+                                     * connection. Even if the message-body is
+                                     * ignored we want to avoid subsequent
+                                     * bogus reads. */
                                     ignore_body = 1;
                                 }
                                 else {
                                     ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)
                                                     "Error parsing script headers");
                                     rv = APR_EINVAL;
+                                    break;
                                 }
-                                break;
                             }
 
                             if (conf->error_override &&