On Sat, 02 Feb 2008 16:35:40 -0000
[EMAIL PROTECTED] wrote:
> +static int is_idempotent(request_rec *r)
> +{
> + /*
> + * If the request has arguments it might not be idempotent as it
> might have
> + * side-effects.
> + */
> + if (r->args) {
> + return 0;
> + }
That breaks RFC compliance, as soon as someone uses it to test
idempotence.
> + /*
> + * 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:
> + return 1;
> + /* Everything else is not considered idempotent. */
> + default:
> + return 0;
> + }
> +}
Suggested solution: an enum, with a third value for an idempotent
method with arguments. The caller then determines how to use it.
That's in response to your post to [EMAIL PROTECTED] OTTOMH it seems to me
to work as a core function. How many existing handlers apply
an equivalent test?
--
Nick Kew
Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/