unsigned int x;
unsigned int y;
unsigned int latch;
- unsigned int range;
-
- range= (MEMCACHED_WHEEL_SIZE / ptr->number_of_hosts);
/* Seed the Wheel */
memset(ptr->wheel, 0, sizeof(unsigned int) * MEMCACHED_WHEEL_SIZE);
memcached_connection type)
{
memset(host, 0, sizeof(memcached_server_st));
- memcpy(host->hostname, hostname, strlen(hostname));
+ strncpy(host->hostname, hostname, MEMCACHED_MAX_HOST_LENGTH - 1);
host->port= port;
host->fd= -1;
host->type= type;
unsigned int count;
memcached_server_st *new_host_list;
- if (!hostname)
- return ptr;
+ if (hostname == NULL || error == NULL)
+ return NULL;
if (!port)
port= MEMCACHED_DEFAULT_PORT;