From: Jim Jagielski Date: Wed, 20 Mar 2002 22:19:11 +0000 (+0000) Subject: Fold the compiled-in knowledge of the allowable AcceptMutex settings into X-Git-Tag: 2.0.34~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=730e99e4613f148f584df761e83bc35e4d96cc2a;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/include/mpm_common.h b/include/mpm_common.h index 6784328fb2a..4afffaf6f5e 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 18f54c0db4b..863b571b580 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 94a3d0a0776..0cd86448595 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 c1204b65a3b..b4689488611 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 952880b5dc3..a84d0801c89 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 94a3d0a0776..0cd86448595 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 81fc5760770..f48176d0e83 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 826278c0a71..0c330bfa061 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 1053f0bb7a2..f728464ea00 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; }