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 in behavior.
[m6w6/libmemcached]
/
lib
/
memcached.c
diff --git
a/lib/memcached.c
b/lib/memcached.c
index 8122e1e837876156fe8dc5d4a192d5fdadb26d7e..0bab79580661fc79781e7286d54389e224a8e3b3 100644
(file)
--- a/
lib/memcached.c
+++ b/
lib/memcached.c
@@
-1,9
+1,9
@@
/*
Memcached library
*/
/*
Memcached library
*/
-#include
<memcached.h>
+#include
"common.h"
-memcached_st *memcached_
init
(memcached_st *ptr)
+memcached_st *memcached_
create
(memcached_st *ptr)
{
if (!ptr)
{
{
if (!ptr)
{
@@
-23,21
+23,13
@@
memcached_st *memcached_init(memcached_st *ptr)
return ptr;
}
return ptr;
}
-void memcached_
deinit
(memcached_st *ptr)
+void memcached_
free
(memcached_st *ptr)
{
{
- unsigned int x;
-
if (ptr->hosts)
{
if (ptr->hosts)
{
- for (x= 0; x < ptr->number_of_hosts; x++)
- {
- if (ptr->hosts[x].fd > 0)
- close(ptr->hosts[x].fd);
-
- free(ptr->hosts[x].hostname);
- }
-
- free(ptr->hosts);
+ memcached_quit(ptr);
+ memcached_server_list_free(ptr->hosts);
+ ptr->hosts= NULL;
}
if (ptr->is_allocated == MEMCACHED_ALLOCATED)
}
if (ptr->is_allocated == MEMCACHED_ALLOCATED)