diff src/event/ngx_event_connect.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 b55cbf18157e
children e916a291e9aa
line wrap: on
line diff
--- a/src/event/ngx_event_connect.c
+++ b/src/event/ngx_event_connect.c
@@ -376,18 +376,20 @@ ngx_event_connect_peer(ngx_peer_connecti
 
 
 void
-ngx_event_connect_peer_failed(ngx_peer_connection_t *pc)
+ngx_event_connect_peer_failed(ngx_peer_connection_t *pc, ngx_uint_t down)
 {
     time_t  now;
 
-    now = ngx_time();
+    if (down) {
+        now = ngx_time();
 
-    /* ngx_lock_mutex(pc->peers->mutex); */
+        /* ngx_lock_mutex(pc->peers->mutex); */
 
-    pc->peers->peer[pc->cur_peer].fails++;
-    pc->peers->peer[pc->cur_peer].accessed = now;
+        pc->peers->peer[pc->cur_peer].fails++;
+        pc->peers->peer[pc->cur_peer].accessed = now;
 
-    /* ngx_unlock_mutex(pc->peers->mutex); */
+        /* ngx_unlock_mutex(pc->peers->mutex); */
+    }
 
     pc->cur_peer++;