]> granicus.if.org Git - apache/commitdiff
fix segfault when not identifying mpm module, added detection for winnt, simeple...
authorStefan Eissing <icing@apache.org>
Wed, 17 Feb 2016 09:04:12 +0000 (09:04 +0000)
committerStefan Eissing <icing@apache.org>
Wed, 17 Feb 2016 09:04:12 +0000 (09:04 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730798 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_conn.c
modules/http2/h2_conn.h
modules/http2/mod_http2.c

index daeeb515008bb7c989f4f9cffd6aaecd472268cf..34bc14c15e0417ed23dff47c860110ae54de2643 100644 (file)
@@ -60,8 +60,13 @@ static void check_modules(int force)
                 mpm_module = m;
                 break;
             }
-            else if (!strcmp("worker.c", m->name)) {
-                mpm_type = H2_MPM_WORKER;
+            else if (!strcmp("motorz.c", m->name)) {
+                mpm_type = H2_MPM_MOTORZ;
+                mpm_module = m;
+                break;
+            }
+            else if (!strcmp("mpm_netware.c", m->name)) {
+                mpm_type = H2_MPM_NETWARE;
                 mpm_module = m;
                 break;
             }
@@ -70,6 +75,21 @@ static void check_modules(int force)
                 mpm_module = m;
                 break;
             }
+            else if (!strcmp("simple_api.c", m->name)) {
+                mpm_type = H2_MPM_SIMPLE;
+                mpm_module = m;
+                break;
+            }
+            else if (!strcmp("mpm_winnt.c", m->name)) {
+                mpm_type = H2_MPM_WINNT;
+                mpm_module = m;
+                break;
+            }
+            else if (!strcmp("worker.c", m->name)) {
+                mpm_type = H2_MPM_WORKER;
+                mpm_module = m;
+                break;
+            }
         }
         checked = 1;
     }
@@ -260,8 +280,10 @@ conn_rec *h2_slave_create(conn_rec *master, apr_pool_t *p,
     c->sbh                    = master->sbh;
     
     ap_set_module_config(c->conn_config, &core_module, socket);
-    cfg = ap_get_module_config(master->conn_config, h2_conn_mpm_module());
-    ap_set_module_config(c->conn_config, h2_conn_mpm_module(), cfg);
+    if (h2_conn_mpm_module()) {
+        cfg = ap_get_module_config(master->conn_config, h2_conn_mpm_module());
+        ap_set_module_config(c->conn_config, h2_conn_mpm_module(), cfg);
+    }
 
     return c;
 }
index f577625e0e7dbd9428a80939ab69aa8c98191b86..0ffcf3b08d84d337fb852e7387d86ef8b9ac9f44 100644 (file)
@@ -56,6 +56,10 @@ typedef enum {
     H2_MPM_WORKER,
     H2_MPM_EVENT,
     H2_MPM_PREFORK,
+    H2_MPM_MOTORZ,
+    H2_MPM_SIMPLE,
+    H2_MPM_NETWARE,
+    H2_MPM_WINNT,
 } h2_mpm_type_t;
 
 /* Returns the type of MPM module detected */
index 097a372096a51670a3f55f29c5c72a9942233d31..49de804bb6f7b1bb42af7cff3b2cf813e3b44e4e 100644 (file)
@@ -93,6 +93,12 @@ static int h2_post_config(apr_pool_t *p, apr_pool_t *plog,
                  MOD_HTTP2_VERSION, ngh2? ngh2->version_str : "unknown");
     
     switch (h2_conn_mpm_type()) {
+        case H2_MPM_SIMPLE:
+        case H2_MPM_MOTORZ:
+        case H2_MPM_NETWARE:
+        case H2_MPM_WINNT:
+            /* not sure we need something extra for those. */
+            break;
         case H2_MPM_EVENT:
         case H2_MPM_WORKER:
             /* all fine, we know these ones */