}
if (server->address_info)
+ {
freeaddrinfo(server->address_info);
+ server->address_info= NULL;
+ }
server->address_info= ai;
return MEMCACHED_SUCCESS;
if (ptr->server_failure_counter >= ptr->root->server_failure_limit)
{
memcached_server_remove(ptr);
+ return MEMCACHED_FAILURE;
}
}
/* Old connection junk still is in the structure */
memcpy(list+index, list+x, sizeof(memcached_server_st));
index++;
}
- else
- {
- ptr->number_of_hosts--;
- }
}
-
+ ptr->number_of_hosts= index;
if (st_ptr->address_info)
+ {
freeaddrinfo(st_ptr->address_info);
+ st_ptr->address_info= NULL;
+ }
run_distribution(ptr);
return MEMCACHED_SUCCESS;