X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fhosts.c;h=e0224222176626e0d63dee54c765ca1df236cb83;hb=7c986323bd4eece0d805f4df17eb03ea094f84f6;hp=27a86a7b4197ded4afafc1b0a44f9b355a13ebd5;hpb=8fd8f655540e3d6aa0b0a3eb0f4f7df1be2e6542;p=m6w6%2Flibmemcached diff --git a/libmemcached/hosts.c b/libmemcached/hosts.c index 27a86a7b..e0224222 100644 --- a/libmemcached/hosts.c +++ b/libmemcached/hosts.c @@ -6,7 +6,7 @@ static memcached_return_t server_add(memcached_st *ptr, const char *hostname, in_port_t port, uint32_t weight, memcached_connection_t type); -memcached_return_t update_continuum(memcached_st *ptr); +static memcached_return_t update_continuum(memcached_st *ptr); static int compare_servers(const void *p1, const void *p2) { @@ -106,7 +106,7 @@ static int continuum_item_cmp(const void *t1, const void *t2) return -1; } -memcached_return_t update_continuum(memcached_st *ptr) +static memcached_return_t update_continuum(memcached_st *ptr) { uint32_t host_index; uint32_t continuum_index= 0; @@ -256,16 +256,17 @@ memcached_return_t update_continuum(memcached_st *ptr) if (list[host_index].port == MEMCACHED_DEFAULT_PORT) { sort_host_length= (size_t) snprintf(sort_host, MEMCACHED_MAX_HOST_SORT_LENGTH, - "%s-%d", + "%s-%u", list[host_index].hostname, pointer_index - 1); } else { sort_host_length= (size_t) snprintf(sort_host, MEMCACHED_MAX_HOST_SORT_LENGTH, - "%s:%d-%d", + "%s:%u-%u", list[host_index].hostname, - list[host_index].port, pointer_index - 1); + (uint32_t)list[host_index].port, + pointer_index - 1); } WATCHPOINT_ASSERT(sort_host_length);