Changes with Apache 2.3.8
+ *) core: Abort with sensible error message if no or more than one MPM is
+ loaded. [Stefan Fritsch]
+
*) mod_proxy: Rename erroronstatus to failonstatus.
[Daniel Ruggeri <DRuggeri primary.net>]
* 20100723.1 (2.3.7-dev) Added ap_proxy_hashfunc() and hash elements to
* proxy worker structs
* 20100723.2 (2.3.7-dev) Add ap_request_has_body()
+ * 20100723.3 (2.3.8-dev) Add ap_check_mpm()
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20100723
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 3 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
*/
AP_DECLARE(void) ap_mpm_pod_killpg(ap_pod_t *pod, int num);
+/**
+ * Check that exactly one MPM is loaded
+ * Returns NULL if yes, error string if not.
+ */
+AP_DECLARE(const char *) ap_check_mpm(void);
+
/*
* These data members are common to all mpms. Each new mpm
* should either use the appropriate ap_mpm_set_* function
#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);
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.
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;
+}