From f75745f9953487ded9895df791592296c846b494 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 24 Oct 2007 03:50:24 +0000 Subject: [PATCH] MMN major bump required; this API is altogether inconsistent, transparent types should be opaque, opaque types should be transparent. Solve one aspect, follow the _by_indexes() example for ap_get_scoreboard_worker family of functions, and the primary one will now accept the abstracted conn_rec value of sbh to find that connections slot. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@587770 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ include/ap_mmn.h | 7 ++++--- include/scoreboard.h | 4 +++- modules/generators/mod_status.c | 4 ++-- server/scoreboard.c | 12 +++++++++--- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 9060a512e0..ffaf348fb8 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) core; scoreboard: ap_get_scoreboard_worker(sbh) now takes the sbh member + from the connection rec, ap_get_scoreboard_worker(proc, thread) will now + provide the unusual legacy lookup. Also cleans up PR 31127 range checks. + [William Rowe, Christian von Roques ] + *) mod_proxy_http: Check but don't escape/unescape forward-proxied URLs PR 42592 [Nick Kew] diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 79ffc7a7e3..d1c86c5b06 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -133,15 +133,16 @@ * 20070823.0 (2.3.0-dev) Removed ap_all_available_mutexes_string, * ap_available_mutexes_string for macros * 20070823.1 (2.3.0-dev) add ap_send_interim_response() - * + * 20071023.0 (2.3.0-dev) add ap_get_scoreboard(sbh) split from the less + * conventional ap_get_scoreboard(proc, thread) */ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */ #ifndef MODULE_MAGIC_NUMBER_MAJOR -#define MODULE_MAGIC_NUMBER_MAJOR 20070823 +#define MODULE_MAGIC_NUMBER_MAJOR 20071023 #endif -#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/scoreboard.h b/include/scoreboard.h index a9729ddea2..53f62f2681 100644 --- a/include/scoreboard.h +++ b/include/scoreboard.h @@ -178,7 +178,9 @@ AP_DECLARE(int) ap_update_child_status_from_indexes(int child_num, int thread_nu int status, request_rec *r); void ap_time_process_request(ap_sb_handle_t *sbh, int status); -AP_DECLARE(worker_score *) ap_get_scoreboard_worker(int x, int y); +AP_DECLARE(worker_score *) ap_get_scoreboard_worker(ap_sb_handle_t *sbh); +AP_DECLARE(worker_score *) ap_get_scoreboard_worker_from_indexes(int child_num, + int thread_num); AP_DECLARE(process_score *) ap_get_scoreboard_process(int x); AP_DECLARE(global_score *) ap_get_scoreboard_global(void); AP_DECLARE(lb_score *) ap_get_scoreboard_lb(int lb_num); diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 9a550adc11..8e357c9845 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -319,7 +319,7 @@ static int status_handler(request_rec *r) for (j = 0; j < thread_limit; ++j) { int indx = (i * thread_limit) + j; - ws_record = ap_get_scoreboard_worker(i, j); + ws_record = ap_get_scoreboard_worker_from_indexes(i, j); res = ws_record->status; stat_buffer[indx] = status_flags[res]; @@ -558,7 +558,7 @@ static int status_handler(request_rec *r) for (i = 0; i < server_limit; ++i) { for (j = 0; j < thread_limit; ++j) { - ws_record = ap_get_scoreboard_worker(i, j); + ws_record = ap_get_scoreboard_worker_from_indexes(i, j); if (ws_record->access_count == 0 && (ws_record->status == SERVER_READY || diff --git a/server/scoreboard.c b/server/scoreboard.c index d35eac0044..3ad995fcf0 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -475,15 +475,21 @@ void ap_time_process_request(ap_sb_handle_t *sbh, int status) } } -AP_DECLARE(worker_score *) ap_get_scoreboard_worker(int x, int y) +AP_DECLARE(worker_score *) ap_get_scoreboard_worker_from_indexes(int x, int y) { - if (((x < 0) || (x >= server_limit)) || - ((y < 0) || (y >= thread_limit))) { + if (((x < 0) || (x > server_limit)) || + ((y < 0) || (y > thread_limit))) { return(NULL); /* Out of range */ } return &ap_scoreboard_image->servers[x][y]; } +AP_DECLARE(worker_score *) ap_get_scoreboard_worker(ap_sb_handle_t *sbh) +{ + return ap_get_scoreboard_worker_from_indexes(sbh->child_num, + sbh->thread_num); +} + AP_DECLARE(process_score *) ap_get_scoreboard_process(int x) { if ((x < 0) || (x >= server_limit)) { -- 2.50.1