Blame SOURCES/httpd-2.4.6-r1668532.patch

b19d6e
diff --git a/server/scoreboard.c b/server/scoreboard.c
b19d6e
index a2e5daf..f989b99 100644
b19d6e
--- a/server/scoreboard.c
b19d6e
+++ b/server/scoreboard.c
b19d6e
@@ -138,8 +138,6 @@ AP_DECLARE(int) ap_calc_scoreboard_size(void)
b19d6e
     scoreboard_size += sizeof(process_score) * server_limit;
b19d6e
     scoreboard_size += sizeof(worker_score) * server_limit * thread_limit;
b19d6e
 
b19d6e
-    pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
b19d6e
-
b19d6e
     return scoreboard_size;
b19d6e
 }
b19d6e
 
b19d6e
@@ -148,6 +146,11 @@ AP_DECLARE(void) ap_init_scoreboard(void *shared_score)
b19d6e
     char *more_storage;
b19d6e
     int i;
b19d6e
 
b19d6e
+    pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
b19d6e
+    if (!shared_score) {
b19d6e
+        return;
b19d6e
+    }
b19d6e
+
b19d6e
     ap_calc_scoreboard_size();
b19d6e
     ap_scoreboard_image =
b19d6e
         ap_calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *));
b19d6e
@@ -299,8 +302,6 @@ int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
b19d6e
     apr_status_t rv;
b19d6e
 #endif
b19d6e
 
b19d6e
-    pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
b19d6e
-
b19d6e
     if (ap_scoreboard_image) {
b19d6e
         ap_scoreboard_image->global->restart_time = apr_time_now();
b19d6e
         memset(ap_scoreboard_image->parent, 0,
b19d6e
@@ -309,6 +310,7 @@ int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
b19d6e
             memset(ap_scoreboard_image->servers[i], 0,
b19d6e
                    sizeof(worker_score) * thread_limit);
b19d6e
         }
b19d6e
+        ap_init_scoreboard(NULL);
b19d6e
         return OK;
b19d6e
     }
b19d6e
 
b19d6e
diff --git a/server/core.c b/server/core.c
b19d6e
index c125015..eaa81a6 100644
b19d6e
--- a/server/core.c
b19d6e
+++ b/server/core.c
b19d6e
@@ -4843,6 +4843,11 @@ static void core_child_init(apr_pool_t *pchild, server_rec *s)
b19d6e
     apr_random_after_fork(&proc;;
b19d6e
 }
b19d6e
 
b19d6e
+static void core_optional_fn_retrieve(void)
b19d6e
+{
b19d6e
+    ap_init_scoreboard(NULL);
b19d6e
+}
b19d6e
+
b19d6e
 AP_CORE_DECLARE(void) ap_random_parent_after_fork(void)
b19d6e
 {
b19d6e
     /*
b19d6e
@@ -5022,6 +5027,8 @@ static void register_hooks(apr_pool_t *p)
b19d6e
                                   APR_HOOK_REALLY_LAST);
b19d6e
     ap_hook_dirwalk_stat(core_dirwalk_stat, NULL, NULL, APR_HOOK_REALLY_LAST);
b19d6e
     ap_hook_open_htaccess(ap_open_htaccess, NULL, NULL, APR_HOOK_REALLY_LAST);
b19d6e
+    ap_hook_optional_fn_retrieve(core_optional_fn_retrieve, NULL, NULL,
b19d6e
+                                 APR_HOOK_MIDDLE);
b19d6e
     
b19d6e
     /* register the core's insert_filter hook and register core-provided
b19d6e
      * filters