projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fix for bug #15450
[m6w6/libmemcached]
/
libmemcached
/
memcached.c
diff --git
a/libmemcached/memcached.c
b/libmemcached/memcached.c
index a6b38067642fd36113329b96394bfeed862eaeea..203f0984704bde38999aba6aee88498346f0a65a 100644
(file)
--- a/
libmemcached/memcached.c
+++ b/
libmemcached/memcached.c
@@
-22,6
+22,8
@@
memcached_st *memcached_create(memcached_st *ptr)
}
ptr->options.is_initialized= true;
}
ptr->options.is_initialized= true;
+ ptr->options.is_purging= false;
+ ptr->options.is_processing_input= false;
memcached_set_memory_allocators(ptr, NULL, NULL, NULL, NULL);
memcached_set_memory_allocators(ptr, NULL, NULL, NULL, NULL);
@@
-52,25
+54,29
@@
void server_list_free(memcached_st *ptr, memcached_server_st *servers)
return;
for (x= 0; x < memcached_servers_count(servers); x++)
return;
for (x= 0; x < memcached_servers_count(servers); x++)
+ {
if (servers[x].address_info)
{
freeaddrinfo(servers[x].address_info);
servers[x].address_info= NULL;
}
if (servers[x].address_info)
{
freeaddrinfo(servers[x].address_info);
servers[x].address_info= NULL;
}
+ }
if (ptr)
{
ptr->call_free(ptr, servers);
}
else
if (ptr)
{
ptr->call_free(ptr, servers);
}
else
+ {
free(servers);
free(servers);
+ }
}
void memcached_servers_reset(memcached_st *ptr)
{
}
void memcached_servers_reset(memcached_st *ptr)
{
- server_list_free(ptr,
ptr->hosts
);
+ server_list_free(ptr,
memcached_server_list(ptr)
);
-
ptr->hosts= NULL
;
+
memcached_server_list_set(ptr, NULL)
;
ptr->number_of_hosts= 0;
ptr->last_disconnected_server= NULL;
ptr->server_failure_limit= 0;
ptr->number_of_hosts= 0;
ptr->last_disconnected_server= NULL;
ptr->server_failure_limit= 0;
@@
-80,7
+86,7
@@
void memcached_free(memcached_st *ptr)
{
/* If we have anything open, lets close it now */
memcached_quit(ptr);
{
/* If we have anything open, lets close it now */
memcached_quit(ptr);
- server_list_free(ptr,
ptr->hosts
);
+ server_list_free(ptr,
memcached_server_list(ptr)
);
memcached_result_free(&ptr->result);
if (ptr->on_cleanup)
memcached_result_free(&ptr->result);
if (ptr->on_cleanup)
@@
-150,8
+156,8
@@
memcached_st *memcached_clone(memcached_st *clone, memcached_st *source)
new_clone->io_key_prefetch= source->io_key_prefetch;
new_clone->number_of_replicas= source->number_of_replicas;
new_clone->io_key_prefetch= source->io_key_prefetch;
new_clone->number_of_replicas= source->number_of_replicas;
- if (
source->hosts
)
- rc= memcached_server_push(new_clone,
source->hosts
);
+ if (
memcached_server_list(source)
)
+ rc= memcached_server_push(new_clone,
memcached_server_list(source)
);
if (rc != MEMCACHED_SUCCESS)
{
if (rc != MEMCACHED_SUCCESS)
{