diff src/http/ngx_http_upstream_round_robin.c @ 1206:451e34738078

fix worker endless loop on 64-bit platform if 33+ backend has fall
author Igor Sysoev <igor@sysoev.ru>
date Mon, 21 May 2007 13:48:14 +0000
parents 327aef5c6ac4
children be2b895d31e0
line wrap: on
line diff
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -215,7 +215,7 @@ ngx_http_upstream_get_round_robin_peer(n
                 rrp->current = rrp->peers->current;
 
                 n = rrp->current / (8 * sizeof(uintptr_t));
-                m = 1 << rrp->current % (8 * sizeof(uintptr_t));
+                m = (uintptr_t) 1 << rrp->current % (8 * sizeof(uintptr_t));
 
                 if (!(rrp->tried[n] & m)) {
                     peer = &rrp->peers->peer[rrp->current];
@@ -268,7 +268,7 @@ ngx_http_upstream_get_round_robin_peer(n
         } else {
             for ( ;; ) {
                 n = rrp->current / (8 * sizeof(uintptr_t));
-                m = 1 << rrp->current % (8 * sizeof(uintptr_t));
+                m = (uintptr_t) 1 << rrp->current % (8 * sizeof(uintptr_t));
 
                 if (!(rrp->tried[n] & m)) {