summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/core.c7
-rw-r--r--server/scoreboard.c9
2 files changed, 12 insertions, 4 deletions
diff --git a/server/core.c b/server/core.c
index 7928bbc98d..e3aa970c64 100644
--- a/server/core.c
+++ b/server/core.c
@@ -5063,6 +5063,11 @@ static void core_child_init(apr_pool_t *pchild, server_rec *s)
apr_random_after_fork(&proc);
}
+static void core_optional_fn_retrieve(void)
+{
+ ap_init_scoreboard(NULL);
+}
+
AP_CORE_DECLARE(void) ap_random_parent_after_fork(void)
{
/*
@@ -5242,6 +5247,8 @@ static void register_hooks(apr_pool_t *p)
APR_HOOK_REALLY_LAST);
ap_hook_dirwalk_stat(core_dirwalk_stat, NULL, NULL, APR_HOOK_REALLY_LAST);
ap_hook_open_htaccess(ap_open_htaccess, NULL, NULL, APR_HOOK_REALLY_LAST);
+ ap_hook_optional_fn_retrieve(core_optional_fn_retrieve, NULL, NULL,
+ APR_HOOK_MIDDLE);
/* register the core's insert_filter hook and register core-provided
* filters
diff --git a/server/scoreboard.c b/server/scoreboard.c
index f6bbe820dd..c7501d9fda 100644
--- a/server/scoreboard.c
+++ b/server/scoreboard.c
@@ -138,8 +138,6 @@ AP_DECLARE(int) ap_calc_scoreboard_size(void)
scoreboard_size += sizeof(process_score) * server_limit;
scoreboard_size += sizeof(worker_score) * server_limit * thread_limit;
- pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
-
return scoreboard_size;
}
@@ -148,6 +146,11 @@ AP_DECLARE(void) ap_init_scoreboard(void *shared_score)
char *more_storage;
int i;
+ pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
+ if (!shared_score) {
+ return;
+ }
+
ap_calc_scoreboard_size();
ap_scoreboard_image =
ap_calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *));
@@ -299,8 +302,6 @@ int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type)
apr_status_t rv;
#endif
- pfn_ap_logio_get_last_bytes = APR_RETRIEVE_OPTIONAL_FN(ap_logio_get_last_bytes);
-
if (ap_scoreboard_image) {
ap_scoreboard_image->global->restart_time = apr_time_now();
memset(ap_scoreboard_image->parent, 0,