-static void host_reset(memcached_st *ptr, memcached_server_st *host,
- char *hostname, unsigned int port,
- memcached_connection type)
+
+memcached_return run_distribution(memcached_st *ptr)
+{
+ switch (ptr->distribution)
+ {
+ case MEMCACHED_DISTRIBUTION_CONSISTENT:
+ case MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA:
+ return update_continuum(ptr);
+ case MEMCACHED_DISTRIBUTION_MODULA:
+ if (ptr->flags & MEM_USE_SORT_HOSTS)
+ sort_hosts(ptr);
+ break;
+ case MEMCACHED_DISTRIBUTION_RANDOM:
+ break;
+ default:
+ WATCHPOINT_ASSERT(0); /* We have added a distribution without extending the logic */
+ }
+
+ return MEMCACHED_SUCCESS;
+}
+
+void host_reset(memcached_st *ptr, memcached_server_st *host,
+ const char *hostname, unsigned int port, uint32_t weight,
+ memcached_connection type)