httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: cvs commit: httpd-2.0/modules/generators mod_cgid.c
Date Thu, 14 Dec 2000 14:27:25 GMT
Greg Stein <gstein@lyra.org> writes:

> On Wed, Dec 13, 2000 at 01:30:40PM -0000, trawick@locus.apache.org wrote:
> > trawick     00/12/13 05:30:40
> > 
> >   Modified:    .        CHANGES
> >                modules/generators mod_cgid.c
> >   Log:
> >   Straighten up the first-time-through check in mod_cgid and add a CHANGES
> >   entry for the bug fixes to mod_rewrite and mod_cgid.
> >...
> >   --- mod_cgid.c	2000/12/13 04:03:19	1.53
> >   +++ mod_cgid.c	2000/12/13 13:30:40	1.54
> >   @@ -515,9 +515,17 @@
> >        pid_t pid; 
> >        apr_proc_t *procnew;
> >        void *data;
> >   +    int first_time = 0;
> >   +    const char *userdata_key = "cgid_init";
> >    
> >   -    apr_get_userdata(&data, "cgid_init", main_server->process->pool);
> >   -    if (data != NULL) {
> >   +    apr_get_userdata(&data, userdata_key, main_server->process->pool);
> 
> Why a local variable for this stuff? That seems a bit weird... sort of gives
> the impression that something might change it.
> 
> If you're attempting to avoid a typo, then use a #define CGID_INIT; the
> compiler will then catch typos, and the #define gives you a single place to
> change if you want to alter the string.

Having the right scope was important to me, hence the local variable.

If you wish to change this, go ahead... my feelings won't be hurt a
bit.  As I'm sure you're aware, I put the same sort of code in
mod_rewrite.c too.

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message