comparison src/stream/ngx_stream_handler.c @ 6669:164a0824ce20

Stream: the $session_time variable. The variable keeps time spent on processing the stream session.
author Vladimir Homutov <vl@nginx.com>
date Fri, 26 Aug 2016 15:33:04 +0300
parents c70b7f4537e1
children 38143d1abdec
comparison
equal deleted inserted replaced
6668:5e2821c2de46 6669:164a0824ce20
26 int tcp_nodelay; 26 int tcp_nodelay;
27 u_char text[NGX_SOCKADDR_STRLEN]; 27 u_char text[NGX_SOCKADDR_STRLEN];
28 size_t len; 28 size_t len;
29 ngx_int_t rc; 29 ngx_int_t rc;
30 ngx_uint_t i; 30 ngx_uint_t i;
31 ngx_time_t *tp;
31 struct sockaddr *sa; 32 struct sockaddr *sa;
32 ngx_stream_port_t *port; 33 ngx_stream_port_t *port;
33 struct sockaddr_in *sin; 34 struct sockaddr_in *sin;
34 ngx_stream_in_addr_t *addr; 35 ngx_stream_in_addr_t *addr;
35 ngx_stream_session_t *s; 36 ngx_stream_session_t *s;
156 if (s->variables == NULL) { 157 if (s->variables == NULL) {
157 ngx_stream_close_connection(c); 158 ngx_stream_close_connection(c);
158 return; 159 return;
159 } 160 }
160 161
162 tp = ngx_timeofday();
163 s->start_sec = tp->sec;
164 s->start_msec = tp->msec;
165
161 if (cmcf->limit_conn_handler) { 166 if (cmcf->limit_conn_handler) {
162 rc = cmcf->limit_conn_handler(s); 167 rc = cmcf->limit_conn_handler(s);
163 168
164 if (rc != NGX_DECLINED) { 169 if (rc != NGX_DECLINED) {
165 ngx_stream_close_connection(c); 170 ngx_stream_close_connection(c);