summaryrefslogtreecommitdiff
path: root/src/mod_status.c
diff options
context:
space:
mode:
authorKrzysztof Krzyżaniak <eloy@debian.org>2009-10-30 16:38:42 +0000
committerKrzysztof Krzyżaniak <eloy@debian.org>2009-10-30 16:38:42 +0000
commitd5c3fb3805049d4c1d2ba3c01c3d1a8828f04869 (patch)
tree8d5aeb317979b71999c602629ced8bb1c37f1ef4 /src/mod_status.c
parent9bcc98802118528450e76a95710f2fcfd8457dc8 (diff)
downloadlighttpd-d5c3fb3805049d4c1d2ba3c01c3d1a8828f04869.tar.gz
new upstream version
Diffstat (limited to 'src/mod_status.c')
-rw-r--r--src/mod_status.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/mod_status.c b/src/mod_status.c
index 7548276..df5bdb8 100644
--- a/src/mod_status.c
+++ b/src/mod_status.c
@@ -1,4 +1,13 @@
-#define _GNU_SOURCE
+#include "server.h"
+#include "connections.h"
+#include "response.h"
+#include "connections.h"
+#include "log.h"
+
+#include "plugin.h"
+
+#include "inet_ntop_cache.h"
+
#include <sys/types.h>
#include <fcntl.h>
@@ -9,15 +18,6 @@
#include <time.h>
#include <stdio.h>
-#include "server.h"
-#include "connections.h"
-#include "response.h"
-#include "connections.h"
-#include "log.h"
-
-#include "plugin.h"
-
-#include "inet_ntop_cache.h"
#include "version.h"
typedef struct {
@@ -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\">"));
@@ -611,10 +621,10 @@ static handler_t mod_status_handle_server_status_text(server *srv, connection *c
}
static handler_t mod_status_handle_server_statistics(server *srv, connection *con, void *p_d) {
- plugin_data *p = p_d;
- buffer *b = p->module_list;
+ buffer *b;
size_t i;
array *st = srv->status;
+ UNUSED(p_d);
if (0 == st->used) {
/* we have nothing to send */