From: Stefan Eissing Date: Wed, 17 Feb 2016 09:04:12 +0000 (+0000) Subject: fix segfault when not identifying mpm module, added detection for winnt, simeple... X-Git-Tag: 2.5.0-alpha~2055 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59e3a15e40e7ef091438a45a75d906d6e68a42d3;p=apache fix segfault when not identifying mpm module, added detection for winnt, simeple, motorz and netware git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1730798 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_conn.c b/modules/http2/h2_conn.c index daeeb51500..34bc14c15e 100644 --- a/modules/http2/h2_conn.c +++ b/modules/http2/h2_conn.c @@ -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; } diff --git a/modules/http2/h2_conn.h b/modules/http2/h2_conn.h index f577625e0e..0ffcf3b08d 100644 --- a/modules/http2/h2_conn.h +++ b/modules/http2/h2_conn.h @@ -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 */ diff --git a/modules/http2/mod_http2.c b/modules/http2/mod_http2.c index 097a372096..49de804bb6 100644 --- a/modules/http2/mod_http2.c +++ b/modules/http2/mod_http2.c @@ -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 */