Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-06-23 17:41:06 +0400
committerIgor Sysoev <igor@sysoev.ru>2005-06-23 17:41:06 +0400
commit85ef94ba857237882c7e68dea87a1dbc68a38fe7 (patch)
tree1bc05e18adaabc75f91f1c7b34c7358e60b0efdc /src/http/ngx_http_upstream.c
parent2e87bb645af1d3152c9961d49ca093d4cbfe630d (diff)
nginx-0.1.37-RELEASE importrelease-0.1.37
*) Change: now the "\n" is added to the end of the "nginx.pid" file. *) Bugfix: the responses may be transferred not completely, if many parts or the big parts were included by SSI. *) Bugfix: if all backends had returned the 404 reponse and the "http_404" parameter of the "proxy_next_upstream" or "fastcgi_next_upstream" directives was used, then nginx started to request all backends again.
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 51ffbc0dc..d7ee08f72 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1230,7 +1230,7 @@ static void
ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
ngx_uint_t ft_type)
{
- ngx_uint_t status;
+ ngx_uint_t status, down;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http next upstream, %xD", ft_type);
@@ -1239,10 +1239,14 @@ ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
ngx_http_busy_unlock(u->conf->busy_lock, &u->busy_lock);
#endif
- if (ft_type != NGX_HTTP_UPSTREAM_FT_HTTP_404) {
- ngx_event_connect_peer_failed(&u->peer);
+ if (ft_type == NGX_HTTP_UPSTREAM_FT_HTTP_404) {
+ down = 0;
+ } else {
+ down = 1;
}
-
+
+ ngx_event_connect_peer_failed(&u->peer, down);
+
if (ft_type == NGX_HTTP_UPSTREAM_FT_TIMEOUT) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ETIMEDOUT,
"upstream timed out");
@@ -1285,14 +1289,13 @@ ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
if (status) {
u->state->status = status;
- if (u->peer.tries == 0 || !(u->conf->next_upstream & ft_type))
- {
+ if (u->peer.tries == 0 || !(u->conf->next_upstream & ft_type)) {
#if (NGX_HTTP_CACHE)
if (u->stale && (u->conf->use_stale & ft_type)) {
ngx_http_upstream_finalize_request(r, u,
- ngx_http_send_cached_response(r));
+ ngx_http_send_cached_response(r));
return;
}