- add IdleServers and Scoreboard directives in ?auto mode for mod_status (#1507)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2045 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
parent
b6d6b82b70
commit
299ae40e78
1
NEWS
1
NEWS
|
@ -15,6 +15,7 @@ NEWS
|
|||
* print error if X-LIGHTTPD-send-file cannot be done; reset header
|
||||
Content-Length for send-file. Patches by Stefan Buhler
|
||||
* prevent crash in certain php-fcgi configurations (#841)
|
||||
* add IdleServers and Scoreboard directives in ?auto mode for mod_status (#1507)
|
||||
|
||||
- 1.4.18 - 2007-09-09
|
||||
|
||||
|
|
|
@ -560,6 +560,8 @@ static handler_t mod_status_handle_server_status_text(server *srv, connection *c
|
|||
double avg;
|
||||
time_t ts;
|
||||
char buf[32];
|
||||
unsigned int k;
|
||||
unsigned int l;
|
||||
|
||||
b = chunkqueue_get_append_buffer(con->write_queue);
|
||||
|
||||
|
@ -588,6 +590,22 @@ static handler_t mod_status_handle_server_status_text(server *srv, connection *c
|
|||
buffer_append_long(b, srv->conns->used);
|
||||
BUFFER_APPEND_STRING_CONST(b, "\n");
|
||||
|
||||
BUFFER_APPEND_STRING_CONST(b, "IdleServers: ");
|
||||
buffer_append_long(b, srv->conns->size - srv->conns->used);
|
||||
BUFFER_APPEND_STRING_CONST(b, "\n");
|
||||
|
||||
/* output scoreboard */
|
||||
BUFFER_APPEND_STRING_CONST(b, "Scoreboard: ");
|
||||
for (k = 0; k < srv->conns->used; k++) {
|
||||
connection *c = srv->conns->ptr[k];
|
||||
const char *state = connection_get_short_state(c->state);
|
||||
buffer_append_string_len(b, state, 1);
|
||||
}
|
||||
for (l = 0; l < srv->conns->size - srv->conns->used; l++) {
|
||||
BUFFER_APPEND_STRING_CONST(b, "_");
|
||||
}
|
||||
BUFFER_APPEND_STRING_CONST(b, "\n");
|
||||
|
||||
/* set text/plain output */
|
||||
|
||||
response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/plain"));
|
||||
|
|
Loading…
Reference in New Issue