Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 81124 invoked from network); 12 Feb 2008 20:53:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Feb 2008 20:53:54 -0000 Received: (qmail 41839 invoked by uid 500); 12 Feb 2008 20:53:41 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 41782 invoked by uid 500); 12 Feb 2008 20:53:41 -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 41758 invoked by uid 99); 12 Feb 2008 20:53:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2008 12:53:41 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 12 Feb 2008 20:53:18 +0000 Received: (qmail 80815 invoked by uid 2161); 12 Feb 2008 20:53:26 -0000 Received: from [192.168.2.4] (euler.heimnetz.de [192.168.2.4]) by cerberus.heimnetz.de (Postfix on SuSE Linux 7.0 (i386)) with ESMTP id 57A981721C for ; Tue, 12 Feb 2008 21:53:17 +0100 (CET) Message-ID: <47B2074A.9000703@apache.org> Date: Tue, 12 Feb 2008 21:53:30 +0100 From: Ruediger Pluem User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080201 SeaMonkey/1.1.8 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: idempotent http methods (svn commit: r617822) References: <20080202163541.324F31A9832@eris.apache.org> <20080202180849.70cc0717@grimnir> <47A4CF2B.2060304@apache.org> In-Reply-To: <47A4CF2B.2060304@apache.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org On 02/02/2008 09:14 PM, Ruediger Pluem wrote: > > On 02/02/2008 07:08 PM, Nick Kew wrote: >> Suggested solution: an enum, with a third value for an idempotent >> method with arguments. The caller then determines how to use it. > > So you think of something like this (ok, no enum, but similar): > > #define METHOD_NON_IDEMPOTENT 0 > #define METHOD_IDEMPOTENT 1 > #define METHOD_IDEMPOTENT_WITH_ARGS 2 > > static int is_idempotent(request_rec *r) > { > /* > * RFC2616 (9.1.2): GET, HEAD, PUT, DELETE, OPTIONS, TRACE are considered > * idempotent. Hint: HEAD requests use M_GET as method number as well. > */ > switch (r->method_number) { > case M_GET: > case M_DELETE: > case M_PUT: > case M_OPTIONS: > case M_TRACE: > /* > * If the request has arguments it might have side-effects and thus > * it might be undesirable to resent it to a backend again· > * automatically. > */ > if (r->args) { > return METHOD_IDEMPOTENT_WITH_ARGS; > } > return METHOD_IDEMPOTENT; > /* Everything else is not considered idempotent. */ > default: > return METHOD_NON_IDEMPOTENT; > } > } Ok, committed as r627097. > >> That's in response to your post to dev@. OTTOMH it seems to me >> to work as a core function. How many existing handlers apply >> an equivalent test? >> > > I know of none currently, but I assume that at least in mod_proxy(_http) the > need for this test will rise, once we try to finally solve the race problem in > mod_proxy_http when it sends a request over a connection that is closed just > at this moment. Ping, WDYT now? core or proxy_util? Regards Rüdiger