changeset 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 8b3e59a6bfdb
children 103988cef757
files src/http/ngx_http_upstream_round_robin.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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)) {