]> git.kaiwu.me - nginx.git/commitdiff
fix worker endless loop on 64-bit platform if 33+ backend has fall
authorIgor Sysoev <igor@sysoev.ru>
Mon, 21 May 2007 13:48:14 +0000 (13:48 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 21 May 2007 13:48:14 +0000 (13:48 +0000)
src/http/ngx_http_upstream_round_robin.c

index 359a73624a71142d88a6da4440fbd37b8b279d15..b54e7a72d81d7ce05afa153d6fb0eb5e319fdbe6 100644 (file)
@@ -215,7 +215,7 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
                 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(ngx_peer_connection_t *pc, void *data)
         } 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)) {