AC_INIT(clients/memcat.c)
AC_CONFIG_AUX_DIR(config)
-AM_CONFIG_HEADER(libmemcached/libmemcached_config.h) AC_CANONICAL_SYSTEM MEMCACHED_LIBRARY_NAME=libmemcached #release versioning
+AM_CONFIG_HEADER(libmemcached/libmemcached_config.h)
+AC_CANONICAL_SYSTEM
+
+MEMCACHED_LIBRARY_NAME=libmemcached
+
+#release versioning
MEMCACHED_MAJOR_VERSION=0
MEMCACHED_MINOR_VERSION=22
MEMCACHED_MICRO_VERSION=0
uint32_t generate_hash_value(const char *key, size_t key_length, memcached_hash hash_algorithm);
uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length);
-memcached_return server_remove(memcached_server_st *st_ptr);
+memcached_return memcached_server_remove(memcached_server_st *st_ptr);
extern uint64_t ntohll(uint64_t);
extern uint64_t htonll(uint64_t);
uint32_t continuum_points_counter;
int32_t snd_timeout;
int32_t rcv_timeout;
- int32_t server_failure_limit;
+ uint32_t server_failure_limit;
};
ptr->rcv_timeout= (int32_t)data;
break;
case MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT:
- ptr->server_failure_limit= (int32_t)data;
+ ptr->server_failure_limit= (uint32_t)data;
break;
case MEMCACHED_BEHAVIOR_BINARY_PROTOCOL:
set_behavior_flag(ptr, MEM_BINARY_PROTOCOL, data);
if(ptr->root->server_failure_limit != 0) {
if(ptr->server_failure_counter >= ptr->root->server_failure_limit) {
- server_remove(ptr);
+ memcached_server_remove(ptr);
}
}
/* Old connection junk still is in the structure */
return run_distribution(ptr);
}
-memcached_return server_remove(memcached_server_st *st_ptr)
+memcached_return memcached_server_remove(memcached_server_st *st_ptr)
{
- int i,index;
+ int x,index;
memcached_st *ptr= st_ptr->root;
memcached_server_st *list=ptr->hosts;
index= 0;
- for(i= 0; i< ptr->number_of_hosts; ++i) {
- if(strncmp(list[i].hostname, st_ptr->hostname, MEMCACHED_MAX_HOST_LENGTH)!=0 || list[i].port != st_ptr->port) {
- memcpy(list+index, list+i, sizeof(memcached_server_st));
+ for (x= 0; x< ptr->number_of_hosts; ++x)
+ {
+ if (strncmp(list[x].hostname, st_ptr->hostname, MEMCACHED_MAX_HOST_LENGTH)!=0 || list[x].port != st_ptr->port)
+ {
+ memcpy(list+index, list+x, sizeof(memcached_server_st));
index++;
- } else {
+ } else
+ {
ptr->number_of_hosts-=1;
}
}
- if(st_ptr->address_info) {
+ if(st_ptr->address_info)
+ {
freeaddrinfo(st_ptr->address_info);
}
run_distribution(ptr);