From: Jim Jagielski Date: Tue, 8 Jul 2014 13:16:27 +0000 (+0000) Subject: Merge r1588519 from trunk: X-Git-Tag: 2.4.10~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18bcca4c0b1aae0bad5c9437681a3102d3a6c372;p=apache Merge r1588519 from trunk: mod_proxy: When ping/pong is configured for a worker, don't send or forward "100 Continue" (interim) response to the client if it does not expect one. Submitted by: ylavic Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1608762 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index d31a0a7d7b..e9a5e3bfe4 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.4.10 + *) mod_proxy: When ping/pong is configured for a worker, don't send or + forward "100 Continue" (interim) response to the client if it does + not expect one. [Yann Ylavic] + *) mod_proxy_fcgi: Fix occasional high CPU when handling request bodies. [Jeff Trawick] diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 5db7f9c514..bdff652fe5 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -3307,8 +3307,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