diff options
Diffstat (limited to 'server/scoreboard.c')
| -rw-r--r-- | server/scoreboard.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/scoreboard.c b/server/scoreboard.c index 0f657131..060de5ca 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -118,8 +118,7 @@ void ap_init_scoreboard(void *shared_score) ap_calc_scoreboard_size(); ap_scoreboard_image = - calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *) + - server_limit * lb_limit * sizeof(lb_score *)); + calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *)); more_storage = shared_score; ap_scoreboard_image->global = (global_score *)more_storage; more_storage += sizeof(global_score); @@ -344,6 +343,9 @@ AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sb, request_rec *r) { worker_score *ws; + if (!sb) + return; + ws = &ap_scoreboard_image->servers[sb->child_num][sb->thread_num]; #ifdef HAVE_TIMES @@ -471,6 +473,9 @@ AP_DECLARE(int) ap_update_child_status_from_indexes(int child_num, AP_DECLARE(int) ap_update_child_status(ap_sb_handle_t *sbh, int status, request_rec *r) { + if (!sbh) + return -1; + return ap_update_child_status_from_indexes(sbh->child_num, sbh->thread_num, status, r); } @@ -479,6 +484,9 @@ void ap_time_process_request(ap_sb_handle_t *sbh, int status) { worker_score *ws; + if (!sbh) + return; + if (sbh->child_num < 0) { return; } |
