You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ryan Bloom <rb...@covalent.net> on 2001/08/02 05:28:33 UTC

Re: [PATCH] repost: directive extended to arbitrary methods

I'll be committing this tonight.  The only change I will be adding, is that the macro is
going to be capitalized, because all macros should always be capitalized.

Ryan

On Wednesday 01 August 2001 18:45, Cody Sherr wrote:
> I've added a macro to ease checking if a method is allowed in a mask:
>
> ap_method_check_allowed(mask, methname)
>
> in accordance with Will Rowe's recommendation today.
>
> thanks,

-- 

_____________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net
-----------------------------------------------------------------------------

Re: [PATCH] repost: directive extended to arbitrary methods

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
> I'll be committing this tonight.  The only change I will be adding, is that
> the macro is going to be capitalized, because all macros should always be
> capitalized.

No, that is wrong.  A macro that is taking the place of a past or potentially
future function call should always be lowercase, just like any other function
call.  The only reason to all-CAP a macro with parameters is if it cannot
ever be a C funtion (usually because it depends on pass-by-name).

....Roy


Re: [PATCH] repost: directive extended to arbitrary methods

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Ryan Bloom" <rb...@covalent.net>
Sent: Wednesday, August 01, 2001 11:14 PM

> > Add one more placeholder, FIXED_METHODS, corresponding to the last
> > M_INVALID + 1.
> 
> It's already there.  Look for METHOD_NUMBER_FIRST in http_protocol.h.  :-)
> 
> > Stuff them in the hash and pull out all the bogus tests from
> > ap_method_number_of!!! You can't add a new 'GOOBLE' method, it will map to
> > 'G' -- 'GET'.
> 
> I dislike changing how the core works in the same patch as when we introduce a
> new API.  Let's commit the API change, and then fix the core.  And GOOBLE won't
> map to GET, because we strcmp the two values.

Yup... I missed that, and yes, these improvements can go in through another patch.


Re: [PATCH] repost: directive extended to arbitrary methods

Posted by Ryan Bloom <rb...@covalent.net>.
> I caught that... the other bit that I hinted at in my last message was
> pretty simple...
>
> when we first query, if the table doesn't exist, stuff elements n ..
> FIXED_METHODS

Get this done after the initial commit is in.  Since we don't currently stuff any
of the core methods in, we don't want to add them in the first commit.

>
> +++ include/httpd.h 2001/08/02 01:41:18
> @@ -478,8 +478,6 @@
>  /* Methods recognized (but not necessarily handled) by the server.
>   * These constants are used in bit shifting masks of size int, so it is
>   * unsafe to have more methods than bits in an int.  HEAD == M_GET.
> - * This list must be tracked by the list in http_protocol.c in routine
> - * ap_method_name_of().
>
>
> Don't you dare eliminate that comment!!!

Don't worry, I put it back.

> @@ -498,7 +496,10 @@
>  #define M_UNLOCK    14
>  #define M_INVALID   15
>
> -#define METHODS     16
> +/* METHODS needs to be equal to the number of bits
> + * we are using for limit masks.
> + */
> +#define METHODS     64
>
>
> Add one more placeholder, FIXED_METHODS, corresponding to the last
> M_INVALID + 1.

It's already there.  Look for METHOD_NUMBER_FIRST in http_protocol.h.  :-)

> Stuff them in the hash and pull out all the bogus tests from
> ap_method_number_of!!! You can't add a new 'GOOBLE' method, it will map to
> 'G' -- 'GET'.

I dislike changing how the core works in the same patch as when we introduce a
new API.  Let's commit the API change, and then fix the core.  And GOOBLE won't
map to GET, because we strcmp the two values.

Ryan

_____________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
Covalent Technologies			rbb@covalent.net
-----------------------------------------------------------------------------

Re: [PATCH] repost: directive extended to arbitrary methods

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Ryan Bloom" <rb...@covalent.net>
Sent: Wednesday, August 01, 2001 10:28 PM


> I'll be committing this tonight.  The only change I will be adding, is that the macro is
> going to be capitalized, because all macros should always be capitalized.

I caught that... the other bit that I hinted at in my last message was pretty simple...

when we first query, if the table doesn't exist, stuff elements n .. FIXED_METHODS

+++ include/httpd.h 2001/08/02 01:41:18
@@ -478,8 +478,6 @@
 /* Methods recognized (but not necessarily handled) by the server.
  * These constants are used in bit shifting masks of size int, so it is
  * unsafe to have more methods than bits in an int.  HEAD == M_GET.
- * This list must be tracked by the list in http_protocol.c in routine
- * ap_method_name_of().


Don't you dare eliminate that comment!!!


@@ -498,7 +496,10 @@
 #define M_UNLOCK    14
 #define M_INVALID   15

-#define METHODS     16
+/* METHODS needs to be equal to the number of bits
+ * we are using for limit masks.
+ */
+#define METHODS     64


Add one more placeholder, FIXED_METHODS, corresponding to the last M_INVALID + 1.

Stuff them in the hash and pull out all the bogus tests from ap_method_number_of!!!
You can't add a new 'GOOBLE' method, it will map to 'G' -- 'GET'.


Other than that?

+1 :)

Bill



> On Wednesday 01 August 2001 18:45, Cody Sherr wrote:
> > I've added a macro to ease checking if a method is allowed in a mask:
> >
> > ap_method_check_allowed(mask, methname)
> >
> > in accordance with Will Rowe's recommendation today.
> >
> > thanks,
> 
> -- 
> 
> _____________________________________________________________________________
> Ryan Bloom                        rbb@apache.org
> Covalent Technologies rbb@covalent.net
> -----------------------------------------------------------------------------
>