diff --git a/include/lighttpd/connection.h b/include/lighttpd/connection.h index 395fd46..f93d101 100644 --- a/include/lighttpd/connection.h +++ b/include/lighttpd/connection.h @@ -81,7 +81,7 @@ struct liConnection { liWaitQueueElem wqueue_elem; } throttle; - ev_tstamp ts; + ev_tstamp ts_started; struct { guint64 bytes_in; /* total number of bytes received */ diff --git a/src/main/connection.c b/src/main/connection.c index 2dae928..5d46569 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -157,7 +157,6 @@ static gboolean connection_handle_read(liConnection *con) { con->keep_alive = FALSE; con->state = LI_CON_STATE_READ_REQUEST_HEADER; - con->ts = CUR_TS(con->wrk); li_vrequest_start(con->mainvr); } else { @@ -640,8 +639,6 @@ static void li_connection_reset_keep_alive(liConnection *con) { li_cqlimit_set_limit(con->raw_in->limit, 512*1024); li_cqlimit_set_limit(con->raw_out->limit, 512*1024); - con->ts = CUR_TS(con->wrk); - /* reset stats */ con->stats.bytes_in = G_GUINT64_CONSTANT(0); con->stats.bytes_in_5s = G_GUINT64_CONSTANT(0); diff --git a/src/main/worker.c b/src/main/worker.c index 5a4e6f8..88a71f5 100644 --- a/src/main/worker.c +++ b/src/main/worker.c @@ -284,7 +284,7 @@ void li_worker_new_con(liWorker *ctx, liWorker *wrk, liSocketAddress remote_addr con->state = LI_CON_STATE_REQUEST_START; ev_io_set(&con->sock_watcher, s, EV_READ); ev_io_start(wrk->loop, &con->sock_watcher); - con->ts = CUR_TS(con->wrk); + con->ts_started = CUR_TS(wrk); con->remote_addr = remote_addr; li_sockaddr_to_string(remote_addr, con->remote_addr_str, FALSE); diff --git a/src/modules/mod_debug.c b/src/modules/mod_debug.c index e1c0d2e..b10724e 100644 --- a/src/modules/mod_debug.c +++ b/src/modules/mod_debug.c @@ -54,7 +54,7 @@ struct mod_debug_data_t { liHttpMethod method; goffset request_size; goffset response_size; - ev_tstamp ts; + ev_tstamp ts_started; guint64 bytes_in; guint64 bytes_out; guint64 bytes_in_5s_diff; @@ -104,7 +104,7 @@ static gpointer debug_collect_func(liWorker *wrk, gpointer fdata) { cd->request_size = c->mainvr->request.content_length; cd->response_size = c->mainvr->out->bytes_out; cd->state = c->state; - cd->ts = c->ts; + cd->ts_started = c->ts_started; cd->bytes_in = c->stats.bytes_in; cd->bytes_out = c->stats.bytes_out; cd->bytes_in_5s_diff = c->stats.bytes_in_5s_diff; @@ -120,7 +120,7 @@ static gpointer debug_collect_func(liWorker *wrk, gpointer fdata) { g_string_append_printf(cd->detailed, " local_addr_str = \"%s\",\n", cd->local_addr_str->str); g_string_append_printf(cd->detailed, " fd = %d,\n", cd->fd); g_string_append_printf(cd->detailed, " state = \"%s\",\n", li_connection_state_str(cd->state)); - g_string_append_printf(cd->detailed, " ts = %f,\n", cd->ts); + g_string_append_printf(cd->detailed, " ts_started = %f,\n", cd->ts_started); g_string_append_printf(cd->detailed, " io_timeout_elem = {\n" " queued = %s,\n" @@ -213,7 +213,7 @@ static void debug_collect_cb(gpointer cbdata, gpointer fdata, GPtrArray *result, for (j = 0; j < cons->len; j++) { mod_debug_data_t *d = &g_array_index(cons, mod_debug_data_t, j); - li_counter_format((guint64)(CUR_TS(vr->wrk) - d->ts), COUNTER_TIME, duration); + li_counter_format((guint64)(CUR_TS(vr->wrk) - d->ts_started), COUNTER_TIME, duration); g_string_append_printf(html, "%s%sdebug\n", d->remote_addr_str->str, duration->str, diff --git a/src/modules/mod_status.c b/src/modules/mod_status.c index 341523b..45dc1f0 100644 --- a/src/modules/mod_status.c +++ b/src/modules/mod_status.c @@ -330,7 +330,7 @@ struct mod_status_con_data { liHttpMethod method; goffset request_size; goffset response_size; - ev_tstamp ts; + ev_tstamp ts_started; guint64 bytes_in; guint64 bytes_out; guint64 bytes_in_5s_diff; @@ -376,7 +376,7 @@ static gpointer status_collect_func(liWorker *wrk, gpointer fdata) { cd->request_size = c->mainvr->request.content_length; cd->response_size = c->mainvr->out->bytes_out; cd->state = c->state; - cd->ts = c->ts; + cd->ts_started = c->ts_started; cd->bytes_in = c->stats.bytes_in; cd->bytes_out = c->stats.bytes_out; cd->bytes_in_5s_diff = c->stats.bytes_in_5s_diff; @@ -708,7 +708,7 @@ static GString *status_info_full(liVRequest *vr, liPlugin *p, gboolean short_inf for (j = 0; j < sd->connections->len; j++) { mod_status_con_data *cd = &g_array_index(sd->connections, mod_status_con_data, j); - li_counter_format((guint64)(CUR_TS(vr->wrk) - cd->ts), COUNTER_TIME, ts); + li_counter_format((guint64)(CUR_TS(vr->wrk) - cd->ts_started), COUNTER_TIME, ts); li_counter_format(cd->bytes_in, COUNTER_BYTES, bytes_in); li_counter_format(cd->bytes_in_5s_diff / G_GUINT64_CONSTANT(5), COUNTER_BYTES, bytes_in_5s); li_counter_format(cd->bytes_out, COUNTER_BYTES, bytes_out); @@ -723,7 +723,7 @@ static GString *status_info_full(liVRequest *vr, liPlugin *p, gboolean short_inf cd->path->str, cd->query->len ? "?":"", cd->query->len ? cd->query->str : "", - (guint64)(CUR_TS(vr->wrk) - cd->ts), ts->str, + (guint64)(CUR_TS(vr->wrk) - cd->ts_started), ts->str, cd->bytes_in, bytes_in->str, cd->bytes_out, bytes_out->str, cd->bytes_in_5s_diff / G_GUINT64_CONSTANT(5), bytes_in_5s->str,