You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2001/08/13 06:57:35 UTC

cvs commit: httpd-2.0/server/mpm/worker mpm.h worker.c

rbb         01/08/12 21:57:35

  Modified:    .        CHANGES
               include  mpm_common.h
               os/unix  unixd.c
               server   core.c listen.c mpm_common.c
               server/mpm/beos beos.c mpm.h
               server/mpm/perchild mpm.h perchild.c
               server/mpm/prefork mpm.h prefork.c
               server/mpm/spmt_os2 mpm.h spmt_os2.c
               server/mpm/threaded mpm.h threaded.c
               server/mpm/winnt mpm.h
               server/mpm/worker mpm.h worker.c
  Log:
  Begin to sanitize the MPM configuration directives.  Now, all
  MPMs use the same functions for all common MPM directives.  This
  should make it easier to catch all bugs in these directives once.
  
  Everybody should check their favorite MPM to ensure that it still
  compiles, and that these directives work.  This is a big patch, and
  although it looks good, and things compiled for me, that is no
  garauntee that it will work on all platforms.  :-)
  
  Submitted by:	Cody Sherr <cs...@covalent.net>
  
  Revision  Changes    Path
  1.290     +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.289
  retrieving revision 1.290
  diff -u -r1.289 -r1.290
  --- CHANGES	2001/08/13 04:25:42	1.289
  +++ CHANGES	2001/08/13 04:57:34	1.290
  @@ -1,5 +1,10 @@
   Changes with Apache 2.0.24-dev
   
  +  *) Begin to sanitize the MPM configuration directives.  Now, all
  +     MPMs use the same functions for all common MPM directives.  This
  +     should make it easier to catch all bugs in these directives once.
  +     [Cody Sherr <cs...@covalent.net>]
  +
     *) Close a major resource leak.  Everytime we had issued a
        graceful restart, we leaked a socket descriptor.
        [Ryan Bloom]
  
  
  
  1.24      +61 -0     httpd-2.0/include/mpm_common.h
  
  Index: mpm_common.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/mpm_common.h,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- mpm_common.h	2001/07/27 21:01:16	1.23
  +++ mpm_common.h	2001/08/13 04:57:34	1.24
  @@ -208,6 +208,67 @@
   AP_DECLARE(void) ap_mpm_pod_killpg(ap_pod_t *pod, int num);
   #endif
   
  +/*
  + * These data members are common to all mpms. Each new mpm
  + * should either use the appropriate ap_mpm_set_* function
  + * in their command table or create their own for custom or
  + * OS specific needs. These should work for most.
  + */
  +
  +/**
  + * The maximum number of requests each child thread or
  + * process handles before dying off
  + */
  +#ifdef AP_MPM_WANT_SET_MAX_REQUESTS
  +extern int               ap_max_requests_per_child;
  +AP_DECLARE(const  char *) ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
  +						  const char *arg);
  +#endif
  +
  +/**
  + * The filename used to store the process id.
  + */
  +#ifdef AP_MPM_WANT_SET_PIDFILE
  +extern const char        *ap_pid_fname;
  +AP_DECLARE(const char *) ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
  +					    const char *arg);
  +#endif
  +
  +/**
  + * The name of lockfile used when Apache needs to lock the accept() call.
  + */
  +#ifdef AP_MPM_WANT_SET_LOCKFILE
  +extern const char        *ap_lock_fname;
  +AP_DECLARE(const char *) ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy,
  +					     const char *arg);
  +#endif
  +
  +/**
  + * The system mutex implementation to use for the accept mutex.
  + */
  +#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
  +extern apr_lockmech_e_np accept_lock_mech;
  +AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy,
  +						     const char *arg);
  +#endif
  +
  +/*
  + * Set the scorboard file.
  + */
  +#ifdef AP_MPM_WANT_SET_SCOREBOARD
  +AP_DECLARE(const char *) ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy,
  +					       const char *arg);
  +#endif
  +
  +/*
  + * The directory that the server changes directory to dump core.
  + */
  +#ifdef AP_MPM_WANT_SET_COREDUMPDIR
  +extern char ap_coredump_dir[MAX_STRING_LEN];
  +AP_DECLARE(const char *) ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
  +						const char *arg);
  +#endif
  +
   #ifdef __cplusplus
   }
   #endif
  
  
  
  1.38      +1 -0      httpd-2.0/os/unix/unixd.c
  
  Index: unixd.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/unix/unixd.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- unixd.c	2001/07/30 17:55:38	1.37
  +++ unixd.c	2001/08/13 04:57:34	1.38
  @@ -63,6 +63,7 @@
   #include "http_main.h"
   #include "http_log.h"
   #include "unixd.h"
  +#include "apr_lock.h"
   #include "mpm_common.h"
   #include "os.h"
   #include "ap_mpm.h"
  
  
  
  1.36      +32 -1     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- core.c	2001/08/11 04:04:13	1.35
  +++ core.c	2001/08/13 04:57:34	1.36
  @@ -85,7 +85,8 @@
   #include "util_filter.h"
   #include "util_ebcdic.h"
   #include "mpm.h"
  -
  +#include "mpm_common.h"
  +#include "scoreboard.h"
   #include "mod_core.h"
   
   
  @@ -2841,6 +2842,36 @@
      "filters to be run"),
   AP_INIT_ITERATE("SetInputFilter", add_input_filter, NULL, ACCESS_CONF,
      "filters to be run on the request body"),
  +
  +/*
  + * These are default configuration directives that mpms can/should
  + * pay attention to. If an mpm wishes to use these, they should
  + * #defined them in mpm.h.
  + */
  +#ifdef AP_MPM_WANT_SET_PIDFILE
  +AP_INIT_TAKE1("PidFile",  ap_mpm_set_pidfile, NULL, RSRC_CONF, \
  +	      "A file for logging the server process ID"),
  +#endif
  +#ifdef AP_MPM_WANT_SET_SCOREBOARD
  +AP_INIT_TAKE1("ScoreBoardFile", ap_mpm_set_scoreboard, NULL, RSRC_CONF, \
  +	      "A file for Apache to maintain runtime process management information"),
  +#endif
  +#ifdef AP_MPM_WANT_SET_LOCKFILE
  +AP_INIT_TAKE1("LockFile",  ap_mpm_set_lockfile, NULL, RSRC_CONF, \
  +	      "The lockfile used when Apache needs to lock the accept() call"),
  +#endif
  +#ifdef AP_MPM_WANT_SET_MAX_REQUESTS
  +AP_INIT_TAKE1("MaxRequestsPerChild", ap_mpm_set_max_requests, NULL, RSRC_CONF,\
  +	      "Maximum number of requests a particular child serves before dying."),
  +#endif
  +#ifdef AP_MPM_WANT_SET_COREDUMPDIR
  +AP_INIT_TAKE1("CoreDumpDirectory", ap_mpm_set_coredumpdir, NULL, RSRC_CONF, \
  +	      "The location of the directory Apache changes to before dumping core"),
  +#endif
  +#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
  +AP_INIT_TAKE1("AcceptMutex", ap_mpm_set_accept_lock_mech, NULL, RSRC_CONF, \
  +	      "The system mutex implementation to use for the accept mutex"),
  +#endif
   { NULL }
   };
   
  
  
  
  1.61      +1 -1      httpd-2.0/server/listen.c
  
  Index: listen.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/listen.c,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- listen.c	2001/08/13 04:25:43	1.60
  +++ listen.c	2001/08/13 04:57:34	1.61
  @@ -58,6 +58,7 @@
   
   #include "apr_network_io.h"
   #include "apr_strings.h"
  +#include "apr_lock.h"
   
   #define APR_WANT_STRFUNC
   #include "apr_want.h"
  @@ -70,7 +71,6 @@
   #include "http_log.h"
   #include "mpm.h"
   #include "mpm_common.h"
  -
   
   ap_listen_rec *ap_listeners;
   #if APR_HAVE_IPV6
  
  
  
  1.60      +150 -1    httpd-2.0/server/mpm_common.c
  
  Index: mpm_common.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm_common.c,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- mpm_common.c	2001/07/18 21:16:40	1.59
  +++ mpm_common.c	2001/08/13 04:57:34	1.60
  @@ -70,6 +70,8 @@
   #include "apr.h"
   #include "apr_thread_proc.h"
   #include "apr_signal.h"
  +#include "apr_strings.h"
  +#include "apr_lock.h"
   
   #include "httpd.h"
   #include "http_config.h"
  @@ -80,6 +82,10 @@
   #include "ap_mpm.h"
   #include "ap_listen.h"
   
  +#ifdef AP_MPM_WANT_SET_SCOREBOARD
  +#include "scoreboard.h"
  +#endif
  +
   #ifdef HAVE_PWD_H
   #include <pwd.h>
   #endif
  @@ -455,7 +461,7 @@
       return APR_SUCCESS;
   }
   
  -AP_DECLARE(void) ap_mpm_pod_killpg(ap_pod_t *pod, int num)
  +void ap_mpm_pod_killpg(ap_pod_t *pod, int num)
   {
       int i;
       apr_status_t rv = APR_SUCCESS;
  @@ -463,5 +469,148 @@
       for (i = 0; i < num && rv == APR_SUCCESS; i++) {
           rv = ap_mpm_pod_signal(pod);
       }
  +}
  +#endif /* #ifdef AP_MPM_USES_POD */
  +
  +/* standard mpm configuration handling */
  +#ifdef AP_MPM_WANT_SET_PIDFILE
  +const char *ap_pid_fname = NULL;
  +
  +AP_DECLARE(const char *)ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
  +					    const char *arg)
  +{
  +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +    if (err != NULL) {
  +        return err;
  +    }
  +
  +    if (cmd->server->is_virtual) {
  +	return "PidFile directive not allowed in <VirtualHost>";
  +    }
  +    ap_pid_fname = arg;
  +    return NULL;
  +}
  +#endif
  +
  +#ifdef AP_MPM_WANT_SET_SCOREBOARD
  +AP_DECLARE(const char *) ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy,
  +					       const char *arg)
  +{
  +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +    if (err != NULL) {
  +        return err;
  +    }
  +
  +    ap_scoreboard_fname = arg;
  +    return NULL;
  +}
  +#endif
  +
  +#ifdef AP_MPM_WANT_SET_LOCKFILE
  +const char *ap_lock_fname = NULL;
  +AP_DECLARE(const char *) ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy,
  +					     const char *arg)
  +{
  +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +    if (err != NULL) {
  +        return err;
  +    }
  +
  +    ap_lock_fname = arg;
  +    return NULL;
  +}
  +#endif
  +
  +#ifdef AP_MPM_WANT_SET_MAX_REQUESTS
  +int ap_max_requests_per_child = 0;
  +AP_DECLARE(const char *) ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
  +						 const char *arg)
  +{
  +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +    if (err != NULL) {
  +        return err;
  +    }
  +
  +    ap_max_requests_per_child = atoi(arg);
  +
  +    return NULL;
  +}
  +#endif
  +
  +#ifdef AP_MPM_WANT_SET_COREDUMPDIR
  +char ap_coredump_dir[MAX_STRING_LEN];
  +AP_DECLARE(const char *) ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
  +						const char *arg)
  +{
  +    apr_finfo_t finfo;
  +    const char *fname;
  +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +    if (err != NULL) {
  +        return err;
  +    }
  +
  +    fname = ap_server_root_relative(cmd->pool, arg);
  +    if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS)
  +        || (finfo.filetype != APR_DIR)) {
  +	return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
  +			   " does not exist or is not a directory", NULL);
  +    }
  +    apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
  +    return NULL;
  +}
  +#endif
  +
  +#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
  +apr_lockmech_e_np accept_lock_mech = APR_LOCK_DEFAULT;
  +AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd,
  +						     void *dummy,
  +						     const char *arg)
  +{
  +    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +    if (err != NULL) {
  +        return err;
  +    }
  +
  +    if (!strcasecmp(arg, "default")) {
  +        accept_lock_mech = APR_LOCK_DEFAULT;
  +    }
  +#if APR_HAS_FLOCK_SERIALIZE
  +    else if (!strcasecmp(arg, "flock")) {
  +        accept_lock_mech = APR_LOCK_FLOCK;
  +    }
  +#endif
  +#if APR_HAS_FCNTL_SERIALIZE
  +    else if (!strcasecmp(arg, "fcntl")) {
  +        accept_lock_mech = APR_LOCK_FCNTL;
  +    }
  +#endif
  +#if APR_HAS_SYSVSEM_SERIALIZE
  +    else if (!strcasecmp(arg, "sysvsem")) {
  +        accept_lock_mech = APR_LOCK_SYSVSEM;
  +    }
  +#endif
  +#if APR_HAS_PROC_PTHREAD_SERIALIZE
  +    else if (!strcasecmp(arg, "proc_pthread")) {
  +        accept_lock_mech = APR_LOCK_PROC_PTHREAD;
  +    }
  +#endif
  +    else {
  +        return apr_pstrcat(cmd->pool, arg, " is an invalid mutex mechanism; valid "
  +                           "ones for this platform are: default"
  +#if APR_HAS_FLOCK_SERIALIZE
  +                           ", flock"
  +#endif
  +#if APR_HAS_FCNTL_SERIALIZE
  +                           ", fcntl"
  +#endif
  +#if APR_HAS_SYSVSEM_SERIALIZE
  +                           ", sysvsem"
  +#endif
  +#if APR_HAS_PROC_PTHREAD_SERIALIZE
  +                           ", proc_pthread"
  +#endif
  +                           , NULL);
  +    }
  +    return NULL;
   }
   #endif
  
  
  
  1.59      +0 -68     httpd-2.0/server/mpm/beos/beos.c
  
  Index: beos.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- beos.c	2001/07/26 18:24:58	1.58
  +++ beos.c	2001/08/13 04:57:34	1.59
  @@ -92,8 +92,6 @@
    */
   
   int ap_threads_per_child=HARD_THREAD_LIMIT;         /* Worker threads per child */
  -static int ap_max_requests_per_child=0;
  -static const char *ap_pid_fname=NULL;
   static int ap_threads_to_start=0;
   static int min_spare_threads=0;
   static int max_spare_threads=0;
  @@ -126,7 +124,6 @@
    */
   int ap_max_child_assigned = -1;
   int ap_max_threads_limit = -1;
  -char ap_coredump_dir[MAX_STRING_LEN];
   
   static apr_socket_t *udp_sock;
   static apr_sockaddr_t *udp_sa;
  @@ -984,32 +981,6 @@
       ap_hook_pre_config(beos_pre_config, NULL, NULL, APR_HOOK_MIDDLE); 
   }
   
  -
  -static const char *set_pidfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (cmd->server->is_virtual) {
  -	return "PidFile directive not allowed in <VirtualHost>";
  -    }
  -    ap_pid_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_scoreboard(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_scoreboard_fname = arg;
  -    return NULL;
  -}
  -
   static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy, const char *arg) 
   {
       const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  @@ -1107,43 +1078,8 @@
       return NULL;
   }
   
  -static const char *set_max_requests(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_max_requests_per_child = atoi(arg);
  -
  -    return NULL;
  -}
  -
  -static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    apr_finfo_t finfo;
  -    const char *fname;
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    fname = ap_server_root_relative(cmd->pool, arg);
  -    if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS) 
  -        || (finfo.filetype != APR_DIR)) {
  -	return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
  -			  " does not exist or is not a directory", NULL);
  -    }
  -    apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
  -    return NULL;
  -}
  -
   static const command_rec beos_cmds[] = {
   LISTEN_COMMANDS
  -AP_INIT_TAKE1( "PidFile", set_pidfile, NULL, RSRC_CONF,
  -    "A file for logging the server process ID"),
  -AP_INIT_TAKE1( "ScoreBoardFile", set_scoreboard, NULL, RSRC_CONF,
  -    "A file for Apache to maintain runtime process management information"),
   AP_INIT_TAKE1( "StartServers", set_daemons_to_start, NULL, RSRC_CONF,
     "Number of child processes launched at server startup"),
   AP_INIT_TAKE1( "MinSpareThreads", set_min_spare_threads, NULL, RSRC_CONF,
  @@ -1154,10 +1090,6 @@
     "Maximum number of children alive at the same time" ),
   AP_INIT_TAKE1( "ThreadsPerChild", set_threads_per_child, NULL, RSRC_CONF, 
     "Number of threads each child creates" ),
  -AP_INIT_TAKE1( "MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF,
  -  "Maximum number of requests a particular child serves before dying." ),
  -AP_INIT_TAKE1( "CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF, 
  -  "The location of the directory Apache changes to before dumping core" ),
   { NULL }
   };
   
  
  
  
  1.9       +5 -2      httpd-2.0/server/mpm/beos/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/beos/mpm.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mpm.h	2001/04/13 19:00:37	1.8
  +++ mpm.h	2001/08/13 04:57:34	1.9
  @@ -68,10 +68,13 @@
   #define MPM_CHILD_PID(i) (ap_scoreboard_image->servers[0][i].tid)
   #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
   
  -extern int ap_max_child_assigned;
  +#define AP_MPM_WANT_SET_PIDFILE
  +#define AP_MPM_WANT_SET_SCOREBOARD
  +#define AP_MPM_WANT_SET_MAX_REQUESTS
  +#define AP_MPM_WANT_SET_COREDUMPDIR
   
  +extern int ap_max_child_assigned;
   extern server_rec *ap_server_conf;
  -extern char ap_coredump_dir[MAX_STRING_LEN];
   extern int ap_threads_per_child;
   
   #endif /* APACHE_MPM_BEOS_H */
  
  
  
  1.8       +7 -1      httpd-2.0/server/mpm/perchild/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/mpm.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mpm.h	2001/04/13 19:00:37	1.7
  +++ mpm.h	2001/08/13 04:57:35	1.8
  @@ -67,6 +67,13 @@
   
   #define MPM_NAME "Perchild"
   
  +#define AP_MPM_WANT_SET_PIDFILE
  +#define AP_MPM_WANT_SET_SCOREBOARD
  +#define AP_MPM_WANT_SET_LOCKFILE
  +#define AP_MPM_WANT_SET_MAX_REQUESTS
  +#define AP_MPM_WANT_SET_COREDUMPDIR
  +#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
  +
   #define AP_MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
   #define MPM_SYNC_CHILD_TABLE()
   #define MPM_CHILD_PID(i) (ap_child_table[i].pid)
  @@ -86,6 +93,5 @@
   extern int ap_max_daemons_limit;
   extern ap_ctable ap_child_table[HARD_SERVER_LIMIT];
   extern server_rec *ap_server_conf;
  -extern char ap_coredump_dir[MAX_STRING_LEN];
   
   #endif /* APACHE_MPM_PERCHILD_H */
  
  
  
  1.73      +10 -144   httpd-2.0/server/mpm/perchild/perchild.c
  
  Index: perchild.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- perchild.c	2001/07/24 05:19:46	1.72
  +++ perchild.c	2001/08/13 04:57:35	1.73
  @@ -116,9 +116,8 @@
   static int max_spare_threads = 0;
   static int max_threads = 0;
   static int max_requests_per_child = 0;
  -static const char *ap_pid_fname=NULL;
  -static int num_daemons=0;
  -static int curr_child_num=0;
  +static int num_daemons = 0;
  +static int curr_child_num = 0;
   static int workers_may_exit = 0;
   static int requests_this_child;
   static int num_listenfds = 0;
  @@ -161,8 +160,6 @@
   int ap_max_daemons_limit = -1;
   int ap_threads_per_child = HARD_THREAD_LIMIT;
   
  -char ap_coredump_dir[MAX_STRING_LEN];
  -
   module AP_MODULE_DECLARE_DATA mpm_perchild_module;
   
   static apr_file_t *pipe_of_death_in = NULL;
  @@ -214,9 +211,7 @@
   #else
   #define SAFE_ACCEPT(stmt) (stmt)
   static apr_lock_t *process_accept_mutex;
  -static apr_lockmech_e_np accept_lock_mech = APR_LOCK_DEFAULT;
   #endif /* NO_SERIALIZED_ACCEPT */
  -static const char *lock_fname;
   static apr_lock_t *thread_accept_mutex;
   
   AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
  @@ -890,8 +885,8 @@
   
       /*stuff to do before we switch id's, so we have permissions.*/
   
  -    rv = SAFE_ACCEPT(apr_lock_child_init(&process_accept_mutex, lock_fname,
  -                                        pchild));
  +    rv = SAFE_ACCEPT(apr_lock_child_init(&process_accept_mutex, ap_lock_fname,
  +					 pchild));
       if (rv != APR_SUCCESS) {
           ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf,
                        "Couldn't initialize cross-process lock in child");
  @@ -1198,12 +1193,12 @@
       ap_log_pid(pconf, ap_pid_fname);
   
       /* Initialize cross-process accept lock */
  -    lock_fname = apr_psprintf(_pconf, "%s.%u",
  -                             ap_server_root_relative(_pconf, lock_fname),
  +    ap_lock_fname = apr_psprintf(_pconf, "%s.%u",
  +                             ap_server_root_relative(_pconf, ap_lock_fname),
                                my_pid);
       rv = SAFE_ACCEPT(apr_lock_create_np(&process_accept_mutex, APR_MUTEX,
                                           APR_CROSS_PROCESS, accept_lock_mech,
  -                                        lock_fname, _pconf));
  +                                        ap_lock_fname, _pconf));
       if (rv != APR_SUCCESS) {
           ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
                        "Couldn't create cross-process lock");
  @@ -1355,7 +1350,7 @@
       max_threads = HARD_THREAD_LIMIT;
       ap_pid_fname = DEFAULT_PIDLOG;
       ap_scoreboard_fname = DEFAULT_SCOREBOARD;
  -    lock_fname = DEFAULT_LOCKFILE;
  +    ap_lock_fname = DEFAULT_LOCKFILE;
       max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
       curr_child_num = 0;
   
  @@ -1384,7 +1379,7 @@
                                                    &mpm_perchild_module);
       char *foo;
       apr_size_t len;
  -    int zero = 0;
  +    apr_off_t zero = 0;
   
       apr_pool_userdata_get((void **)&foo, "PERCHILD_BUFFER", r->connection->pool);
       len = strlen(foo);
  @@ -1518,7 +1513,7 @@
       return OK;
   }
   
  -static apr_status_t perchild_buffer(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_size_t *readbytes)
  +static apr_status_t perchild_buffer(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_off_t *readbytes)
   {
       apr_bucket *e;
       apr_status_t rv;
  @@ -1573,41 +1568,6 @@
       ap_register_input_filter("PERCHILD_BUFFER", perchild_buffer, AP_FTYPE_CONTENT);
   }
   
  -static const char *set_pidfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (cmd->server->is_virtual) {
  -	return "PidFile directive not allowed in <VirtualHost>";
  -    }
  -    ap_pid_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_scoreboard(cmd_parms *cmd, void *dummy, const char *arg)
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_scoreboard_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_lockfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    lock_fname = arg;
  -    return NULL;
  -}
   static const char *set_num_daemons (cmd_parms *cmd, void *dummy, const char *arg) 
   {
       const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  @@ -1721,38 +1681,6 @@
       return NULL;
   }
   
  -static const char *set_max_requests(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    max_requests_per_child = atoi(arg);
  -
  -    return NULL;
  -}
  -
  -static const char *set_coredumpdir (cmd_parms *cmd, void *dummy,
  -				    const char *arg) 
  -{
  -    apr_finfo_t finfo;
  -    const char *fname;
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    fname = ap_server_root_relative(cmd->pool, arg);
  -    if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS) 
  -        || (finfo.filetype != APR_DIR)) {
  -	return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
  -			  " does not exist or is not a directory", NULL);
  -    }
  -    apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
  -    return NULL;
  -}
  -
   static const char *set_child_per_uid(cmd_parms *cmd, void *dummy, const char *u,
                                        const char *g, const char *num)
   {
  @@ -1802,65 +1730,9 @@
       return NULL;
   }
   
  -static const char *set_accept_lock_mech(cmd_parms *cmd, void *dummy, const char *arg)
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (!strcasecmp(arg, "default")) {
  -        accept_lock_mech = APR_LOCK_DEFAULT;
  -    }
  -#if APR_HAS_FLOCK_SERIALIZE
  -    else if (!strcasecmp(arg, "flock")) {
  -        accept_lock_mech = APR_LOCK_FLOCK;
  -    }
  -#endif
  -#if APR_HAS_FCNTL_SERIALIZE
  -    else if (!strcasecmp(arg, "fcntl")) {
  -        accept_lock_mech = APR_LOCK_FCNTL;
  -    }
  -#endif
  -#if APR_HAS_SYSVSEM_SERIALIZE
  -    else if (!strcasecmp(arg, "sysvsem")) {
  -        accept_lock_mech = APR_LOCK_SYSVSEM;
  -    }
  -#endif
  -#if APR_HAS_PROC_PTHREAD_SERIALIZE
  -    else if (!strcasecmp(arg, "proc_pthread")) {
  -        accept_lock_mech = APR_LOCK_PROC_PTHREAD;
  -    }
  -#endif
  -    else {
  -        return apr_pstrcat(cmd->pool, arg, " is an invalid mutex mechanism; valid "
  -                           "ones for this platform are: default"
  -#if APR_HAS_FLOCK_SERIALIZE
  -                           ", flock"
  -#endif
  -#if APR_HAS_FCNTL_SERIALIZE
  -                           ", fcntl"
  -#endif
  -#if APR_HAS_SYSVSEM_SERIALIZE
  -                           ", sysvsem"
  -#endif
  -#if APR_HAS_PROC_PTHREAD_SERIALIZE
  -                           ", proc_pthread"
  -#endif
  -                           , NULL);
  -    }
  -    return NULL;
  -}
  -
   static const command_rec perchild_cmds[] = {
   UNIX_DAEMON_COMMANDS
   LISTEN_COMMANDS
  -AP_INIT_TAKE1("PidFile", set_pidfile, NULL, RSRC_CONF,
  -              "A file for logging the server process ID"),
  -AP_INIT_TAKE1("ScoreBoardFile", set_scoreboard, NULL, RSRC_CONF,
  -              "A file for Apache to maintain runtime process management information"),
  -AP_INIT_TAKE1("LockFile", set_lockfile, NULL, RSRC_CONF,
  -              "The lockfile used when Apache needs to lock the accept() call"),
   AP_INIT_TAKE1("NumServers", set_num_daemons, NULL, RSRC_CONF,
                 "Number of children alive at the same time"),
   AP_INIT_TAKE1("StartThreads", set_threads_to_start, NULL, RSRC_CONF,
  @@ -1871,16 +1743,10 @@
                 "Maximum number of idle threads per child"),
   AP_INIT_TAKE1("MaxThreadsPerChild", set_max_threads, NULL, RSRC_CONF,
                 "Maximum number of threads per child"),
  -AP_INIT_TAKE1("MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF,
  -              "Maximum number of requests a particular child serves before dying."),
  -AP_INIT_TAKE1("CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF,
  -              "The location of the directory Apache changes to before dumping core"),
   AP_INIT_TAKE3("ChildperUserID", set_child_per_uid, NULL, RSRC_CONF,
                 "Specify a User and Group for a specific child process."),
   AP_INIT_TAKE2("AssignUserID", assign_childuid, NULL, RSRC_CONF,
                 "Tie a virtual host to a specific child process."),
  -AP_INIT_TAKE1("AcceptMutex", set_accept_lock_mech, NULL, RSRC_CONF,
  -              "The system mutex implementation to use for the accept mutex"),
   { NULL }
   };
   
  
  
  
  1.13      +7 -1      httpd-2.0/server/mpm/prefork/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/mpm.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- mpm.h	2001/06/07 00:09:16	1.12
  +++ mpm.h	2001/08/13 04:57:35	1.13
  @@ -68,6 +68,13 @@
   
   #define MPM_NAME "Prefork"
   
  +#define AP_MPM_WANT_SET_PIDFILE
  +#define AP_MPM_WANT_SET_SCOREBOARD
  +#define AP_MPM_WANT_SET_LOCKFILE
  +#define AP_MPM_WANT_SET_MAX_REQUESTS
  +#define AP_MPM_WANT_SET_COREDUMPDIR
  +#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
  +
   #define AP_MPM_USES_POD 1
   #define AP_MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
   #define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
  @@ -77,5 +84,4 @@
   extern int ap_threads_per_child;
   extern int ap_max_daemons_limit;
   extern server_rec *ap_server_conf;
  -extern char ap_coredump_dir[MAX_STRING_LEN];
   #endif /* APACHE_MPM_PREFORK_H */
  
  
  
  1.194     +0 -135    httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.193
  retrieving revision 1.194
  diff -u -r1.193 -r1.194
  --- prefork.c	2001/08/10 01:34:11	1.193
  +++ prefork.c	2001/08/13 04:57:35	1.194
  @@ -134,11 +134,7 @@
   /* config globals */
   
   int ap_threads_per_child=0;         /* Worker threads per child */
  -static int ap_max_requests_per_child=0;
  -static const char *ap_pid_fname=NULL;
   static apr_lock_t *accept_lock;
  -static const char *ap_lock_fname;
  -static apr_lockmech_e_np accept_lock_mech = APR_LOCK_DEFAULT;
   static int ap_daemons_to_start=0;
   static int ap_daemons_min_free=0;
   static int ap_daemons_max_free=0;
  @@ -154,8 +150,6 @@
   int ap_max_daemons_limit = -1;
   server_rec *ap_server_conf;
   
  -char ap_coredump_dir[MAX_STRING_LEN];
  -
   /* *Non*-shared http_main globals... */
   
   static apr_socket_t *sd;
  @@ -1348,42 +1342,6 @@
       ap_hook_pre_config(prefork_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
   }
   
  -static const char *set_pidfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (cmd->server->is_virtual) {
  -	return "PidFile directive not allowed in <VirtualHost>";
  -    }
  -    ap_pid_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_scoreboard(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_scoreboard_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_lockfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_lock_fname = arg;
  -    return NULL;
  -}
  -
   static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy, const char *arg) 
   {
       const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  @@ -1455,96 +1413,9 @@
       return NULL;
   }
   
  -static const char *set_max_requests(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_max_requests_per_child = atoi(arg);
  -
  -    return NULL;
  -}
  -
  -static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    apr_finfo_t finfo;
  -    const char *fname;
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    fname = ap_server_root_relative(cmd->pool, arg);
  -    if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS) 
  -        || (finfo.filetype != APR_DIR)) {
  -	return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
  -			  " does not exist or is not a directory", NULL);
  -    }
  -    apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
  -    return NULL;
  -}
  -
  -static const char *set_accept_lock_mech(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (!strcasecmp(arg, "default")) {
  -        accept_lock_mech = APR_LOCK_DEFAULT;
  -    }
  -#if APR_HAS_FLOCK_SERIALIZE
  -    else if (!strcasecmp(arg, "flock")) {
  -        accept_lock_mech = APR_LOCK_FLOCK;
  -    }
  -#endif
  -#if APR_HAS_FCNTL_SERIALIZE
  -    else if (!strcasecmp(arg, "fcntl")) {
  -        accept_lock_mech = APR_LOCK_FCNTL;
  -    }
  -#endif
  -#if APR_HAS_SYSVSEM_SERIALIZE
  -    else if (!strcasecmp(arg, "sysvsem")) {
  -        accept_lock_mech = APR_LOCK_SYSVSEM;
  -    }
  -#endif
  -#if APR_HAS_PROC_PTHREAD_SERIALIZE
  -    else if (!strcasecmp(arg, "proc_pthread")) {
  -        accept_lock_mech = APR_LOCK_PROC_PTHREAD;
  -    }
  -#endif
  -    else {
  -        return apr_pstrcat(cmd->pool, arg, " is an invalid mutex mechanism; valid "
  -                           "ones for this platform are: default"
  -#if APR_HAS_FLOCK_SERIALIZE
  -                           ", flock"
  -#endif
  -#if APR_HAS_FCNTL_SERIALIZE
  -                           ", fcntl"
  -#endif
  -#if APR_HAS_SYSVSEM_SERIALIZE
  -                           ", sysvsem"
  -#endif
  -#if APR_HAS_PROC_PTHREAD_SERIALIZE
  -                           ", proc_pthread"
  -#endif
  -                           , NULL);
  -    }
  -    return NULL;
  -}
  -
   static const command_rec prefork_cmds[] = {
   UNIX_DAEMON_COMMANDS
   LISTEN_COMMANDS
  -AP_INIT_TAKE1("PidFile", set_pidfile, NULL, RSRC_CONF,
  -              "A file for logging the server process ID"),
  -AP_INIT_TAKE1("ScoreBoardFile", set_scoreboard, NULL, RSRC_CONF,
  -              "A file for Apache to maintain runtime process management information"),
  -AP_INIT_TAKE1("LockFile", set_lockfile, NULL, RSRC_CONF,
  -              "The lockfile used when Apache needs to lock the accept() call"),
   AP_INIT_TAKE1("StartServers", set_daemons_to_start, NULL, RSRC_CONF,
                 "Number of child processes launched at server startup"),
   AP_INIT_TAKE1("MinSpareServers", set_min_free_servers, NULL, RSRC_CONF,
  @@ -1553,12 +1424,6 @@
                 "Maximum number of idle children"),
   AP_INIT_TAKE1("MaxClients", set_server_limit, NULL, RSRC_CONF,
                 "Maximum number of children alive at the same time"),
  -AP_INIT_TAKE1("MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF,
  -              "Maximum number of requests a particular child serves before dying."),
  -AP_INIT_TAKE1("CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF,
  -              "The location of the directory Apache changes to before dumping core"),
  -AP_INIT_TAKE1("AcceptMutex", set_accept_lock_mech, NULL, RSRC_CONF,
  -              "The system mutex implementation to use for the accept mutex"),
   { NULL }
   };
   
  
  
  
  1.9       +4 -1      httpd-2.0/server/mpm/spmt_os2/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/spmt_os2/mpm.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- mpm.h	2001/04/13 19:00:38	1.8
  +++ mpm.h	2001/08/13 04:57:35	1.9
  @@ -67,7 +67,10 @@
   
   #define MPM_NAME "SPMT_OS2"
   
  -extern char ap_coredump_dir[MAX_STRING_LEN];
  +#define AP_MPM_WANT_SET_PIDFILE
  +#define AP_MPM_WANT_SET_MAX_REQUESTS
  +#define AP_MPM_WANT_SET_COREDUMPDIR
  +
   extern server_rec *ap_server_conf;
   extern int ap_threads_per_child;
   
  
  
  
  1.99      +0 -55     httpd-2.0/server/mpm/spmt_os2/spmt_os2.c
  
  Index: spmt_os2.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/spmt_os2/spmt_os2.c,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- spmt_os2.c	2001/07/18 20:45:36	1.98
  +++ spmt_os2.c	2001/08/13 04:57:35	1.99
  @@ -84,8 +84,6 @@
   
   /* config globals */
   
  -static int ap_max_requests_per_child=0;
  -static const char *ap_pid_fname=NULL;
   static int ap_daemons_to_start=0;
   static int ap_daemons_min_free=0;
   static int ap_daemons_max_free=0;
  @@ -149,8 +147,6 @@
       _endthread();
   }
   
  -
  -
   static apr_lock_t *accept_mutex = NULL;
   
   static apr_status_t accept_mutex_child_cleanup(void *foo)
  @@ -1177,20 +1173,6 @@
       ap_hook_pre_config(spmt_os2_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
   }
   
  -static const char *set_pidfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (cmd->server->is_virtual) {
  -	return "PidFile directive not allowed in <VirtualHost>";
  -    }
  -    ap_pid_fname = arg;
  -    return NULL;
  -}
  -
   static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy, const char *arg)
   {
       const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  @@ -1262,37 +1244,6 @@
       return NULL;
   }
   
  -static const char *set_max_requests(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_max_requests_per_child = atoi(arg);
  -
  -    return NULL;
  -}
  -
  -static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    apr_finfo_t finfo;
  -    const char *fname;
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    fname = ap_server_root_relative(cmd->pool, arg);
  -    if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS) 
  -        || (finfo.filetype != APR_DIR)) {
  -	return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
  -			  " does not exist or is not a directory", NULL);
  -    }
  -    apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
  -    return NULL;
  -}
  -
   /* Stub functions until this MPM supports the connection status API */
   
   AP_DECLARE(void) ap_update_connection_status(long conn_id, const char *key, \
  @@ -1308,8 +1259,6 @@
   
   static const command_rec spmt_os2_cmds[] = {
   LISTEN_COMMANDS
  -AP_INIT_TAKE1("PidFile", set_pidfile, NULL, RSRC_CONF,
  -    "A file for logging the server process ID"),
   AP_INIT_TAKE1( "StartServers", set_daemons_to_start, NULL, RSRC_CONF, 
     "Number of child processes launched at server startup" ),
   AP_INIT_TAKE1( "MinSpareServers", set_min_free_servers, NULL, RSRC_CONF,
  @@ -1318,10 +1267,6 @@
     "Maximum number of idle children" ),
   AP_INIT_TAKE1( "MaxClients", set_server_limit, NULL, RSRC_CONF,
     "Maximum number of children alive at the same time" ),
  -AP_INIT_TAKE1( "MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF,
  -  "Maximum number of requests a particular child serves before dying." ),
  -AP_INIT_TAKE1( "CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF,
  -  "The location of the directory Apache changes to before dumping core" ),
   { NULL }
   };
   
  
  
  
  1.6       +7 -1      httpd-2.0/server/mpm/threaded/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/threaded/mpm.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- mpm.h	2001/05/07 18:41:48	1.5
  +++ mpm.h	2001/08/13 04:57:35	1.6
  @@ -65,6 +65,13 @@
   
   #define MPM_NAME "Threaded"
   
  +#define AP_MPM_WANT_SET_PIDFILE
  +#define AP_MPM_WANT_SET_SCOREBOARD
  +#define AP_MPM_WANT_SET_LOCKFILE
  +#define AP_MPM_WANT_SET_MAX_REQUESTS
  +#define AP_MPM_WANT_SET_COREDUMPDIR
  +#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
  +
   #define AP_MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
   #define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
   #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
  @@ -73,6 +80,5 @@
   extern int ap_threads_per_child;
   extern int ap_max_daemons_limit;
   extern server_rec *ap_server_conf;
  -extern char ap_coredump_dir[MAX_STRING_LEN];
   
   #endif /* APACHE_MPM_THREADED_H */
  
  
  
  1.58      +0 -139    httpd-2.0/server/mpm/threaded/threaded.c
  
  Index: threaded.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/threaded/threaded.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- threaded.c	2001/08/10 01:34:11	1.57
  +++ threaded.c	2001/08/13 04:57:35	1.58
  @@ -105,8 +105,6 @@
    */
   
   int ap_threads_per_child=0;         /* Worker threads per child */
  -static int ap_max_requests_per_child=0;
  -static const char *ap_pid_fname=NULL;
   static int ap_daemons_to_start=0;
   static int min_spare_threads=0;
   static int max_spare_threads=0;
  @@ -141,8 +139,6 @@
    */
   int ap_max_daemons_limit = -1;
   
  -char ap_coredump_dir[MAX_STRING_LEN];
  -
   static apr_file_t *pipe_of_death_in = NULL;
   static apr_file_t *pipe_of_death_out = NULL;
   static apr_lock_t *pipe_of_death_mutex;   /* insures that a child process only
  @@ -181,8 +177,6 @@
   
   /* Locks for accept serialization */
   static apr_lock_t *accept_mutex;
  -static apr_lockmech_e_np accept_lock_mech = APR_LOCK_DEFAULT;
  -static const char *lock_fname;
   
   #ifdef NO_SERIALIZED_ACCEPT
   #define SAFE_ACCEPT(stmt) APR_SUCCESS
  @@ -1387,44 +1381,6 @@
       ap_hook_pre_config(threaded_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
   }
   
  -
  -static const char *set_pidfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (cmd->server->is_virtual) {
  -	return "PidFile directive not allowed in <VirtualHost>";
  -    }
  -    ap_pid_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_scoreboard(cmd_parms *cmd, void *dummy,
  -				  const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_scoreboard_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_lockfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    lock_fname = arg;
  -    return NULL;
  -}
  -
   static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy,
   					const char *arg) 
   {
  @@ -1529,98 +1485,9 @@
       return NULL;
   }
   
  -static const char *set_max_requests(cmd_parms *cmd, void *dummy,
  -				    const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_max_requests_per_child = atoi(arg);
  -
  -    return NULL;
  -}
  -
  -static const char *set_coredumpdir (cmd_parms *cmd, void *dummy,
  -				    const char *arg) 
  -{
  -    apr_finfo_t finfo;
  -    const char *fname;
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    fname = ap_server_root_relative(cmd->pool, arg);
  -    if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS) 
  -        || (finfo.filetype != APR_DIR)) {
  -	return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
  -			  " does not exist or is not a directory", NULL);
  -    }
  -    apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
  -    return NULL;
  -}
  -
  -static const char *set_accept_lock_mech(cmd_parms *cmd, void *dummy, const char *arg)
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (!strcasecmp(arg, "default")) {
  -        accept_lock_mech = APR_LOCK_DEFAULT;
  -    }
  -#if APR_HAS_FLOCK_SERIALIZE
  -    else if (!strcasecmp(arg, "flock")) {
  -        accept_lock_mech = APR_LOCK_FLOCK;
  -    }
  -#endif
  -#if APR_HAS_FCNTL_SERIALIZE
  -    else if (!strcasecmp(arg, "fcntl")) {
  -        accept_lock_mech = APR_LOCK_FCNTL;
  -    }
  -#endif
  -#if APR_HAS_SYSVSEM_SERIALIZE
  -    else if (!strcasecmp(arg, "sysvsem")) {
  -        accept_lock_mech = APR_LOCK_SYSVSEM;
  -    }
  -#endif
  -#if APR_HAS_PROC_PTHREAD_SERIALIZE
  -    else if (!strcasecmp(arg, "proc_pthread")) {
  -        accept_lock_mech = APR_LOCK_PROC_PTHREAD;
  -    }
  -#endif
  -    else {
  -        return apr_pstrcat(cmd->pool, arg, " is an invalid mutex mechanism; valid "
  -                           "ones for this platform are: default"
  -#if APR_HAS_FLOCK_SERIALIZE
  -                           ", flock"
  -#endif
  -#if APR_HAS_FCNTL_SERIALIZE
  -                           ", fcntl"
  -#endif
  -#if APR_HAS_SYSVSEM_SERIALIZE
  -                           ", sysvsem"
  -#endif
  -#if APR_HAS_PROC_PTHREAD_SERIALIZE
  -                           ", proc_pthread"
  -#endif
  -                           , NULL);
  -    }
  -    return NULL;
  -}
  -
   static const command_rec threaded_cmds[] = {
   UNIX_DAEMON_COMMANDS
   LISTEN_COMMANDS
  -AP_INIT_TAKE1("PidFile", set_pidfile, NULL, RSRC_CONF,
  -    "A file for logging the server process ID"),
  -AP_INIT_TAKE1("ScoreBoardFile", set_scoreboard, NULL, RSRC_CONF,
  -    "A file for Apache to maintain runtime process management information"),
  -AP_INIT_TAKE1("LockFile", set_lockfile, NULL, RSRC_CONF,
  -    "The lockfile used when Apache needs to lock the accept() call"),
   AP_INIT_TAKE1("StartServers", set_daemons_to_start, NULL, RSRC_CONF,
     "Number of child processes launched at server startup"),
   AP_INIT_TAKE1("MinSpareThreads", set_min_spare_threads, NULL, RSRC_CONF,
  @@ -1631,12 +1498,6 @@
     "Maximum number of children alive at the same time"),
   AP_INIT_TAKE1("ThreadsPerChild", set_threads_per_child, NULL, RSRC_CONF,
     "Number of threads each child creates"),
  -AP_INIT_TAKE1("MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF,
  -  "Maximum number of requests a particular child serves before dying."),
  -AP_INIT_TAKE1("CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF,
  -  "The location of the directory Apache changes to before dumping core"),
  -AP_INIT_TAKE1("AcceptMutex", set_accept_lock_mech, NULL, RSRC_CONF,
  -              "The system mutex implementation to use for the accept mutex"),
   { NULL }
   };
   
  
  
  
  1.7       +7 -0      httpd-2.0/server/mpm/winnt/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mpm.h	2001/07/18 21:13:04	1.6
  +++ mpm.h	2001/08/13 04:57:35	1.7
  @@ -68,6 +68,13 @@
   
   #define MPM_NAME "WinNT"
   
  +#define AP_MPM_WANT_SET_PIDFILE
  +#define AP_MPM_WANT_SET_SCOREBOARD
  +#define AP_MPM_WANT_SET_LOCKFILE
  +#define AP_MPM_WANT_SET_MAX_REQUESTS
  +#define AP_MPM_WANT_SET_COREDUMPDIR
  +#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
  +
   extern int ap_threads_per_child;
   
   #endif /* APACHE_MPM_H */
  
  
  
  1.2       +7 -0      httpd-2.0/server/mpm/worker/mpm.h
  
  Index: mpm.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/mpm.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mpm.h	2001/07/30 05:02:53	1.1
  +++ mpm.h	2001/08/13 04:57:35	1.2
  @@ -65,6 +65,13 @@
   
   #define MPM_NAME "Worker"
   
  +#define AP_MPM_WANT_SET_PIDFILE
  +#define AP_MPM_WANT_SET_SCOREBOARD
  +#define AP_MPM_WANT_SET_LOCKFILE
  +#define AP_MPM_WANT_SET_MAX_REQUESTS
  +#define AP_MPM_WANT_SET_COREDUMPDIR
  +#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
  +
   #define AP_MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
   #define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
   #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
  
  
  
  1.12      +0 -133    httpd-2.0/server/mpm/worker/worker.c
  
  Index: worker.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- worker.c	2001/08/10 05:00:27	1.11
  +++ worker.c	2001/08/13 04:57:35	1.12
  @@ -1425,44 +1425,6 @@
       ap_hook_pre_config(worker_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
   }
   
  -
  -static const char *set_pidfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (cmd->server->is_virtual) {
  -	return "PidFile directive not allowed in <VirtualHost>";
  -    }
  -    ap_pid_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_scoreboard(cmd_parms *cmd, void *dummy,
  -				  const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_scoreboard_fname = arg;
  -    return NULL;
  -}
  -
  -static const char *set_lockfile(cmd_parms *cmd, void *dummy, const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    lock_fname = arg;
  -    return NULL;
  -}
  -
   static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy,
   					const char *arg) 
   {
  @@ -1567,98 +1529,9 @@
       return NULL;
   }
   
  -static const char *set_max_requests(cmd_parms *cmd, void *dummy,
  -				    const char *arg) 
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    ap_max_requests_per_child = atoi(arg);
  -
  -    return NULL;
  -}
  -
  -static const char *set_coredumpdir (cmd_parms *cmd, void *dummy,
  -				    const char *arg) 
  -{
  -    apr_finfo_t finfo;
  -    const char *fname;
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    fname = ap_server_root_relative(cmd->pool, arg);
  -    if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS) 
  -        || (finfo.filetype != APR_DIR)) {
  -	return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname, 
  -			  " does not exist or is not a directory", NULL);
  -    }
  -    apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
  -    return NULL;
  -}
  -
  -static const char *set_accept_lock_mech(cmd_parms *cmd, void *dummy, const char *arg)
  -{
  -    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  -    if (err != NULL) {
  -        return err;
  -    }
  -
  -    if (!strcasecmp(arg, "default")) {
  -        accept_lock_mech = APR_LOCK_DEFAULT;
  -    }
  -#if APR_HAS_FLOCK_SERIALIZE
  -    else if (!strcasecmp(arg, "flock")) {
  -        accept_lock_mech = APR_LOCK_FLOCK;
  -    }
  -#endif
  -#if APR_HAS_FCNTL_SERIALIZE
  -    else if (!strcasecmp(arg, "fcntl")) {
  -        accept_lock_mech = APR_LOCK_FCNTL;
  -    }
  -#endif
  -#if APR_HAS_SYSVSEM_SERIALIZE
  -    else if (!strcasecmp(arg, "sysvsem")) {
  -        accept_lock_mech = APR_LOCK_SYSVSEM;
  -    }
  -#endif
  -#if APR_HAS_PROC_PTHREAD_SERIALIZE
  -    else if (!strcasecmp(arg, "proc_pthread")) {
  -        accept_lock_mech = APR_LOCK_PROC_PTHREAD;
  -    }
  -#endif
  -    else {
  -        return apr_pstrcat(cmd->pool, arg, " is an invalid mutex mechanism; valid "
  -                           "ones for this platform are: default"
  -#if APR_HAS_FLOCK_SERIALIZE
  -                           ", flock"
  -#endif
  -#if APR_HAS_FCNTL_SERIALIZE
  -                           ", fcntl"
  -#endif
  -#if APR_HAS_SYSVSEM_SERIALIZE
  -                           ", sysvsem"
  -#endif
  -#if APR_HAS_PROC_PTHREAD_SERIALIZE
  -                           ", proc_pthread"
  -#endif
  -                           , NULL);
  -    }
  -    return NULL;
  -}
  -
   static const command_rec worker_cmds[] = {
   UNIX_DAEMON_COMMANDS
   LISTEN_COMMANDS
  -AP_INIT_TAKE1("PidFile", set_pidfile, NULL, RSRC_CONF,
  -    "A file for logging the server process ID"),
  -AP_INIT_TAKE1("ScoreBoardFile", set_scoreboard, NULL, RSRC_CONF,
  -    "A file for Apache to maintain runtime process management information"),
  -AP_INIT_TAKE1("LockFile", set_lockfile, NULL, RSRC_CONF,
  -    "The lockfile used when Apache needs to lock the accept() call"),
   AP_INIT_TAKE1("StartServers", set_daemons_to_start, NULL, RSRC_CONF,
     "Number of child processes launched at server startup"),
   AP_INIT_TAKE1("MinSpareThreads", set_min_spare_threads, NULL, RSRC_CONF,
  @@ -1669,12 +1542,6 @@
     "Maximum number of children alive at the same time"),
   AP_INIT_TAKE1("ThreadsPerChild", set_threads_per_child, NULL, RSRC_CONF,
     "Number of threads each child creates"),
  -AP_INIT_TAKE1("MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF,
  -  "Maximum number of requests a particular child serves before dying."),
  -AP_INIT_TAKE1("CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF,
  -  "The location of the directory Apache changes to before dumping core"),
  -AP_INIT_TAKE1("AcceptMutex", set_accept_lock_mech, NULL, RSRC_CONF,
  -              "The system mutex implementation to use for the accept mutex"),
   { NULL }
   };