From 2b5249df238dce19e051b1f6a1db51c34247d866 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 14 Aug 2001 12:30:50 +0000 Subject: [PATCH] namespace-protect accept_lock_mech fix a bug in the worker MPM which effectively disabled the AcceptMutex directive git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90153 13f79535-47bb-0310-9956-ffa450edef68 --- include/mpm_common.h | 2 +- server/mpm/experimental/perchild/perchild.c | 2 +- server/mpm/perchild/perchild.c | 2 +- server/mpm/prefork/prefork.c | 2 +- server/mpm/threaded/threaded.c | 2 +- server/mpm/worker/worker.c | 3 +-- server/mpm_common.c | 12 ++++++------ 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/mpm_common.h b/include/mpm_common.h index 9cca64c041..d75c864afc 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -252,7 +252,7 @@ const char *ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy, * 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; +extern apr_lockmech_e_np ap_accept_lock_mech; const char *ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy, const char *arg); #endif diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c index efb68418ce..37d695fe03 100644 --- a/server/mpm/experimental/perchild/perchild.c +++ b/server/mpm/experimental/perchild/perchild.c @@ -1197,7 +1197,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) 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, + APR_CROSS_PROCESS, ap_accept_lock_mech, ap_lock_fname, _pconf)); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c index efb68418ce..37d695fe03 100644 --- a/server/mpm/perchild/perchild.c +++ b/server/mpm/perchild/perchild.c @@ -1197,7 +1197,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) 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, + APR_CROSS_PROCESS, ap_accept_lock_mech, ap_lock_fname, _pconf)); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index c83077d7cf..3133fc5b85 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -271,7 +271,7 @@ static void accept_mutex_init(apr_pool_t *p) expand_lock_fname(p); rv = apr_lock_create_np(&accept_lock, APR_MUTEX, APR_CROSS_PROCESS, - accept_lock_mech, ap_lock_fname, p); + ap_accept_lock_mech, ap_lock_fname, p); if (rv) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, "couldn't create accept mutex"); exit(APEXIT_INIT); diff --git a/server/mpm/threaded/threaded.c b/server/mpm/threaded/threaded.c index 68280d5a12..8ea3700ed9 100644 --- a/server/mpm/threaded/threaded.c +++ b/server/mpm/threaded/threaded.c @@ -1222,7 +1222,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) ap_server_root_relative(_pconf, ap_lock_fname), ap_my_pid); rv = apr_lock_create_np(&accept_mutex, APR_MUTEX, APR_LOCKALL, - accept_lock_mech, ap_lock_fname, _pconf); + ap_accept_lock_mech, ap_lock_fname, _pconf); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, "Couldn't create accept lock"); diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index b1a4bdbc6c..d14771a5ef 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -190,7 +190,6 @@ static apr_lock_t *worker_thread_count_mutex; /* 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 @@ -1266,7 +1265,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) ap_server_root_relative(_pconf, lock_fname), ap_my_pid); rv = apr_lock_create_np(&accept_mutex, APR_MUTEX, APR_LOCKALL, - accept_lock_mech, lock_fname, _pconf); + ap_accept_lock_mech, lock_fname, _pconf); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, "Couldn't create accept lock"); diff --git a/server/mpm_common.c b/server/mpm_common.c index 234382884e..e850c3a95a 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -570,7 +570,7 @@ const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy, #endif #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH -apr_lockmech_e_np accept_lock_mech = APR_LOCK_DEFAULT; +apr_lockmech_e_np ap_accept_lock_mech = APR_LOCK_DEFAULT; AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy, const char *arg) @@ -581,26 +581,26 @@ AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd, } if (!strcasecmp(arg, "default")) { - accept_lock_mech = APR_LOCK_DEFAULT; + ap_accept_lock_mech = APR_LOCK_DEFAULT; } #if APR_HAS_FLOCK_SERIALIZE else if (!strcasecmp(arg, "flock")) { - accept_lock_mech = APR_LOCK_FLOCK; + ap_accept_lock_mech = APR_LOCK_FLOCK; } #endif #if APR_HAS_FCNTL_SERIALIZE else if (!strcasecmp(arg, "fcntl")) { - accept_lock_mech = APR_LOCK_FCNTL; + ap_accept_lock_mech = APR_LOCK_FCNTL; } #endif #if APR_HAS_SYSVSEM_SERIALIZE else if (!strcasecmp(arg, "sysvsem")) { - accept_lock_mech = APR_LOCK_SYSVSEM; + ap_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; + ap_accept_lock_mech = APR_LOCK_PROC_PTHREAD; } #endif else { -- 2.50.1