projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Null
[m6w6/libmemcached]
/
lib
/
memcached_stats.c
diff --git
a/lib/memcached_stats.c
b/lib/memcached_stats.c
index ed2c0e20ffc2d4d7577ae57184eeb3b13e89f236..644ca70d41d24f722731cab263a73482f6c7202e 100644
(file)
--- a/
lib/memcached_stats.c
+++ b/
lib/memcached_stats.c
@@
-1,7
+1,7
@@
/*
*/
/*
*/
-#include
<memcached.h>
+#include
"common.h"
static char *memcached_stat_keys[] = {
"pid",
static char *memcached_stat_keys[] = {
"pid",
@@
-240,7
+240,7
@@
static memcached_return memcached_stats_fetch(memcached_st *ptr,
if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
return MEMCACHED_WRITE_FAILURE;
if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
return MEMCACHED_WRITE_FAILURE;
- sent_length=
write(ptr->hosts[server_key].fd, buffer, send_length
);
+ sent_length=
memcached_io_write(ptr, server_key, buffer, send_length, 1
);
if (sent_length == -1 || sent_length != send_length)
return MEMCACHED_WRITE_FAILURE;
if (sent_length == -1 || sent_length != send_length)
return MEMCACHED_WRITE_FAILURE;
@@
-313,7
+313,7
@@
memcached_return memcached_stat_servername(memcached_stat_st *stat, char *args,
memcached_return rc;
memcached_st memc;
memcached_return rc;
memcached_st memc;
- memcached_
init
(&memc);
+ memcached_
create
(&memc);
memcached_server_add(&memc, hostname, port);
memcached_server_add(&memc, hostname, port);
@@
-324,7
+324,7
@@
memcached_return memcached_stat_servername(memcached_stat_st *stat, char *args,
rc= memcached_stats_fetch(&memc, stat, args, 0);
rc= memcached_stats_fetch(&memc, stat, args, 0);
- memcached_
deinit
(&memc);
+ memcached_
free
(&memc);
return rc;
}
return rc;
}
@@
-338,6
+338,8
@@
char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat,
{
char **list= (char **)malloc(sizeof(memcached_stat_keys));
{
char **list= (char **)malloc(sizeof(memcached_stat_keys));
+ memset(list, 0, sizeof(memcached_stat_keys));
+
if (!list)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
if (!list)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;