httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cody Sherr <csh...@covalent.net>
Subject Re: [PATCH] <limit> directive extended to arbitrary methods
Date Thu, 02 Aug 2001 00:47:09 GMT
On Wed, 1 Aug 2001, William A. Rowe, Jr. wrote:

>
> ----- Original Message -----
> From: "Cody Sherr" <csherr@covalent.net>
> To: <new-httpd@apache.org>
> Sent: Wednesday, August 01, 2001 6:23 PM
> Subject: Re: [PATCH] <limit> directive extended to arbitrary methods
>
>
> >
> > Well, the reservation happens at run time, so you would just bump
> > METHOD_NUMBER_FIRST, and #define the M_FOO to the method number.
> >
> > It's actually easier than that. Any new method wouldn't need to be added
> > with a #define, you can simply call
> >
> > ap_method_register("FOO");
> >
> > during init, and FOO could be <limited> in the config file, and checked
> > during request.
> >
> > ap_method_number_of("FOO");
> >
> > will return the offset of the dynamically registered request method, if
> > you want to check during an auth phase. You don't need to worry if that is
> > 22 or 42, here's an example:
> >
> > if (mask & (1 << ap_method_number_of("FOO"))
>
> UGH.  I hope you would offer a macro for (1 << ap_method_number_of("FOO"))
> especially seeing as even you got your parens wrong :)

doh. Good point, rbb and I tossed this one around but I was going to leave
it out. I'll implement it and resubmit the patch.

>
> All 'preassigned' ap_method_number_of()'s are registered by your patch, I presume.
>

They're not registered. I left all core http mechanisms alone. The
technique in ap_method_number_of is switch() on the first charachter for a
time win, followed by a strcmp(). Then it checks in the method registry.
It works, and I considered those changes of another patch: move the
core http protocol over to the new scheme.

regards,

-- 
Cody Sherr

Engineer
Covalent Technologies

phone: (415)536-5292
email: csherr@covalent.net




Mime
View raw message