]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_md: make sure its post-config hook runs before mod_watchdog. if
authorStefan Eissing <icing@apache.org>
Thu, 22 Apr 2021 10:17:02 +0000 (10:17 +0000)
committerStefan Eissing <icing@apache.org>
Thu, 22 Apr 2021 10:17:02 +0000 (10:17 +0000)
  not, mod_watchdog thinks it has nothing to do, if no one else installs
  any watchdog instance.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1889101 13f79535-47bb-0310-9956-ffa450edef68

modules/md/mod_md.c

index 2263fdb29297db5558293e26b0c4148606180190..647b5ba2ee5c8506976d8c740a806015fb772789 100644 (file)
@@ -993,7 +993,10 @@ static apr_status_t md_post_config_after_ssl(apr_pool_t *p, apr_pool_t *plog,
         ap_log_error( APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(10075) "no mds to supervise");
     }
 
-    if (!mc->ocsp || md_ocsp_count(mc->ocsp) == 0) goto leave;
+    if (!mc->ocsp || md_ocsp_count(mc->ocsp) == 0) {
+        ap_log_error( APLOG_MARK, APLOG_TRACE1, 0, s, "no ocsp to manage");
+        goto leave;
+    }
 
     md_http_use_implementation(md_curl_get_impl(p));
     rv = md_ocsp_start_watching(mc, s, p);
@@ -1463,6 +1466,7 @@ static void md_child_init(apr_pool_t *pool, server_rec *s)
 static void md_hooks(apr_pool_t *pool)
 {
     static const char *const mod_ssl[] = { "mod_ssl.c", "mod_tls.c", NULL};
+    static const char *const mod_wd[] = { "mod_watchdog.c", NULL};
 
     /* Leave the ssl initialization to mod_ssl or friends. */
     md_acme_init(pool, AP_SERVER_BASEVERSION, 0);
@@ -1473,7 +1477,7 @@ static void md_hooks(apr_pool_t *pool)
      * Run again after mod_ssl is done.
      */
     ap_hook_post_config(md_post_config_before_ssl, NULL, mod_ssl, APR_HOOK_MIDDLE);
-    ap_hook_post_config(md_post_config_after_ssl, mod_ssl, NULL, APR_HOOK_LAST);
+    ap_hook_post_config(md_post_config_after_ssl, mod_ssl, mod_wd, APR_HOOK_LAST);
 
     /* Run once after a child process has been created.
      */
@@ -1497,7 +1501,7 @@ static void md_hooks(apr_pool_t *pool)
     ap_hook_ssl_add_cert_files(md_add_cert_files, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_ssl_add_fallback_cert_files(md_add_fallback_cert_files, NULL, NULL, APR_HOOK_MIDDLE);
 
-#if AP_MODULE_MAGIC_AT_LEAST(20201214, 4)
+#if AP_MODULE_MAGIC_AT_LEAST(20210420, 0)
     ap_hook_ssl_ocsp_prime_hook(md_ocsp_prime_status, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_ssl_ocsp_get_resp_hook(md_ocsp_provide_status, NULL, NULL, APR_HOOK_MIDDLE);
 #else