comparison src/http/ngx_http_upstream.c @ 74:77969b24f355 NGINX_0_1_37

nginx 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.
author Igor Sysoev <http://sysoev.ru>
date Thu, 23 Jun 2005 00:00:00 +0400
parents 5db440287648
children da9a3b14312d
comparison
equal deleted inserted replaced
73:05310cdbd906 74:77969b24f355
1228 1228
1229 static void 1229 static void
1230 ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u, 1230 ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
1231 ngx_uint_t ft_type) 1231 ngx_uint_t ft_type)
1232 { 1232 {
1233 ngx_uint_t status; 1233 ngx_uint_t status, down;
1234 1234
1235 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1235 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1236 "http next upstream, %xD", ft_type); 1236 "http next upstream, %xD", ft_type);
1237 1237
1238 #if 0 1238 #if 0
1239 ngx_http_busy_unlock(u->conf->busy_lock, &u->busy_lock); 1239 ngx_http_busy_unlock(u->conf->busy_lock, &u->busy_lock);
1240 #endif 1240 #endif
1241 1241
1242 if (ft_type != NGX_HTTP_UPSTREAM_FT_HTTP_404) { 1242 if (ft_type == NGX_HTTP_UPSTREAM_FT_HTTP_404) {
1243 ngx_event_connect_peer_failed(&u->peer); 1243 down = 0;
1244 } 1244 } else {
1245 1245 down = 1;
1246 }
1247
1248 ngx_event_connect_peer_failed(&u->peer, down);
1249
1246 if (ft_type == NGX_HTTP_UPSTREAM_FT_TIMEOUT) { 1250 if (ft_type == NGX_HTTP_UPSTREAM_FT_TIMEOUT) {
1247 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ETIMEDOUT, 1251 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ETIMEDOUT,
1248 "upstream timed out"); 1252 "upstream timed out");
1249 } 1253 }
1250 1254
1283 } 1287 }
1284 1288
1285 if (status) { 1289 if (status) {
1286 u->state->status = status; 1290 u->state->status = status;
1287 1291
1288 if (u->peer.tries == 0 || !(u->conf->next_upstream & ft_type)) 1292 if (u->peer.tries == 0 || !(u->conf->next_upstream & ft_type)) {
1289 {
1290 1293
1291 #if (NGX_HTTP_CACHE) 1294 #if (NGX_HTTP_CACHE)
1292 1295
1293 if (u->stale && (u->conf->use_stale & ft_type)) { 1296 if (u->stale && (u->conf->use_stale & ft_type)) {
1294 ngx_http_upstream_finalize_request(r, u, 1297 ngx_http_upstream_finalize_request(r, u,
1295 ngx_http_send_cached_response(r)); 1298 ngx_http_send_cached_response(r));
1296 return; 1299 return;
1297 } 1300 }
1298 1301
1299 #endif 1302 #endif
1300 1303