diff options
author | Stefan Fritsch <sf@apache.org> | 2010-08-21 20:06:41 +0200 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2010-08-21 20:06:41 +0200 |
commit | 8f840cb763aa67f331cecc4e5e850bb07d2a9943 (patch) | |
tree | f849def8fc48e41a7b682b7da935607eb94f15dd /server | |
parent | follow up r987629 with another similar issue (diff) | |
download | apache2-8f840cb763aa67f331cecc4e5e850bb07d2a9943.tar.xz apache2-8f840cb763aa67f331cecc4e5e850bb07d2a9943.zip |
core: Abort with sensible error message if no or more than one MPM is
loaded.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987806 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/config.c | 8 | ||||
-rw-r--r-- | server/mpm_common.c | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/server/config.c b/server/config.c index b58f096939..ea54280ea4 100644 --- a/server/config.c +++ b/server/config.c @@ -49,6 +49,7 @@ #include "http_main.h" #include "http_vhost.h" #include "util_cfgtree.h" +#include "mpm_common.h" #define APLOG_UNSET (APLOG_NO_MODULE - 1) APLOG_USE_MODULE(core); @@ -2242,6 +2243,13 @@ AP_DECLARE(server_rec*) ap_read_config(process_rec *process, apr_pool_t *ptemp, return NULL; } + error = ap_check_mpm(); + if (error) { + ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, 0, NULL, + "%s: Configuration error: %s", ap_server_argv0, error); + return NULL; + } + /* * We have loaded the dynamic modules. From now on we know exactly how * long the config vectors need to be. diff --git a/server/mpm_common.c b/server/mpm_common.c index 56bc70c875..e45a089447 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -375,3 +375,13 @@ AP_DECLARE(const char *)ap_show_mpm(void) return name; } + +AP_DECLARE(const char *)ap_check_mpm(void) +{ + if (!_hooks.link_mpm || _hooks.link_mpm->nelts == 0) + return "No MPM loaded."; + else if (_hooks.link_mpm->nelts > 1) + return "More than one MPM loaded."; + else + return NULL; +} |