From ae5d91b5758a352f113da1ce53ebbb0603a40317 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Wed, 20 Mar 2002 22:19:11 +0000 Subject: [PATCH] Fold the compiled-in knowledge of the allowable AcceptMutex settings into its help entry. Requires the use of a extern string rather than a function call for the initialization to be valid in the macro (Thx to Jeff!). In the meantime, bump down the error logging until we deal with true default and configured setting information ala 1.3. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94062 13f79535-47bb-0310-9956-ffa450edef68 --- include/mpm_common.h | 2 +- server/core.c | 2 +- server/mpm/experimental/perchild/perchild.c | 4 ++-- server/mpm/mpmt_os2/mpmt_os2.c | 4 ++-- server/mpm/netware/mpm_netware.c | 4 ++-- server/mpm/perchild/perchild.c | 4 ++-- server/mpm/prefork/prefork.c | 4 ++-- server/mpm/worker/worker.c | 4 ++-- server/mpm_common.c | 19 ++++++++----------- 9 files changed, 22 insertions(+), 25 deletions(-) diff --git a/include/mpm_common.h b/include/mpm_common.h index 6784328fb2..4afffaf6f5 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -259,7 +259,7 @@ const char *ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy, */ #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH extern apr_lockmech_e ap_accept_lock_mech; -const char *ap_mpm_show_accept_lock_mech(void); +extern const char ap_valid_accept_mutex_string[]; const char *ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy, const char *arg); #endif diff --git a/server/core.c b/server/core.c index 18f54c0db4..863b571b58 100644 --- a/server/core.c +++ b/server/core.c @@ -3003,7 +3003,7 @@ AP_INIT_TAKE1("CoreDumpDirectory", ap_mpm_set_coredumpdir, NULL, RSRC_CONF, \ #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"), + ap_valid_accept_mutex_string), #endif { NULL } }; diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c index 94a3d0a077..0cd8644859 100644 --- a/server/mpm/experimental/perchild/perchild.c +++ b/server/mpm/experimental/perchild/perchild.c @@ -1339,8 +1339,8 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, ap_server_conf, "Server built: %s", ap_get_server_built()); #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, - "AcceptMutex: %s", ap_mpm_show_accept_lock_mech()); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, ap_server_conf, + "AcceptMutex: %s", ap_valid_accept_mutex_string); #endif restart_pending = shutdown_pending = 0; diff --git a/server/mpm/mpmt_os2/mpmt_os2.c b/server/mpm/mpmt_os2/mpmt_os2.c index c1204b65a3..b468948861 100644 --- a/server/mpm/mpmt_os2/mpmt_os2.c +++ b/server/mpm/mpmt_os2/mpmt_os2.c @@ -314,8 +314,8 @@ static char master_main() ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, ap_server_conf, "Server built: %s", ap_get_server_built()); #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, - "AcceptMutex: %s", ap_mpm_show_accept_lock_mech()); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, ap_server_conf, + "AcceptMutex: %s", ap_valid_accept_mutex_string); #endif if (one_process) { ap_scoreboard_image->parent[0].pid = getpid(); diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index 952880b5dc..a84d0801c8 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -918,8 +918,8 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, ap_server_conf, "Server built: %s", ap_get_server_built()); #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, - "AcceptMutex: %s", ap_mpm_show_accept_lock_mech()); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, ap_server_conf, + "AcceptMutex: %s", ap_valid_accept_mutex_string); #endif show_server_data(); diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c index 94a3d0a077..0cd8644859 100644 --- a/server/mpm/perchild/perchild.c +++ b/server/mpm/perchild/perchild.c @@ -1339,8 +1339,8 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, ap_server_conf, "Server built: %s", ap_get_server_built()); #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, - "AcceptMutex: %s", ap_mpm_show_accept_lock_mech()); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, ap_server_conf, + "AcceptMutex: %s", ap_valid_accept_mutex_string); #endif restart_pending = shutdown_pending = 0; diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 81fc576077..f48176d0e8 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -1025,8 +1025,8 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, ap_server_conf, "Server built: %s", ap_get_server_built()); #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, - "AcceptMutex: %s", ap_mpm_show_accept_lock_mech()); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, ap_server_conf, + "AcceptMutex: %s", ap_valid_accept_mutex_string); #endif restart_pending = shutdown_pending = 0; diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 826278c0a7..0c330bfa06 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -1557,8 +1557,8 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, ap_server_conf, "Server built: %s", ap_get_server_built()); #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf, - "AcceptMutex: %s", ap_mpm_show_accept_lock_mech()); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, ap_server_conf, + "AcceptMutex: %s", ap_valid_accept_mutex_string); #endif restart_pending = shutdown_pending = 0; diff --git a/server/mpm_common.c b/server/mpm_common.c index 1053f0bb7a..f728464ea0 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -662,24 +662,21 @@ const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy, #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH apr_lockmech_e ap_accept_lock_mech = APR_LOCK_DEFAULT; -AP_DECLARE(const char *) ap_mpm_show_accept_lock_mech(void) -{ - - return ("Valid accept mutexes for this platform and MPM are: default" +const char ap_valid_accept_mutex_string[] = + "Valid accept mutexes for this platform and MPM are: default" #if APR_HAS_FLOCK_SERIALIZE - ", flock" + ", flock" #endif #if APR_HAS_FCNTL_SERIALIZE - ", fcntl" + ", fcntl" #endif #if APR_HAS_SYSVSEM_SERIALIZE && !defined(PERCHILD_MPM) - ", sysvsem" + ", sysvsem" #endif #if APR_HAS_PROC_PTHREAD_SERIALIZE - ", pthread" + ", pthread" #endif - "."); -} + "."; AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy, @@ -721,7 +718,7 @@ AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd, #endif else { return apr_pstrcat(cmd->pool, arg, " is an invalid mutex mechanism; ", - ap_mpm_show_accept_lock_mech(), NULL); + ap_valid_accept_mutex_string, NULL); } return NULL; } -- 2.50.1