aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_handler.c
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2016-08-26 15:33:04 +0300
committerVladimir Homutov <vl@nginx.com>2016-08-26 15:33:04 +0300
commitf04b65358e543275affc4cee13c90cd568ae438a (patch)
treee598ec8788ad8f1c8a6e3880e7e84bdc3c6a5746 /src/stream/ngx_stream_handler.c
parent1258126f0c9070315c494d31b71ae912c9aa82c8 (diff)
downloadnginx-f04b65358e543275affc4cee13c90cd568ae438a.tar.gz
nginx-f04b65358e543275affc4cee13c90cd568ae438a.zip
Stream: the $session_time variable.
The variable keeps time spent on processing the stream session.
Diffstat (limited to 'src/stream/ngx_stream_handler.c')
-rw-r--r--src/stream/ngx_stream_handler.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/stream/ngx_stream_handler.c b/src/stream/ngx_stream_handler.c
index 61169e1d0..f633ac399 100644
--- a/src/stream/ngx_stream_handler.c
+++ b/src/stream/ngx_stream_handler.c
@@ -28,6 +28,7 @@ ngx_stream_init_connection(ngx_connection_t *c)
size_t len;
ngx_int_t rc;
ngx_uint_t i;
+ ngx_time_t *tp;
struct sockaddr *sa;
ngx_stream_port_t *port;
struct sockaddr_in *sin;
@@ -158,6 +159,10 @@ ngx_stream_init_connection(ngx_connection_t *c)
return;
}
+ tp = ngx_timeofday();
+ s->start_sec = tp->sec;
+ s->start_msec = tp->msec;
+
if (cmcf->limit_conn_handler) {
rc = cmcf->limit_conn_handler(s);