altarch-user / rpms / httpd

Forked from rpms/httpd 2 years ago
Clone

Blame SOURCES/httpd-2.4.6-r1668532.patch

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