Mercurial > hg > nginx-ranges
comparison src/http/ngx_http_request.c @ 531:d41628eb4d0a NGINX_0_8_12
nginx 0.8.12
*) Feature: the "sendfile" parameter in the "aio" directive on FreeBSD.
*) Bugfix: in try_files; the bug had appeared in 0.8.11.
*) Bugfix: in memcached; the bug had appeared in 0.8.11.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 31 Aug 2009 00:00:00 +0400 |
parents | 86dad910eeb6 |
children | 80f7156c2965 |
comparison
equal
deleted
inserted
replaced
530:1fd1b769cd78 | 531:d41628eb4d0a |
---|---|
1808 } | 1808 } |
1809 } | 1809 } |
1810 | 1810 |
1811 | 1811 |
1812 ngx_int_t | 1812 ngx_int_t |
1813 ngx_http_post_request(ngx_http_request_t *r) | 1813 ngx_http_post_request(ngx_http_request_t *r, ngx_http_posted_request_t *pr) |
1814 { | 1814 { |
1815 ngx_http_posted_request_t *pr, **p; | 1815 ngx_http_posted_request_t **p; |
1816 | 1816 |
1817 pr = ngx_palloc(r->pool, sizeof(ngx_http_posted_request_t)); | |
1818 if (pr == NULL) { | 1817 if (pr == NULL) { |
1819 return NGX_ERROR; | 1818 pr = ngx_palloc(r->pool, sizeof(ngx_http_posted_request_t)); |
1819 if (pr == NULL) { | |
1820 return NGX_ERROR; | |
1821 } | |
1820 } | 1822 } |
1821 | 1823 |
1822 pr->request = r; | 1824 pr->request = r; |
1823 pr->next = NULL; | 1825 pr->next = NULL; |
1824 | 1826 |
1963 if (r->waited) { | 1965 if (r->waited) { |
1964 r->done = 1; | 1966 r->done = 1; |
1965 } | 1967 } |
1966 } | 1968 } |
1967 | 1969 |
1968 if (ngx_http_post_request(pr) != NGX_OK) { | 1970 if (ngx_http_post_request(pr, NULL) != NGX_OK) { |
1969 r->main->count++; | 1971 r->main->count++; |
1970 ngx_http_terminate_request(r, 0); | 1972 ngx_http_terminate_request(r, 0); |
1971 return; | 1973 return; |
1972 } | 1974 } |
1973 | 1975 |
2023 | 2025 |
2024 | 2026 |
2025 static void | 2027 static void |
2026 ngx_http_terminate_request(ngx_http_request_t *r, ngx_int_t rc) | 2028 ngx_http_terminate_request(ngx_http_request_t *r, ngx_int_t rc) |
2027 { | 2029 { |
2028 ngx_http_cleanup_t *cln; | 2030 ngx_http_cleanup_t *cln; |
2029 ngx_http_request_t *mr; | 2031 ngx_http_request_t *mr; |
2032 ngx_http_ephemeral_t *e; | |
2030 | 2033 |
2031 mr = r->main; | 2034 mr = r->main; |
2032 | 2035 |
2033 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 2036 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
2034 "http terminate request count:%d", mr->count); | 2037 "http terminate request count:%d", mr->count); |
2052 | 2055 |
2053 if (mr->blocked) { | 2056 if (mr->blocked) { |
2054 return; | 2057 return; |
2055 } | 2058 } |
2056 | 2059 |
2060 e = ngx_http_ephemeral(mr); | |
2057 mr->posted_requests = NULL; | 2061 mr->posted_requests = NULL; |
2058 mr->write_event_handler = ngx_http_terminate_handler; | 2062 mr->write_event_handler = ngx_http_terminate_handler; |
2059 (void) ngx_http_post_request(mr); | 2063 (void) ngx_http_post_request(mr, &e->terminal_posted_request); |
2060 return; | 2064 return; |
2061 } | 2065 } |
2062 | 2066 |
2063 ngx_http_close_request(mr, rc); | 2067 ngx_http_close_request(mr, rc); |
2064 } | 2068 } |