]> granicus.if.org Git - apache/commitdiff
MMN major bump required; this API is altogether inconsistent, transparent
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 24 Oct 2007 03:50:24 +0000 (03:50 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 24 Oct 2007 03:50:24 +0000 (03:50 +0000)
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
include/ap_mmn.h
include/scoreboard.h
modules/generators/mod_status.c
server/scoreboard.c

diff --git a/CHANGES b/CHANGES
index 9060a512e0bd84af9a49fd4973652f84a02e39ea..ffaf348fb8513cd77b282a4f3854c02f85ef2b17 100644 (file)
--- 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 <roques mti.ag>]
+
   *) mod_proxy_http: Check but don't escape/unescape forward-proxied URLs
      PR 42592 [Nick Kew]
 
index 79ffc7a7e3f0cb73ea32e842186b07a83f0937b1..d1c86c5b067b1dfedad0024d8f9e90b22c0a74a3 100644 (file)
  * 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
index a9729ddea21c672eee45b8814cda03056a106b38..53f62f26813ff122487c8c9988b77713c6648e0c 100644 (file)
@@ -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);
index 9a550adc11a297eb15a80cbfef028653928d091a..8e357c9845deea4d90a32b22e6700d3830569bbe 100644 (file)
@@ -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 ||
index d35eac0044cb87f01ba75a4e687114ffdbb85279..3ad995fcf0f8895a8dc33f4f69b6499780701429 100644 (file)
@@ -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)) {