for (uint32_t x= 0; x < pointer_per_hash; x++)
{
uint32_t value= ketama_server_hash(sort_host, (size_t)sort_host_length, x);
- ptr->ketama.continuum[continuum_index].index= host_index;
- ptr->ketama.continuum[continuum_index++].value= value;
+ ptr->ketama.continuum[continuum_index].index= host_index;
+ ptr->ketama.continuum[continuum_index++].value= value;
}
}
else
{
for (uint32_t x = 0; x < pointer_per_hash; x++)
{
- uint32_t value= ketama_server_hash(sort_host, (size_t)sort_host_length, x);
- ptr->ketama.continuum[continuum_index].index= host_index;
- ptr->ketama.continuum[continuum_index++].value= value;
+ uint32_t value= ketama_server_hash(sort_host, (size_t)sort_host_length, x);
+ ptr->ketama.continuum[continuum_index].index= host_index;
+ ptr->ketama.continuum[continuum_index++].value= value;
}
}
else
return run_distribution(ptr);
}
+
+memcached_return_t memcached_server_add_parsed(memcached_st *ptr,
+ const char *hostname,
+ size_t hostname_length,
+ in_port_t port,
+ uint32_t weight)
+{
+ char buffer[NI_MAXHOST];
+
+ memcpy(buffer, hostname, hostname_length);
+ buffer[hostname_length]= 0;
+
+ return server_add(ptr, buffer,
+ port,
+ weight,
+ MEMCACHED_CONNECTION_TCP);
+}