summaryrefslogtreecommitdiffstats
path: root/server/scoreboard.c
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2015-03-23 09:07:18 +0100
committerYann Ylavic <ylavic@apache.org>2015-03-23 09:07:18 +0100
commit9a5dd3df942f80393aa3efca9fe701a638db6d12 (patch)
tree628f35a18516852266781eb28299f86d770dc3b8 /server/scoreboard.c
parentRebuild. (diff)
downloadapache2-9a5dd3df942f80393aa3efca9fe701a638db6d12.tar.xz
apache2-9a5dd3df942f80393aa3efca9fe701a638db6d12.zip
core: Initialize scoreboard's used optional functions on graceful restarts to
avoid a crash when relocation occurs. PR 57177. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1668532 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/scoreboard.c')
-rw-r--r--server/scoreboard.c9
1 files changed, 5 insertions, 4 deletions
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,