Merging bzr://gaz.tangent.org/libmemcached/build2/ to Build branch
[m6w6/libmemcached] / libmemcached / hash.cc
index e239320d3b02f26451ae730843838245b1e4a015..42e4698930fc716a3327dab75e1c3715bcc060ae 100644 (file)
@@ -64,7 +64,6 @@ static uint32_t dispatch_host(const memcached_st *ptr, uint32_t hash)
       uint32_t num= ptr->ketama.continuum_points_counter;
       WATCHPOINT_ASSERT(ptr->ketama.continuum);
 
-      hash= hash;
       memcached_continuum_item_st *begin, *end, *left, *right, *middle;
       begin= left= ptr->ketama.continuum;
       end= right= ptr->ketama.continuum + num;
@@ -107,16 +106,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);
   }
@@ -132,7 +131,7 @@ static inline void _regen_for_auto_eject(memcached_st *ptr)
   {
     struct timeval now;
 
-    if (gettimeofday(&now, NULL) == 0 &&
+    if (gettimeofday(&now, NULL) == 0 and
         now.tv_sec > ptr->ketama.next_distribution_rebuild)
     {
       run_distribution(ptr);