projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Refactor test system to give me times on calling tests (frankly I still need
[m6w6/libmemcached]
/
lib
/
memcached_stats.c
diff --git
a/lib/memcached_stats.c
b/lib/memcached_stats.c
index b3a5781213e8f9f05368ed23f2ee085a431e0ee0..f71deb46c4d713a3acc7ee297c0d8edfc0a7f6e4 100644
(file)
--- a/
lib/memcached_stats.c
+++ b/
lib/memcached_stats.c
@@
-225,7
+225,7
@@
static memcached_return memcached_stats_fetch(memcached_st *ptr,
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
size_t send_length, sent_length;
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
size_t send_length, sent_length;
- rc= memcached_connect(ptr);
+ rc= memcached_connect(ptr
, server_key
);
if (rc != MEMCACHED_SUCCESS)
return rc;
if (rc != MEMCACHED_SUCCESS)
return rc;
@@
-247,7
+247,7
@@
static memcached_return memcached_stats_fetch(memcached_st *ptr,
while (1)
{
while (1)
{
- rc= memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
0
);
+ rc= memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
server_key
);
if (rc == MEMCACHED_STAT)
{
if (rc == MEMCACHED_STAT)
{
@@
-283,13
+283,6
@@
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_retur
memcached_return rc;
memcached_stat_st *stats;
memcached_return rc;
memcached_stat_st *stats;
- rc= memcached_connect(ptr);
- if (rc != MEMCACHED_SUCCESS)
- {
- *error= rc;
- return NULL;
- }
-
stats= (memcached_stat_st *)malloc(sizeof(memcached_st)*(ptr->number_of_hosts+1));
if (!stats)
{
stats= (memcached_stat_st *)malloc(sizeof(memcached_st)*(ptr->number_of_hosts+1));
if (!stats)
{
@@
-299,10
+292,12
@@
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_retur
}
memset(stats, 0, sizeof(memcached_st)*(ptr->number_of_hosts+1));
}
memset(stats, 0, sizeof(memcached_st)*(ptr->number_of_hosts+1));
+ rc= MEMCACHED_SUCCESS;
for (x= 0; x < ptr->number_of_hosts; x++)
{
for (x= 0; x < ptr->number_of_hosts; x++)
{
- rc= memcached_stats_fetch(ptr, stats+x, args, x);
- if (rc != MEMCACHED_SUCCESS)
+ memcached_return temp_return;
+ temp_return= memcached_stats_fetch(ptr, stats+x, args, x);
+ if (temp_return != MEMCACHED_SUCCESS)
rc= MEMCACHED_SOME_ERRORS;
}
rc= MEMCACHED_SOME_ERRORS;
}
@@
-320,11
+315,6
@@
memcached_return memcached_stat_servername(memcached_stat_st *stat, char *args,
memcached_server_add(&memc, hostname, port);
memcached_server_add(&memc, hostname, port);
- rc= memcached_connect(&memc);
-
- if (rc != MEMCACHED_SUCCESS)
- return rc;
-
rc= memcached_stats_fetch(&memc, stat, args, 0);
memcached_free(&memc);
rc= memcached_stats_fetch(&memc, stat, args, 0);
memcached_free(&memc);