Update build bits.
[m6w6/libmemcached] / libmemcached / hash.cc
index 0e6295b8893cc9557fa0dc14d9cdacd08120a0d5..ae07dfd0ea466829df85e16d09633f7e8e53d4fc 100644 (file)
 
 
 #include <libmemcached/common.h>
-#include <libmemcached/virtual_bucket.h>
 
+#include <sys/time.h>
+
+#include <libmemcached/virtual_bucket.h>
 
 uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash_t hash_algorithm)
 {
@@ -60,7 +62,7 @@ static uint32_t dispatch_host(const memcached_st *ptr, uint32_t hash)
   case MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY:
     {
       uint32_t num= ptr->ketama.continuum_points_counter;
-      WATCHPOINT_ASSERT(ptr->continuum);
+      WATCHPOINT_ASSERT(ptr->ketama.continuum);
 
       hash= hash;
       memcached_continuum_item_st *begin, *end, *left, *right, *middle;
@@ -105,16 +107,16 @@ static inline uint32_t _generate_hash_wrapper(const memcached_st *ptr, const cha
   if (memcached_server_count(ptr) == 1)
     return 0;
 
-  if (ptr->flags.hash_with_prefix_key)
+  if (ptr->flags.hash_with_namespace)
   {
-    size_t temp_length= memcached_array_size(ptr->prefix_key) + key_length;
+    size_t temp_length= memcached_array_size(ptr->_namespace) + key_length;
     char temp[MEMCACHED_MAX_KEY];
 
     if (temp_length > MEMCACHED_MAX_KEY -1)
       return 0;
 
-    strncpy(temp, memcached_array_string(ptr->prefix_key), memcached_array_size(ptr->prefix_key));
-    strncpy(temp + memcached_array_size(ptr->prefix_key), key, key_length);
+    strncpy(temp, memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace));
+    strncpy(temp + memcached_array_size(ptr->_namespace), key, key_length);
 
     return generate_hash(ptr, temp, temp_length);
   }