You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2011/04/06 16:49:45 UTC

svn commit: r1089472 - in /httpd/httpd/trunk: CHANGES server/mpm_common.c

Author: trawick
Date: Wed Apr  6 14:49:45 2011
New Revision: 1089472

URL: http://svn.apache.org/viewvc?rev=1089472&view=rev
Log:
Abort if the MPM is changed across restart.

A new MPM can't be expected to manage the existing state,
particularly if that includes processes from the previous
generation.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/mpm_common.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1089472&r1=1089471&r2=1089472&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Apr  6 14:49:45 2011
@@ -2,6 +2,8 @@
 
 Changes with Apache 2.3.12
 
+  *) core: Abort if the MPM is changed across restart.  [Jeff Trawick]
+
   *) mod_proxy_ajp: Add support for 'ProxyErrorOverride on'. PR 50945.
      [Peter Pramberger <peter pramberger.at>, Jim Jagielski]
 

Modified: httpd/httpd/trunk/server/mpm_common.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_common.c?rev=1089472&r1=1089471&r2=1089472&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_common.c (original)
+++ httpd/httpd/trunk/server/mpm_common.c Wed Apr  6 14:49:45 2011
@@ -386,10 +386,21 @@ AP_DECLARE(const char *)ap_show_mpm(void
 
 AP_DECLARE(const char *)ap_check_mpm(void)
 {
+    static const char *last_mpm_name = NULL;
+
     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;
+
+    if (last_mpm_name) {
+        if (strcmp(last_mpm_name, ap_show_mpm())) {
+            return "The MPM cannot be changed during restart.";
+        }
+    }
+    else {
+        last_mpm_name = apr_pstrdup(ap_pglobal, ap_show_mpm());
+    }
+
+    return NULL;
 }