From: Date: Wed, 6 Feb 2008 03:02:12 +0000 (-0800) Subject: Fix for 64 bit X-Git-Tag: _20~23 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3a44779de78a8c14117befe14d479da472d7be28;p=m6w6%2Flibmemcached Fix for 64 bit --- diff --git a/ChangeLog b/ChangeLog index 1d48faa4..e2ef7733 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 0.16 * Work on the UDP protocol * Added get_by_key, set_by_key tests for C++ API + * Fix for limit_maxbytes to be 64bit in stats 0.15 Tue Jan 29 14:55:44 PST 2008 * More work on the C++ API. diff --git a/include/memcached.h b/include/memcached.h index 9fb5d1e2..095ac435 100644 --- a/include/memcached.h +++ b/include/memcached.h @@ -169,7 +169,7 @@ struct memcached_stat_st { uint32_t rusage_system_microseconds; uint32_t curr_items; uint32_t total_items; - uint32_t limit_maxbytes; + uint64_t limit_maxbytes; uint32_t curr_connections; uint32_t total_connections; uint32_t connection_structures; diff --git a/lib/memcached_hash.c b/lib/memcached_hash.c index 60c88e3b..0b46a865 100644 --- a/lib/memcached_hash.c +++ b/lib/memcached_hash.c @@ -19,6 +19,9 @@ unsigned int memcached_generate_hash(memcached_st *ptr, char *key, size_t key_le WATCHPOINT_ASSERT(ptr->number_of_hosts); + if (ptr->number_of_hosts == 1) + return 0; + switch (ptr->hash) { case MEMCACHED_HASH_DEFAULT: diff --git a/lib/memcached_stats.c b/lib/memcached_stats.c index 56ec80df..a1ef99f3 100644 --- a/lib/memcached_stats.c +++ b/lib/memcached_stats.c @@ -192,7 +192,7 @@ char *memcached_stat_get_value(memcached_st *ptr, memcached_stat_st *stat, else if (!memcmp("bytes_written", key, strlen("bytes_written"))) length= snprintf(buffer, SMALL_STRING_LEN,"%llu", (unsigned long long)stat->bytes_written); else if (!memcmp("limit_maxbytes", key, strlen("limit_maxbytes"))) - length= snprintf(buffer, SMALL_STRING_LEN,"%u", stat->limit_maxbytes); + length= snprintf(buffer, SMALL_STRING_LEN,"%llu", stat->limit_maxbytes); else if (!memcmp("threads", key, strlen("threads"))) length= snprintf(buffer, SMALL_STRING_LEN,"%u", stat->threads); else