+
+ /* NOTREACHED */
+}
+
+/*
+ One day make this public, and have it return the actual memcached_server_st
+ to the calling application.
+*/
+uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_length)
+{
+ uint32_t hash= 1; /* Just here to remove compile warning */
+
+ WATCHPOINT_ASSERT(ptr->number_of_hosts);
+
+ if (ptr->number_of_hosts == 1)
+ return 0;
+
+ if (ptr->flags & MEM_HASH_WITH_PREFIX_KEY)
+ {
+ size_t temp_length= ptr->prefix_key_length + key_length;
+ char temp[temp_length];
+
+ if (temp_length > MEMCACHED_MAX_KEY -1)
+ return 0;
+
+ strncpy(temp, ptr->prefix_key, ptr->prefix_key_length);
+ strncpy(temp + ptr->prefix_key_length, key, key_length);
+ hash= generate_hash(ptr, temp, temp_length);
+ }