]> granicus.if.org Git - apache/commitdiff
version bump, cleanup of module mpm tests by CJ applied
authorStefan Eissing <icing@apache.org>
Fri, 18 Dec 2015 16:00:38 +0000 (16:00 +0000)
committerStefan Eissing <icing@apache.org>
Fri, 18 Dec 2015 16:00:38 +0000 (16:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1720818 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_conn.c
modules/http2/h2_version.h

index e9ed9a8468edb5d8d2a32517788b54409ab016e3..5c766e84ec5e8be90c90673ea1afe18ef4c2c985 100644 (file)
@@ -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;
 }
 
index 6e338f362a99b260b6e31a770a4bf0f5652ae7a7..b85d43618daa2a12dd0520fb97c18fb6a8e2775f 100644 (file)
@@ -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 */