You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ian Holsman <Ia...@cnet.com> on 2002/09/05 15:43:52 UTC

Re: cvs commit: httpd-2.0/modules/http mod_mime.c

jerenkrantz@apache.org wrote:

>jerenkrantz    2002/09/05 00:31:14
>
>  Modified:    .        CHANGES
>               modules/http mod_mime.c
>  Log:
>  Add ModMimeUsePathInfo directive.
>  
>  +    int use_path_info;    /* If set to 0, only use filename.
>  +                           * If set to 1, append PATH_INFO to filename for
>  +                           *   lookups.
>  +                           * If set to 2, this value is unset and is
>  +                           *   effectively 0.  
>  +                           */
>
-1
don't use magic numbers
please use a #define

>   
>  +    new->use_path_info = 2;
>  +
>
>  
>



Re: cvs commit: httpd-2.0/modules/http mod_mime.c

Posted by Justin Erenkrantz <je...@apache.org>.
On Thu, Sep 05, 2002 at 06:43:52AM -0700, Ian Holsman wrote:
> -1
> don't use magic numbers
> please use a #define

Sorry, but the rest of the server uses this strategy for flags.
Look specifically at IdentityCheck and ContentDigest.

The problem is that the AP_INIT_FLAG and ap_set_flag_slot passes
in 0, 1 and therefore that must correspond to Off and On.  Using a
local enum or a #define will break compatibility with how flags are
handled (because some genius may think they can change those values).
Therefore, I believe we have to stick with magic numbers.

And, due to directive inheritance, there is also needed a
special value for 'unset' - and the strategy we have used in
the past is to use 2.  

If you think it'd be better to rewrite all of the flag handling
code to use global enums, I'd agree, but I'm not going to do
that.  That will break all modules using flags.  -- justin

Re: cvs commit: httpd-2.0/modules/http mod_mime.c

Posted by gr...@apache.org.
Ian Holsman wrote:
> 
> jerenkrantz@apache.org wrote:
> 
> >jerenkrantz    2002/09/05 00:31:14
> >
> >  Modified:    .        CHANGES
> >               modules/http mod_mime.c
> >  Log:
> >  Add ModMimeUsePathInfo directive.
> >
> >  +    int use_path_info;    /* If set to 0, only use filename.
> >  +                           * If set to 1, append PATH_INFO to filename for
> >  +                           *   lookups.
> >  +                           * If set to 2, this value is unset and is
> >  +                           *   effectively 0.
> >  +                           */
> >
> -1
> don't use magic numbers
> please use a #define

better yet, an enum.

Greg