Browse Source

Keep url/host values from connection to display information while keep-alive in mod_status (fixes #1202)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2549 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.24
Stefan Bühler 13 years ago
parent
commit
214484dec0
  1. 1
      NEWS
  2. 13
      src/connections.c
  3. 16
      src/mod_status.c

1
NEWS

@ -7,6 +7,7 @@ NEWS
* Add T_CONFIG_INT for bigger integers from the config (needed for #1966)
* Use unsigned int (and T_CONFIG_INT) for max_request_size
* Use unsigned int for secdownload.timeout (fixes #1966)
* Keep url/host values from connection to display information while keep-alive in mod_status (fixes #1202)
- 1.4.23 - 2009-06-19
* Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)

13
src/connections.c

@ -782,13 +782,13 @@ int connection_reset(server *srv, connection *con) {
CLEAN(request.pathinfo);
CLEAN(request.request);
CLEAN(request.orig_uri);
/* CLEAN(request.orig_uri); */
CLEAN(uri.scheme);
CLEAN(uri.authority);
CLEAN(uri.path);
/* CLEAN(uri.authority); */
/* CLEAN(uri.path); */
CLEAN(uri.path_raw);
CLEAN(uri.query);
/* CLEAN(uri.query); */
CLEAN(physical.doc_root);
CLEAN(physical.path);
@ -1401,6 +1401,11 @@ int connection_state_machine(server *srv, connection *con) {
"state for fd", con->fd, connection_get_state(con->state));
}
buffer_reset(con->uri.authority);
buffer_reset(con->uri.path);
buffer_reset(con->uri.query);
buffer_reset(con->request.orig_uri);
if (http_request_parse(srv, con)) {
/* we have to read some data from the POST request */

16
src/mod_status.c

@ -438,7 +438,7 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
buffer_append_string_len(b, CONST_STR_LEN(
"<hr />\n<pre><b>legend</b>\n"
". = connect, C = close, E = hard error\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"));
@ -449,7 +449,13 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
for (j = 0; j < srv->conns->used; j++) {
connection *c = srv->conns->ptr[j];
const char *state = connection_get_short_state(c->state);
const char *state;
if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
state = "k";
} else {
state = connection_get_short_state(c->state);
}
buffer_append_string_len(b, state, 1);
@ -497,7 +503,11 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
buffer_append_string(b, connection_get_state(c->state));
if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
} else {
buffer_append_string(b, connection_get_state(c->state));
}
buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"int\">"));

Loading…
Cancel
Save