httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: httpd-2.0/modules/generators mod_cgid.c
Date Thu, 14 Dec 2000 01:29:12 GMT
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.

(I use the #define technique in mod_dav for the user_data)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message