Mercurial > hg > nginx
comparison 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 |
comparison
equal
deleted
inserted
replaced
1205:8b3e59a6bfdb | 1206:451e34738078 |
---|---|
213 | 213 |
214 for ( ;; ) { | 214 for ( ;; ) { |
215 rrp->current = rrp->peers->current; | 215 rrp->current = rrp->peers->current; |
216 | 216 |
217 n = rrp->current / (8 * sizeof(uintptr_t)); | 217 n = rrp->current / (8 * sizeof(uintptr_t)); |
218 m = 1 << rrp->current % (8 * sizeof(uintptr_t)); | 218 m = (uintptr_t) 1 << rrp->current % (8 * sizeof(uintptr_t)); |
219 | 219 |
220 if (!(rrp->tried[n] & m)) { | 220 if (!(rrp->tried[n] & m)) { |
221 peer = &rrp->peers->peer[rrp->current]; | 221 peer = &rrp->peers->peer[rrp->current]; |
222 | 222 |
223 if (!peer->down) { | 223 if (!peer->down) { |
266 } | 266 } |
267 | 267 |
268 } else { | 268 } else { |
269 for ( ;; ) { | 269 for ( ;; ) { |
270 n = rrp->current / (8 * sizeof(uintptr_t)); | 270 n = rrp->current / (8 * sizeof(uintptr_t)); |
271 m = 1 << rrp->current % (8 * sizeof(uintptr_t)); | 271 m = (uintptr_t) 1 << rrp->current % (8 * sizeof(uintptr_t)); |
272 | 272 |
273 if (!(rrp->tried[n] & m)) { | 273 if (!(rrp->tried[n] & m)) { |
274 | 274 |
275 peer = &rrp->peers->peer[rrp->current]; | 275 peer = &rrp->peers->peer[rrp->current]; |
276 | 276 |