Mercurial > hg > nginx
diff src/http/ngx_http_request.c @ 426:3f88935a02e8
nginx-0.0.10-2004-09-14-23:39:54 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 14 Sep 2004 19:39:54 +0000 |
parents | fda5987b188d |
children | 0d08eabe5c7b |
line wrap: on
line diff
--- a/src/http/ngx_http_request.c Tue Sep 14 15:55:24 2004 +0000 +++ b/src/http/ngx_http_request.c Tue Sep 14 19:39:54 2004 +0000 @@ -97,6 +97,10 @@ ngx_event_t *rev; ngx_http_log_ctx_t *ctx; +#if (NGX_STAT_STUB) + (*ngx_stat_reading)++; +#endif + if (!(ctx = ngx_pcalloc(c->pool, sizeof(ngx_http_log_ctx_t)))) { ngx_http_close_connection(c); return; @@ -313,22 +317,14 @@ return; } - r->cleanup.elts = ngx_palloc(r->pool, 5 * sizeof(ngx_http_cleanup_t)); - if (r->cleanup.elts == NULL) { + if (ngx_array_init(&r->cleanup, r->pool, 5, sizeof(ngx_http_cleanup_t)) + == NGX_ERROR) + { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); ngx_http_close_connection(c); return; } - /* - * set by ngx_pcalloc(): - * - * r->cleanup.nelts = 0; - */ - r->cleanup.nalloc = 5; - r->cleanup.size = sizeof(ngx_http_cleanup_t); - r->cleanup.pool = r->pool; - if (ngx_list_init(&r->headers_out.headers, r->pool, 20, sizeof(ngx_table_elt_t)) == NGX_ERROR) @@ -360,6 +356,10 @@ r->http_state = NGX_HTTP_READING_REQUEST_STATE; +#if (NGX_STAT_STUB) + (*ngx_stat_requests)++; +#endif + rev->event_handler(rev); } @@ -867,6 +867,11 @@ ngx_del_timer(rev); } +#if (NGX_STAT_STUB) + (*ngx_stat_reading)--; + (*ngx_stat_writing)++; +#endif + rev->event_handler = ngx_http_block_read; ngx_http_handler(r); return; @@ -1143,6 +1148,11 @@ } if (rc == NGX_HTTP_CLIENT_CLOSED_REQUEST || r->closed) { + +#if (NGX_STAT_STUB) + (*ngx_stat_writing)--; +#endif + ngx_http_close_request(r, 0); ngx_http_close_connection(r->connection); return; @@ -1153,6 +1163,11 @@ return; } else if (rc == NGX_ERROR) { + +#if (NGX_STAT_STUB) + (*ngx_stat_writing)--; +#endif + ngx_http_close_request(r, 0); ngx_http_close_connection(r->connection); return; @@ -1162,6 +1177,10 @@ return; } +#if (NGX_STAT_STUB) + (*ngx_stat_writing)--; +#endif + if (r->connection->read->timer_set) { ngx_del_timer(r->connection->read); } @@ -1887,6 +1906,10 @@ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "close http connection: %d", c->fd); +#if (NGX_STAT_STUB) + (*ngx_stat_active)--; +#endif + ngx_close_connection(c); }