Changeset aedaaa
- Timestamp:
- 02/01/09 15:38:20 (3 years ago)
- Branches:
- master-v0.7, master-v0.6, memcached_hash, upstream_count_limit
- Children:
- 6c857c, fb0da1, f54237
- Parents:
- 321c4d
- git-author:
- Tomash Brechko <tomash.brechko@…> (02/01/09 15:38:20)
- git-committer:
- Tomash Brechko <tomash.brechko@…> (02/01/09 15:38:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
memcached_hash/ngx_http_upstream_memcached_hash_module.c
r321c4d raedaaa 344 344 u_char *host, *port; 345 345 size_t len, port_len = 0; 346 unsigned int crc32, count, j;346 unsigned int crc32, point, count, j; 347 347 348 348 host = server[i].name.data; … … 372 372 ngx_crc32_update(&crc32, (u_char *) &delim, 1); 373 373 ngx_crc32_update(&crc32, port, port_len); 374 point = 0; 374 375 375 376 count = (memd->ketama_points * server[i].weight … … 378 379 { 379 380 u_char buf[4]; 380 unsigned int point = crc32, bucket;381 unsigned int new_point = crc32, bucket; 381 382 382 383 /* … … 384 385 hardcode size of int as 4 8-bit bytes. 385 386 */ 386 buf[0] = j & 0xff; 387 buf[1] = (j >> 8) & 0xff; 388 buf[2] = (j >> 16) & 0xff; 389 buf[3] = (j >> 24) & 0xff; 390 391 ngx_crc32_update(&point, buf, 4); 392 ngx_crc32_final(point); 387 buf[0] = point & 0xff; 388 buf[1] = (point >> 8) & 0xff; 389 buf[2] = (point >> 16) & 0xff; 390 buf[3] = (point >> 24) & 0xff; 391 392 ngx_crc32_update(&new_point, buf, 4); 393 ngx_crc32_final(new_point); 394 point = new_point; 393 395 394 396 if (memd->buckets_count > 0)
Note: See TracChangeset
for help on using the changeset viewer.
