]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_status: PR60647: ACC per connection not available w/ event MPM
authorGraham Leggett <minfrin@apache.org>
Mon, 27 May 2019 12:31:24 +0000 (12:31 +0000)
committerGraham Leggett <minfrin@apache.org>
Mon, 27 May 2019 12:31:24 +0000 (12:31 +0000)
trunk patch: http://svn.apache.org/r1780280
2.4.x patch: svn merge -c 1780280 ^/httpd/httpd/trunk .
              (minus CHANGES and ap_mmn.h)
+1: jailletc36, jim, rjung

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1860128 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
include/ap_mmn.h
include/scoreboard.h
modules/http/http_core.c
server/scoreboard.c

diff --git a/CHANGES b/CHANGES
index 64f018e7582697a401777670d633b6b584360d3c..e4b8d7ec910a6f5c74a5c50841caebef675bf003 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.40
 
+  *) When using mod_status with the Event MPM, report the number of requests
+     associated with an active connection in the "ACC" field. Previously
+     zero was always reported with this MPM.  PR60647. [Eric Covener]
+
   *) mod_http2: remove the no longer existing h2_ngn_shed.c from Cmake.
      [Stefan Eissing]
 
diff --git a/STATUS b/STATUS
index 23417649a36569e43e793942a0500e103f14cf28..8223422be6c624501254f0f5905dea1f33c6a29e 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -127,12 +127,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_status: PR60647: ACC per connection not available w/ event MPM
-     trunk patch: http://svn.apache.org/r1780280
-     2.4.x patch: svn merge -c 1780280 ^/httpd/httpd/trunk .
-                  (minus CHANGES and ap_mmn.h)
-     +1: jailletc36, jim, rjung
-
   *) Easy patches: synch 2.4.x and trunk
         - core: 80 chars
         - http_core: Clean-uo and style. No functional change overall
index 4739f7f64d3310b28827c3653e661115cea456e6..536eb65b6c77d1126279242a507ed8fd282837ea 100644 (file)
  * 20120211.83 (2.4.35-dev) Add client64 field to worker_score struct
  * 20120211.84 (2.4.35-dev) Add ap_no2slash_ex() and merge_slashes to 
  *                          core_server_conf.
+ * 20120211.85 (2.4.40-dev) add ap_set_conn_count().
  *
  */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20120211
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 84                  /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 85                  /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
index 92d198d6de1ff8b06b5518a98e4fabc0f1f61fc2..fe39d44eb4e48f9e16fc338d64bf54f587faf8fa 100644 (file)
@@ -176,6 +176,7 @@ apr_status_t ap_cleanup_scoreboard(void *d);
  */
 AP_DECLARE(int) ap_exists_scoreboard_image(void);
 AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sbh, request_rec *r);
+AP_DECLARE(void) ap_set_conn_count(ap_sb_handle_t *sb, request_rec *r, unsigned short conn_count);
 
 AP_DECLARE(apr_status_t) ap_reopen_scoreboard(apr_pool_t *p, apr_shm_t **shm, int detached);
 AP_DECLARE(void) ap_init_scoreboard(void *shared_score);
index 35869b45b3f8369a4d5e1d2127725e2f5040fc8c..31d7a389db9a8d4aa41e47bd43e2520e5319483a 100644 (file)
@@ -142,7 +142,7 @@ static int ap_process_http_async_connection(conn_rec *c)
 
     while (cs->state == CONN_STATE_READ_REQUEST_LINE) {
         ap_update_child_status_from_conn(c->sbh, SERVER_BUSY_READ, c);
-
+        if (ap_extended_status) ap_set_conn_count(c->sbh, r, c->keepalives);
         if ((r = ap_read_request(c))) {
 
             c->keepalive = AP_CONN_UNKNOWN;
@@ -150,6 +150,7 @@ static int ap_process_http_async_connection(conn_rec *c)
 
             if (r->status == HTTP_OK) {
                 cs->state = CONN_STATE_HANDLER;
+                if (ap_extended_status) ap_set_conn_count(c->sbh, r, c->keepalives+1);
                 ap_update_child_status(c->sbh, SERVER_BUSY_WRITE, r);
                 ap_process_async_request(r);
                 /* After the call to ap_process_request, the
index 23e3d7022ffb92a80bc092d459236ff651426cf8..4ac862a94eb74fcb9018c1fa34a706e1a27a32be 100644 (file)
@@ -364,6 +364,17 @@ AP_DECLARE(int) ap_exists_scoreboard_image(void)
     return (ap_scoreboard_image ? 1 : 0);
 }
 
+AP_DECLARE(void) ap_set_conn_count(ap_sb_handle_t *sb, request_rec *r, unsigned short conn_count)
+{
+    worker_score *ws;
+
+    if (!sb)
+        return;
+
+    ws = &ap_scoreboard_image->servers[sb->child_num][sb->thread_num];
+    ws->conn_count = conn_count;
+}
+
 AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sb, request_rec *r)
 {
     worker_score *ws;