From 31f18189836089ad3e90e3573b823682eebc31bb Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 18 Dec 2015 16:00:38 +0000 Subject: [PATCH] version bump, cleanup of module mpm tests by CJ applied git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1720818 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http2/h2_conn.c | 38 +++++++++++++++----------------------- modules/http2/h2_version.h | 4 ++-- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/modules/http2/h2_conn.c b/modules/http2/h2_conn.c index e9ed9a8468..5c766e84ec 100644 --- a/modules/http2/h2_conn.c +++ b/modules/http2/h2_conn.c @@ -43,25 +43,30 @@ static struct h2_workers *workers; static h2_mpm_type_t mpm_type = H2_MPM_UNKNOWN; static module *mpm_module; -static int checked; -static void check_modules(void) +static void check_modules(int force) { + static int checked = 0; int i; - if (!checked) { + + if (force || !checked) { for (i = 0; ap_loaded_modules[i]; ++i) { module *m = ap_loaded_modules[i]; + if (!strcmp("event.c", m->name)) { mpm_type = H2_MPM_EVENT; mpm_module = m; + break; } else if (!strcmp("worker.c", m->name)) { mpm_type = H2_MPM_WORKER; mpm_module = m; + break; } else if (!strcmp("prefork.c", m->name)) { mpm_type = H2_MPM_PREFORK; mpm_module = m; + break; } } checked = 1; @@ -76,27 +81,12 @@ apr_status_t h2_conn_child_init(apr_pool_t *pool, server_rec *s) int maxw = h2_config_geti(config, H2_CONF_MAX_WORKERS); int max_threads_per_child = 0; int idle_secs = 0; - int i; h2_config_init(pool); ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads_per_child); - for (i = 0; ap_loaded_modules[i]; ++i) { - module *m = ap_loaded_modules[i]; - if (!strcmp("event.c", m->name)) { - mpm_type = H2_MPM_EVENT; - mpm_module = m; - } - else if (!strcmp("worker.c", m->name)) { - mpm_type = H2_MPM_WORKER; - mpm_module = m; - } - else if (!strcmp("prefork.c", m->name)) { - mpm_type = H2_MPM_PREFORK; - mpm_module = m; - } - } + check_modules(1); if (minw <= 0) { minw = max_threads_per_child; @@ -119,13 +109,15 @@ apr_status_t h2_conn_child_init(apr_pool_t *pool, server_rec *s) return status; } -h2_mpm_type_t h2_conn_mpm_type(void) { - check_modules(); +h2_mpm_type_t h2_conn_mpm_type(void) +{ + check_modules(0); return mpm_type; } -static module *h2_conn_mpm_module(void) { - check_modules(); +static module *h2_conn_mpm_module(void) +{ + check_modules(0); return mpm_module; } diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index 6e338f362a..b85d43618d 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -20,7 +20,7 @@ * @macro * Version number of the h2 module as c string */ -#define MOD_HTTP2_VERSION "1.0.12-DEVd" +#define MOD_HTTP2_VERSION "1.0.13-DEVa" /** * @macro @@ -28,7 +28,7 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define MOD_HTTP2_VERSION_NUM 0x01000c +#define MOD_HTTP2_VERSION_NUM 0x01000d #endif /* mod_h2_h2_version_h */ -- 2.40.0