aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-12-19 08:15:11 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-12-19 08:15:11 +0000
commite89c4581f4706187052671a8a40dda4fe3e3c391 (patch)
tree3644c7b95ae7ed7b62d830c62e452b632ac9e89b /src/http/ngx_http_request.c
parente3466a4058ec3a6c7915f5239fac9f6bfbb6a29d (diff)
downloadnginx-e89c4581f4706187052671a8a40dda4fe3e3c391.tar.gz
nginx-e89c4581f4706187052671a8a40dda4fe3e3c391.zip
nginx-0.0.1-2003-12-19-11:15:11 import
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 66bf9be47..c484d277b 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -107,6 +107,8 @@ void ngx_http_init_connection(ngx_connection_t *c)
return;
}
#endif
+
+ ngx_atomic_inc(ngx_http_reading_state);
}
@@ -127,6 +129,7 @@ static void ngx_http_init_request(ngx_event_t *rev)
if (rev->timedout) {
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
+ ngx_atomic_dec(ngx_http_reading_state);
ngx_http_close_connection(c);
return;
}
@@ -1264,7 +1267,7 @@ static void ngx_http_set_lingering_close(ngx_http_request_t *r)
rev = c->read;
rev->event_handler = ngx_http_lingering_close_handler;
- r->lingering_time = ngx_time() + clcf->lingering_time / 1000;
+ r->lingering_time = ngx_cached_time + clcf->lingering_time / 1000;
ngx_add_timer(rev, clcf->lingering_timeout);
if (ngx_handle_level_read_event(rev) == NGX_ERROR) {
@@ -1326,7 +1329,7 @@ static void ngx_http_lingering_close_handler(ngx_event_t *rev)
return;
}
- timer = r->lingering_time - ngx_time();
+ timer = r->lingering_time - ngx_cached_time;
if (timer <= 0) {
ngx_http_close_request(r, 0);
ngx_http_close_connection(c);