You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2016/02/17 10:04:12 UTC

svn commit: r1730798 - in /httpd/httpd/trunk/modules/http2: h2_conn.c h2_conn.h mod_http2.c

Author: icing
Date: Wed Feb 17 09:04:12 2016
New Revision: 1730798

URL: http://svn.apache.org/viewvc?rev=1730798&view=rev
Log:
fix segfault when not identifying mpm module, added detection for winnt, simeple, motorz and netware

Modified:
    httpd/httpd/trunk/modules/http2/h2_conn.c
    httpd/httpd/trunk/modules/http2/h2_conn.h
    httpd/httpd/trunk/modules/http2/mod_http2.c

Modified: httpd/httpd/trunk/modules/http2/h2_conn.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_conn.c?rev=1730798&r1=1730797&r2=1730798&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_conn.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_conn.c Wed Feb 17 09:04:12 2016
@@ -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 *mast
     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;
 }

Modified: httpd/httpd/trunk/modules/http2/h2_conn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_conn.h?rev=1730798&r1=1730797&r2=1730798&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_conn.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_conn.h Wed Feb 17 09:04:12 2016
@@ -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 */

Modified: httpd/httpd/trunk/modules/http2/mod_http2.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/mod_http2.c?rev=1730798&r1=1730797&r2=1730798&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/mod_http2.c (original)
+++ httpd/httpd/trunk/modules/http2/mod_http2.c Wed Feb 17 09:04:12 2016
@@ -93,6 +93,12 @@ static int h2_post_config(apr_pool_t *p,
                  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 */