]> granicus.if.org Git - apache/commitdiff
mod_proxy_fcgi: handle the HTTP 412 use case
authorLuca Toscano <elukey@apache.org>
Fri, 9 Sep 2016 11:17:36 +0000 (11:17 +0000)
committerLuca Toscano <elukey@apache.org>
Fri, 9 Sep 2016 11:17:36 +0000 (11:17 +0000)
This is a follow up of http://svn.apache.org/r1752347;
ap_meet_conditions could return a 412 status that if not
handled causes subsequent bogus reads and wrong messages
logged (like AH01070). After a chat on dev@ the feedback
was to couple HTTP_NOT_MODIFIED with HTTP_PRECONDITION_FAILED,
but any other feedback is welcome.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1759984 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_fcgi.c

index 90b1c7d895c24422b9ec970913afbedf6bef4167..880381d9175b373f09442452aeb85bfb44a1efd2 100644 (file)
@@ -660,13 +660,17 @@ recv_again:
                                     *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.
+                                else if (status == HTTP_NOT_MODIFIED
+                                         || HTTP_PRECONDITION_FAILED) {
+                                    /* Special 'status' cases handled:
+                                     * 1) HTTP 304 response MUST NOT contain
+                                     *    a message-body, ignore it.
+                                     * 2) HTTP 412 response.
                                      * 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
+                                     * ignored (and the EOS bucket has already
+                                     * been sent) we want to avoid subsequent
                                      * bogus reads. */
                                     ignore_body = 1;
                                 }