httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cody Sherr <csh...@covalent.net>
Subject [PATCH] sanitize mpm config directives
Date Fri, 10 Aug 2001 18:52:30 GMT

The purpose of this patch is to bring a lot of the common mpm set_*
functions for configuration directives into mpm_common.[ch]. This reduces
duplicate code and insures standardization for different MPMs.

The motive for this patch is listed in the STATUS under "Sanitize the MPM
config directives"

Feedback would be especialy appreciated from beos and spmt_os2 mpm
developers on this patch.

regards,

-- 
Cody Sherr

Engineer
Covalent Technologies

phone: (415)536-5292
email: csherr@covalent.net

Index: include/mpm_common.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/include/mpm_common.h,v
retrieving revision 1.23
diff -u -r1.23 mpm_common.h
--- include/mpm_common.h	2001/07/27 21:01:16	1.23
+++ include/mpm_common.h	2001/08/10 18:42:42
@@ -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
Index: os/unix/unixd.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/os/unix/unixd.c,v
retrieving revision 1.37
diff -u -r1.37 unixd.c
--- os/unix/unixd.c	2001/07/30 17:55:38	1.37
+++ os/unix/unixd.c	2001/08/10 18:42:42
@@ -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"
Index: server/core.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/core.c,v
retrieving revision 1.34
diff -u -r1.34 core.c
--- server/core.c	2001/08/07 16:19:03	1.34
+++ server/core.c	2001/08/10 18:42:43
@@ -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 }
 };

Index: server/listen.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/listen.c,v
retrieving revision 1.59
diff -u -r1.59 listen.c
--- server/listen.c	2001/07/26 16:36:40	1.59
+++ server/listen.c	2001/08/10 18:42:43
@@ -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
Index: server/mpm_common.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm_common.c,v
retrieving revision 1.59
diff -u -r1.59 mpm_common.c
--- server/mpm_common.c	2001/07/18 21:16:40	1.59
+++ server/mpm_common.c	2001/08/10 18:42:43
@@ -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
Index: server/mpm/beos/beos.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/beos/beos.c,v
retrieving revision 1.58
diff -u -r1.58 beos.c
--- server/mpm/beos/beos.c	2001/07/26 18:24:58	1.58
+++ server/mpm/beos/beos.c	2001/08/10 18:42:43
@@ -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 }
 };

Index: server/mpm/beos/mpm.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/beos/mpm.h,v
retrieving revision 1.8
diff -u -r1.8 mpm.h
--- server/mpm/beos/mpm.h	2001/04/13 19:00:37	1.8
+++ server/mpm/beos/mpm.h	2001/08/10 18:42:43
@@ -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 */
Index: server/mpm/perchild/mpm.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/perchild/mpm.h,v
retrieving revision 1.7
diff -u -r1.7 mpm.h
--- server/mpm/perchild/mpm.h	2001/04/13 19:00:37	1.7
+++ server/mpm/perchild/mpm.h	2001/08/10 18:42:43
@@ -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 */
Index: server/mpm/perchild/perchild.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/perchild/perchild.c,v
retrieving revision 1.72
diff -u -r1.72 perchild.c
--- server/mpm/perchild/perchild.c	2001/07/24 05:19:46	1.72
+++ server/mpm/perchild/perchild.c	2001/08/10 18:42:43
@@ -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 }
 };

Index: server/mpm/prefork/mpm.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/prefork/mpm.h,v
retrieving revision 1.12
diff -u -r1.12 mpm.h
--- server/mpm/prefork/mpm.h	2001/06/07 00:09:16	1.12
+++ server/mpm/prefork/mpm.h	2001/08/10 18:42:43
@@ -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 */
Index: server/mpm/prefork/prefork.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/prefork/prefork.c,v
retrieving revision 1.193
diff -u -r1.193 prefork.c
--- server/mpm/prefork/prefork.c	2001/08/10 01:34:11	1.193
+++ server/mpm/prefork/prefork.c	2001/08/10 18:42:44
@@ -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 apr_lock_t *accept_lock;
 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,41 +1342,7 @@
     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)
 {
@@ -1455,96 +1415,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 +1426,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 }
 };

Index: server/mpm/spmt_os2/mpm.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/spmt_os2/mpm.h,v
retrieving revision 1.8
diff -u -r1.8 mpm.h
--- server/mpm/spmt_os2/mpm.h	2001/04/13 19:00:38	1.8
+++ server/mpm/spmt_os2/mpm.h	2001/08/10 18:42:44
@@ -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;

Index: server/mpm/spmt_os2/spmt_os2.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/spmt_os2/spmt_os2.c,v
retrieving revision 1.98
diff -u -r1.98 spmt_os2.c
--- server/mpm/spmt_os2/spmt_os2.c	2001/07/18 20:45:36	1.98
+++ server/mpm/spmt_os2/spmt_os2.c	2001/08/10 18:42:44
@@ -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 }
 };

Index: server/mpm/threaded/mpm.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/threaded/mpm.h,v
retrieving revision 1.5
diff -u -r1.5 mpm.h
--- server/mpm/threaded/mpm.h	2001/05/07 18:41:48	1.5
+++ server/mpm/threaded/mpm.h	2001/08/10 18:42:44
@@ -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 */
Index: server/mpm/threaded/threaded.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/threaded/threaded.c,v
retrieving revision 1.57
diff -u -r1.57 threaded.c
--- server/mpm/threaded/threaded.c	2001/08/10 01:34:11	1.57
+++ server/mpm/threaded/threaded.c	2001/08/10 18:42:44
@@ -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 }
 };

Index: server/mpm/winnt/mpm.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/server/mpm/winnt/mpm.h,v
retrieving revision 1.6
diff -u -r1.6 mpm.h
--- server/mpm/winnt/mpm.h	2001/07/18 21:13:04	1.6
+++ server/mpm/winnt/mpm.h	2001/08/10 18:42:44
@@ -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 */


Mime
View raw message