aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-02-22 14:40:13 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-02-22 14:40:13 +0000
commitd039a2e193c9172e4f415b9304222e81804a69d0 (patch)
tree4571d4da7950e9464e788a4d68dc5111167de52c /src/http/ngx_http_request.c
parent174db74f2309e28c0e2b54e89b9e08afff187c7c (diff)
downloadnginx-d039a2e193c9172e4f415b9304222e81804a69d0.tar.gz
nginx-d039a2e193c9172e4f415b9304222e81804a69d0.zip
nginx-0.1.21-RELEASE importrelease-0.1.21
*) Bugfix: the ngx_http_stub_status_module showed incorrect statistics if "rtsig" method was used or if several worker process ran on SMP. *) Bugfix: nginx could not be built by the icc compiler on Linux or if the zlib-1.2.x library was building from sources. *) Bugfix: nginx could not be built on NetBSD 2.0.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index a6046f1bf..f4908476c 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -138,6 +138,7 @@ void ngx_http_init_connection(ngx_connection_t *c)
if (ngx_accept_mutex) {
if (ngx_mutex_lock(ngx_posted_events_mutex) == NGX_ERROR) {
+
ngx_http_close_connection(c);
return;
}
@@ -145,11 +146,15 @@ void ngx_http_init_connection(ngx_connection_t *c)
ngx_post_event(rev);
ngx_mutex_unlock(ngx_posted_events_mutex);
+
+#if (NGX_STAT_STUB)
+ ngx_atomic_inc(ngx_stat_reading);
+#endif
return;
}
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)++;
+ ngx_atomic_inc(ngx_stat_reading);
#endif
ngx_http_init_request(rev);
@@ -176,7 +181,7 @@ void ngx_http_init_connection(ngx_connection_t *c)
#endif
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)++;
+ ngx_atomic_inc(ngx_stat_reading);
#endif
}
@@ -205,7 +210,7 @@ static void ngx_http_init_request(ngx_event_t *rev)
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)--;
+ ngx_atomic_dec(ngx_stat_reading);
#endif
ngx_http_close_connection(c);
@@ -217,14 +222,14 @@ static void ngx_http_init_request(ngx_event_t *rev)
if (hc) {
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)++;
+ ngx_atomic_inc(ngx_stat_reading);
#endif
} else {
if (!(hc = ngx_pcalloc(c->pool, sizeof(ngx_http_connection_t)))) {
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)--;
+ ngx_atomic_dec(ngx_stat_reading);
#endif
ngx_http_close_connection(c);
@@ -247,7 +252,7 @@ static void ngx_http_init_request(ngx_event_t *rev)
if (!(r = ngx_pcalloc(c->pool, sizeof(ngx_http_request_t)))) {
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)--;
+ ngx_atomic_dec(ngx_stat_reading);
#endif
ngx_http_close_connection(c);
@@ -258,7 +263,7 @@ static void ngx_http_init_request(ngx_event_t *rev)
}
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)--;
+ ngx_atomic_dec(ngx_stat_reading);
#endif
c->data = r;
@@ -427,9 +432,9 @@ static void ngx_http_init_request(ngx_event_t *rev)
r->http_state = NGX_HTTP_READING_REQUEST_STATE;
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)++;
+ ngx_atomic_inc(ngx_stat_reading);
r->stat_reading = 1;
- (*ngx_stat_requests)++;
+ ngx_atomic_inc(ngx_stat_requests);
#endif
rev->event_handler(rev);
@@ -829,9 +834,9 @@ static void ngx_http_process_request_headers(ngx_event_t *rev)
}
#if (NGX_STAT_STUB)
- (*ngx_stat_reading)--;
+ ngx_atomic_dec(ngx_stat_reading);
r->stat_reading = 0;
- (*ngx_stat_writing)++;
+ ngx_atomic_inc(ngx_stat_writing);
r->stat_writing = 1;
#endif
@@ -2076,11 +2081,11 @@ void ngx_http_close_request(ngx_http_request_t *r, int error)
#if (NGX_STAT_STUB)
if (r->stat_reading) {
- (*ngx_stat_reading)--;
+ ngx_atomic_dec(ngx_stat_reading);
}
if (r->stat_writing) {
- (*ngx_stat_writing)--;
+ ngx_atomic_dec(ngx_stat_writing);
}
#endif
@@ -2203,7 +2208,7 @@ void ngx_http_close_connection(ngx_connection_t *c)
#endif
#if (NGX_STAT_STUB)
- (*ngx_stat_active)--;
+ ngx_atomic_dec(ngx_stat_active);
#endif
pool = c->pool;