comparison src/http/modules/ngx_http_upstream_ip_hash_module.c @ 1416:ad2311c943a3

fix ip_hash on 64-bit platform
author Igor Sysoev <igor@sysoev.ru>
date Fri, 24 Aug 2007 15:28:06 +0000
parents be2b895d31e0
children b23a80f9a7b8
comparison
equal deleted inserted replaced
1415:d83687d29853 1416:ad2311c943a3
158 } 158 }
159 159
160 p = hash % iphp->rrp.peers->number; 160 p = hash % iphp->rrp.peers->number;
161 161
162 n = p / (8 * sizeof(uintptr_t)); 162 n = p / (8 * sizeof(uintptr_t));
163 m = 1 << p % (8 * sizeof(uintptr_t)); 163 m = (uintptr_t) 1 << p % (8 * sizeof(uintptr_t));
164 164
165 if (!(iphp->rrp.tried[n] & m)) { 165 if (!(iphp->rrp.tried[n] & m)) {
166 166
167 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0, 167 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
168 "get ip hash peer, hash: %ui %04XA", p, m); 168 "get ip hash peer, hash: %ui %04XA", p, m);