Project

General

Profile

Bug #2740

mod_status with "?auto" modifier not showing keep-alive (k) status on Scoreboard

Added by idfnet 9 months ago. Updated 9 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_status
Target version:
Start date:
2016-07-21
Due date:
% Done:

100%

Missing in 1.5.x:

Description

The Scoreboard generated by mod_status for the URL "/server-status" differs from the one generated for the URL "/server-status?auto":
With the "?auto" modifier, connections in state keep-alive (k) are not listed.

Sample output without modifier:

krrkWkkkkCrCkrrCrkrkrCWrkkWrkkkkkrkkkkkkkrkCrrkkrC
rkCkrrrCkkrkkkrrCCkrkCrCrrkkrCCrkCkrrrCkrrkCkkrrrk
rkWrkkrCrrrrkCrrrkkkkrrrrkkrrrkrrkrWkrrrrCkkrCrrCk
kkkkrCkkkkrhrrCCkWWrkkWrrrWrrkWCCrCrCCrrrrrrkrkkrr
rkkkkkrCCrWCrkrkrCkCrkCrhrrrCrrkCrCrkkkkrCrrrCkCCC
rrkrrrkkWrkCWkkWWrrrkrkrkrkrkkkrrhrrrrkCkWkkrrkrrr
kCrkrkkrkrWrrkrkkkkrkrrrrrrCCrkkrrkkrrkkrrCkrrCrkk
WCkrkrrkrrkkkkrkkrWrCkCrrrrCCrkkrkCCCrrrkrkrrrCCrC
CkkkCCkWkrhhkrrCkkrkrkkCrrCCCCCCkkrrkrrrrrrkkkkkkk
krkkrkrkrkrhr

Sample output with modifier (linebreaks added):

rrrrWrrrrCrCrrrCrrrrrCWrrrWrrrrrrrrrrrrrrrrCrrrrrC
rrCrrrrCrrrrrrrrCCrrrCrCrrWrrCCrrCrrrrCrrrrCrrrrrr
rrWrrrrCrrrrrCrhrrrrrrrrrrrrrrrrrrrWrrrrrrrrrCrrCr
rrrrrCrrrrrWrrCCrWWrrrWrrrWrrrWCCrCrrCrrrrrrrrrrrr
rrrrrrrCCrWCrrrrrCrCrrCrrrrrCrrrCrCrrrrrrCrrrCrCCC
rrrrrrrrWrrCWrrWWrrrrrrrrrrrrrrrrhrrrrrCrWrrrrrrrr
rCrrrrrrrrWrrrrrrrrrrrrrrrrCCrrrrrrrrrrrrrCrrrCrrr
WCrrrrrrrrrrrrrrrrrrCrCrrrrCCrrrrrCCCrrrrrrrrrCCrC
CrrrCCrrrrrhrrrCrrrrrrrCrrCCCCCCrrrrrrrrrrrrrrrrrr
rrrrrrrrrWrrrr____________________________________
__________________________________________________
__________________________________________________
__________________________________________________
__________________________________________________
__________________________________________________
__________________

Associated revisions

Revision b43fc006 (diff)
Added by gstrauss 9 months ago

[mod_status] show keep-alive status w/ text output (fixes #2740)

x-ref:
"mod_status with "?auto" modifier not showing keep-alive (k) status
on Scoreboard"
https://redmine.lighttpd.net/issues/2740
"server-status - additional stats - keepalive"
https://redmine.lighttpd.net/issues/1202

History

#1 Updated by gstrauss 9 months ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.x to 1.4.41

Apparently, this was only partially added in 2009 in https://redmine.lighttpd.net/issues/1202
Here's the change for text output (obtained with /server-status?auto)

diff --git a/src/mod_status.c b/src/mod_status.c
index a37b6cd..647f403 100644
--- a/src/mod_status.c
+++ b/src/mod_status.c
@@ -638,7 +638,10 @@ static handler_t mod_status_handle_server_status_text(server *srv, connection *c
        buffer_append_string_len(b, CONST_STR_LEN("Scoreboard: "));
        for (k = 0; k < srv->conns->used; k++) {
                connection *c = srv->conns->ptr[k];
-               const char *state = connection_get_short_state(c->state);
+               const char *state =
+                 (CON_STATE_READ == c->state && !buffer_string_is_empty(c->request.orig_uri))
+                   ? "k" 
+                   : connection_get_short_state(c->state);
                buffer_append_string_len(b, state, 1);
        }
        for (l = 0; l < srv->conns->size - srv->conns->used; l++) {

#2 Updated by gstrauss 9 months ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom