]> granicus.if.org Git - apache/commitdiff
mod_proxy: When ping/pong is configured for a worker, don't send or forward
authorYann Ylavic <ylavic@apache.org>
Fri, 18 Apr 2014 17:17:06 +0000 (17:17 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 18 Apr 2014 17:17:06 +0000 (17:17 +0000)
           "100 Continue" (interim) response to the client if it does not
           expect one.

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

modules/proxy/proxy_util.c

index 23dfba334b4c97ba39cea85e9e87910a75ced83c..b532e95dc81e532fee683d32a6f9ca83270afbe5 100644 (file)
@@ -3312,8 +3312,22 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p,
      * to backend
      */
     if (do_100_continue) {
-        apr_table_mergen(r->headers_in, "Expect", "100-Continue");
-        r->expecting_100 = 1;
+        const char *val;
+
+        if (!r->expecting_100) {
+            /* Don't forward any "100 Continue" response if the client is
+             * not expecting it.
+             */
+            apr_table_setn(r->subprocess_env, "proxy-interim-response",
+                                              "Suppress");
+        }
+
+        /* Add the Expect header if not already there. */
+        if (((val = apr_table_get(r->headers_in, "Expect")) == NULL)
+                || (strcasecmp(val, "100-Continue") != 0 // fast path
+                    && !ap_find_token(r->pool, val, "100-Continue"))) {
+            apr_table_mergen(r->headers_in, "Expect", "100-Continue");
+        }
     }
 
     /* X-Forwarded-*: handling