From: Ryan Bloom Date: Tue, 10 Jul 2001 19:00:03 +0000 (+0000) Subject: Add two functions to allow modules to access random parts of the X-Git-Tag: 2.0.21~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2843b8672ef523042d219f779611728fb0d1d253;p=apache Add two functions to allow modules to access random parts of the scoreboard. This allows modules compiled for one MPM to access the scoreboard, even if it the server was compiled for another MPM. Submitted by: Harrie Hazewinkel git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89532 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 1590153e92..018b334032 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0.21-dev + *) Add two functions to allow modules to access random parts of the + scoreboard. This allows modules compiled for one MPM to access the + scoreboard, even if it the server was compiled for another MPM. + [Harrie Hazewinkel ] + Changes with Apache 2.0.20 *) Fix problem in content-length filter where the filter would diff --git a/include/scoreboard.h b/include/scoreboard.h index 48f45aaf6d..f36ec5ee8c 100644 --- a/include/scoreboard.h +++ b/include/scoreboard.h @@ -216,7 +216,8 @@ void update_scoreboard_global(void); AP_DECLARE(int) find_child_by_pid(apr_proc_t *pid); int ap_update_child_status(int child_num, int thread_num, int status, request_rec *r); void ap_time_process_request(int child_num, int thread_num, int status); - +worker_score *ap_get_servers_scoreboard(int x, int y); +process_score *ap_get_parent_scoreboard(int x); AP_DECLARE_DATA extern scoreboard *ap_scoreboard_image; AP_DECLARE_DATA extern const char *ap_scoreboard_fname; diff --git a/server/scoreboard.c b/server/scoreboard.c index 265bf23a90..a6237f9235 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -340,3 +340,20 @@ void ap_time_process_request(int child_num, int thread_num, int status) put_scoreboard_info(child_num, thread_num, ws); } +worker_score *ap_get_servers_scoreboard(int x, int y) +{ + if (((x < 0) || (HARD_SERVER_LIMIT < x)) || + ((y < 0) || (HARD_THREAD_LIMIT < y))) { + return(NULL); /* Out of range */ + } + return(&ap_scoreboard_image->servers[x][y]); +} + +process_score *ap_get_parent_scoreboard(int x) +{ + if ((x < 0) || (HARD_SERVER_LIMIT < x)) { + return(NULL); /* Out of range */ + } + return(&ap_scoreboard_image->parent[x]); +} +