On Mon, Aug 20, 2001 at 02:36:25PM -0400, Jim Jagielski wrote:
> +#define DEFAULT_SERIALIZED_ACCEPT_METHOD fcntl
> ...
> +#define DEFAULT_SERIALIZED_ACCEPT_METHOD flock

Shouldn't these be 
> +#define DEFAULT_SERIALIZED_ACCEPT_METHOD "fcntl"
> +#define DEFAULT_SERIALIZED_ACCEPT_METHOD "flock"
then?

> +char *default_mutex_method(void)
> +{
> +     char *t;
> +#if defined DEFAULT_SERIALIZED_ACCEPT_METHOD
> +     t = "DEFAULT_SERIALIZED_ACCEPT_METHOD";
as already said, here without the quotes:
> +     t = DEFAULT_SERIALIZED_ACCEPT_METHOD;
> +#else
> +     t = "default";
>  #endif

> +char *init_mutex_method(char *t)
> +{
> +#if defined USE_USLOCK_SERIALIZED_ACCEPT
> +     if (!(strcasecmp(t,"uslock"))) {
> +             accept_mutex_child_init_fptr =  NULL;
> +             accept_mutex_init_fptr =        &accept_mutex_init_uslock;
> +             accept_mutex_off_fptr =         &accept_mutex_off_uslock;
> +             accept_mutex_on_fptr =          &accept_mutex_on_uslock;
> +     } else 
> +#endif
> +#if defined USE_PTHREAD_SERIALIZED_ACCEPT
> +     if (!(strcasecmp(t,"pthread"))) {
> +             accept_mutex_child_init_fptr = &accept_mutex_child_init_pthread;
> +             accept_mutex_init_fptr =        &accept_mutex_init_pthread;
> +             accept_mutex_off_fptr =         &accept_mutex_off_pthread;
> +             accept_mutex_on_fptr =          &accept_mutex_on_pthread;
> +     } else 
> +#endif

Can these 4 pointers be put into a structure? Then it is easier
to assign either a pointer to an initialized structure, or
assign the whole initialized structure en bloc. And it's better
for encapsulation and object orientation.

>  #ifdef USE_XXXXX_SERIALIZED_ACCEPT
>      printf(" -D USE_XXXXX_SERIALIZED_ACCEPT\n");
>  #endif

And I'd also recommend the name change from USE_* to HAVE_*
although I think we need some way of backward compatibility layer,
because it has been an established and documented interface.

>       ptrans = ap_make_sub_pool(pconf);
> +
> +     init_single_listen(ap_single_listen);

What happens to the char * init_single_listen() return value? errors?

   Martin
-- 
<[EMAIL PROTECTED]>    |       Fujitsu Siemens
       <[EMAIL PROTECTED]>              |   81730  Munich,  Germany

Reply via email to