https://redmine.lighttpd.net/
https://redmine.lighttpd.net/favicon.ico?1366732741
2012-11-07T14:32:45Z
lighty labs
Lighttpd - Feature #2427: Connections Status
https://redmine.lighttpd.net/issues/2427?journal_id=7953
2012-11-07T14:32:45Z
stbuehler
<ul><li><strong>Target version</strong> changed from <i>1.4.32</i> to <i>1.4.x</i></li></ul>
Lighttpd - Feature #2427: Connections Status
https://redmine.lighttpd.net/issues/2427?journal_id=9213
2016-03-29T14:53:36Z
gstrauss
<ul><li><strong>Priority</strong> changed from <i>Normal</i> to <i>Low</i></li></ul><p>not a bad idea. is anyone else interested in this?</p>
Lighttpd - Feature #2427: Connections Status
https://redmine.lighttpd.net/issues/2427?journal_id=9330
2016-04-10T06:43:36Z
gstrauss
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Patch Pending</i></li><li><strong>Target version</strong> changed from <i>1.4.x</i> to <i>1.4.40</i></li></ul><p>This patch replaces the legend before the map of connection states with a combined count+legend table following the map of connection states. Maybe the map of connection states should be removed, but I have left it for now.</p>
<pre>
1 connections
h
0 k = keep-alive
0 . = connect
0 q = req-start
0 r = read
0 Q = req-end
0 R = readpost
1 h = handle-req
0 s = resp-start
0 W = write
0 S = resp-end
0 E = error
0 C = close
</pre>
<pre>
diff --git a/src/mod_status.c b/src/mod_status.c
index 8232628..a83fd9c 100644
--- a/src/mod_status.c
+++ b/src/mod_status.c
@@ -211,6 +211,10 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
int days, hours, mins, seconds;
+ /*(CON_STATE_CLOSE must be last state in enum connection_state_t)*/
+ int cstates[CON_STATE_CLOSE+3];
+ memset(cstates, 0, sizeof(cstates));
+
buffer_copy_string_len(b, CONST_STR_LEN(
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n"
@@ -436,13 +440,7 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
buffer_append_string_len(b, CONST_STR_LEN("</table>\n"));
-
- buffer_append_string_len(b, CONST_STR_LEN(
- "<hr />\n<pre><b>legend</b>\n"
- ". = connect, C = close, E = hard error, k = keep-alive\n"
- "r = read, R = read-POST, W = write, h = handle-request\n"
- "q = request-start, Q = request-end\n"
- "s = response-start, S = response-end\n"));
+ buffer_append_string_len(b, CONST_STR_LEN("<hr />\n<pre>\n"));
buffer_append_string_len(b, CONST_STR_LEN("<b>"));
buffer_append_int(b, srv->conns->used);
@@ -454,8 +452,10 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
if (CON_STATE_READ == c->state && !buffer_string_is_empty(c->request.orig_uri)) {
state = "k";
+ ++cstates[CON_STATE_CLOSE+2];
} else {
state = connection_get_short_state(c->state);
+ ++cstates[(c->state <= CON_STATE_CLOSE ? c->state : CON_STATE_CLOSE+1)];
}
buffer_append_string_len(b, state, 1);
@@ -464,6 +464,22 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
buffer_append_string_len(b, CONST_STR_LEN("\n"));
}
}
+ buffer_append_string_len(b, CONST_STR_LEN("\n\n<table>\n"));
+ buffer_append_string_len(b, CONST_STR_LEN("<tr><td style=\"text-align:right\">"));
+ buffer_append_int(b, cstates[CON_STATE_CLOSE+2]);
+ buffer_append_string_len(b, CONST_STR_LEN("<td>&nbsp;&nbsp;k = keep-alive</td></tr>\n"));
+ for (j = 0; j < CON_STATE_CLOSE+2; ++j) {
+ /*(skip "unknown" state if there are none; there should not be any unknown)*/
+ if (0 == cstates[j] && j == CON_STATE_CLOSE+1) continue;
+ buffer_append_string_len(b, CONST_STR_LEN("<tr><td style=\"text-align:right\">"));
+ buffer_append_int(b, cstates[j]);
+ buffer_append_string_len(b, CONST_STR_LEN("</td><td>&nbsp;&nbsp;"));
+ buffer_append_string_len(b, connection_get_short_state(j), 1);
+ buffer_append_string_len(b, CONST_STR_LEN(" = "));
+ buffer_append_string(b, connection_get_state(j));
+ buffer_append_string_len(b, CONST_STR_LEN("</td></tr>\n"));
+ }
+ buffer_append_string_len(b, CONST_STR_LEN("</table>"));
buffer_append_string_len(b, CONST_STR_LEN("\n</pre><hr />\n<h2>Connections</h2>\n"));</pre>
Lighttpd - Feature #2427: Connections Status
https://redmine.lighttpd.net/issues/2427?journal_id=9390
2016-04-13T19:09:47Z
gstrauss
<ul><li><strong>Status</strong> changed from <i>Patch Pending</i> to <i>Fixed</i></li></ul><p>committed in dc9f95c7</p>