Permalink
Browse files

beauty fix

  • Loading branch information...
1 parent 674adcc commit 742c9cd1367da881f948fb7200f82d7db1f972a8 @replay committed Aug 26, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 ngx_http_upstream_consistent_hash_module.c
@@ -9,6 +9,8 @@
#define MMC_CONSISTENT_POINTS 160
#define MMC_CONSISTENT_BUCKETS 1024
+#define HASH_DATA_LENGTH 28
+
typedef struct {
ngx_array_t *values;
@@ -116,14 +118,14 @@ ngx_http_upstream_init_consistent_hash(ngx_conf_t *cf,
ngx_http_upstream_srv_conf_t *us)
{
/* ip max 15, :port max 6, maxweight is highest number of uchar */
- u_char hash_data[28];
+ u_char hash_data[HASH_DATA_LENGTH];
uint32_t step;
ngx_uint_t i, j, k, n, points = 0;
ngx_http_upstream_server_t *server;
ngx_http_upstream_consistent_hash_buckets *buckets;
ngx_http_upstream_consistent_hash_continuum *continuum;
- for (i=0;i<28;i++) hash_data[i] = NULL;
+ for (i=0;i<HASH_DATA_LENGTH;i++) hash_data[i] = NULL;
step = (uint32_t) (0xffffffff / MMC_CONSISTENT_BUCKETS);

0 comments on commit 742c9cd

Please sign in to comment.