Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1FD111FC7 for ; Wed, 9 Jul 2014 05:35:34 +0000 (UTC) Received: (qmail 20515 invoked by uid 500); 9 Jul 2014 05:35:34 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 20438 invoked by uid 500); 9 Jul 2014 05:35:34 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 20428 invoked by uid 99); 9 Jul 2014 05:35:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2014 05:35:34 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [80.12.242.124] (HELO smtp.smtpout.orange.fr) (80.12.242.124) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2014 05:35:29 +0000 Received: from [127.0.0.1] ([92.140.160.249]) by mwinf5d56 with ME id Q5b41o0065P96nw035b4Zl; Wed, 09 Jul 2014 07:35:06 +0200 X-ME-Helo: [127.0.0.1] X-ME-Date: Wed, 09 Jul 2014 07:35:06 +0200 X-ME-IP: 92.140.160.249 Message-ID: <53BCD486.6040902@wanadoo.fr> Date: Wed, 09 Jul 2014 07:35:02 +0200 From: Marion & Christophe JAILLET User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: svn commit: r1608762 - in /httpd/httpd/branches/2.4.x: ./ CHANGES modules/proxy/proxy_util.c References: <20140708131627.979A12388860@eris.apache.org> In-Reply-To: <20140708131627.979A12388860@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 140708-1, 08/07/2014), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Le 08/07/2014 15:16, jim@apache.org a écrit : > Author: jim > Date: Tue Jul 8 13:16:27 2014 > New Revision: 1608762 > > URL: http://svn.apache.org/r1608762 > Log: > 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 > > Modified: > httpd/httpd/branches/2.4.x/ (props changed) > httpd/httpd/branches/2.4.x/CHANGES > httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c > > Propchange: httpd/httpd/branches/2.4.x/ > ------------------------------------------------------------------------------ > Merged /httpd/httpd/trunk:r1588519 > > Modified: httpd/httpd/branches/2.4.x/CHANGES > URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1608762&r1=1608761&r2=1608762&view=diff > ============================================================================== > --- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original) > +++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Tue Jul 8 13:16:27 2014 > @@ -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] > > > Modified: httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c > URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c?rev=1608762&r1=1608761&r2=1608762&view=diff > ============================================================================== > --- httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c (original) > +++ httpd/httpd/branches/2.4.x/modules/proxy/proxy_util.c Tue Jul 8 13:16:27 2014 > @@ -3307,8 +3307,22 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbr > * 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 Just a few details : 1) Shouldn't we use 100-continue (lowercase c) instead, to more closely match http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html, § 8.2.3 ? This would also be consistent with the use of this string in protocol.c 2) if of any use, in the fast path, strcmp could be used instead of strcasecmp 3) // fast path, should be /* fast path */ 4) in protocol.c, around line 1212 there is: if (((expect = apr_table_get(r->headers_in, "Expect")) != NULL) && (expect[0] != '\0')) { /* * The Expect header field was added to HTTP/1.1 after RFC 2068 * as a means to signal when a 100 response is desired and, * unfortunately, to signal a poor man's mandatory extension that * the server must understand or return 417 Expectation Failed. */ if (strcasecmp(expect, "100-continue") == 0) { r->expecting_100 = 1; } this is not consistent with the code below. Should this be changed to something like: if (strcasecmp(expect, "100-continue") == 0 || ap_find_token(r->pool, expect, "100-Continue")) { r->expecting_100 = 1; } ? Best regards, CJ --- Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active. http://www.avast.com