projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Updated for custom hash functions/setting functions.
[awesomized/libmemcached]
/
libmemcached
/
stats.c
diff --git
a/libmemcached/stats.c
b/libmemcached/stats.c
index cf7f4d68355cc87fc668be0a0775c39407e04b0d..6378d89e0a2d087336c672b39a37f4890750cb1f 100644
(file)
--- a/
libmemcached/stats.c
+++ b/
libmemcached/stats.c
@@
-219,7
+219,7
@@
char *memcached_stat_get_value(memcached_st *ptr, memcached_stat_st *memc_stat,
return NULL;
}
return NULL;
}
- ret=
ptr->call
_malloc(ptr, (size_t) (length + 1));
+ ret=
libmemcached
_malloc(ptr, (size_t) (length + 1));
memcpy(ret, buffer, (size_t) length);
ret[length]= '\0';
memcpy(ret, buffer, (size_t) length);
ret[length]= '\0';
@@
-357,7
+357,6
@@
error:
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_return_t *error)
{
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_return_t *error)
{
- uint32_t x;
memcached_return_t rc;
memcached_stat_st *stats;
memcached_return_t rc;
memcached_stat_st *stats;
@@
-367,31
+366,34
@@
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_retur
return NULL;
}
return NULL;
}
- stats=
ptr->call
_calloc(ptr, memcached_server_count(ptr), sizeof(memcached_stat_st));
+ stats=
libmemcached
_calloc(ptr, memcached_server_count(ptr), sizeof(memcached_stat_st));
- stats->root= ptr;
-
- if (!stats)
+ if (! stats)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
return NULL;
}
rc= MEMCACHED_SUCCESS;
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
return NULL;
}
rc= MEMCACHED_SUCCESS;
- for (x= 0; x < memcached_server_count(ptr); x++)
+ for (
uint32_t
x= 0; x < memcached_server_count(ptr); x++)
{
memcached_return_t temp_return;
memcached_server_instance_st *instance;
{
memcached_return_t temp_return;
memcached_server_instance_st *instance;
+ memcached_stat_st *stat_instance;
+
+ stat_instance= stats + x;
+
+ stat_instance->root= ptr;
instance= memcached_server_instance_fetch(ptr, x);
if (ptr->flags.binary_protocol)
{
instance= memcached_server_instance_fetch(ptr, x);
if (ptr->flags.binary_protocol)
{
- temp_return= binary_stats_fetch(stat
s + x
, args, instance);
+ temp_return= binary_stats_fetch(stat
_instance
, args, instance);
}
else
{
}
else
{
- temp_return= ascii_stats_fetch(stat
s + x
, args, instance);
+ temp_return= ascii_stats_fetch(stat
_instance
, args, instance);
}
if (temp_return != MEMCACHED_SUCCESS)
}
if (temp_return != MEMCACHED_SUCCESS)
@@
-435,16
+437,18
@@
memcached_return_t memcached_stat_servername(memcached_stat_st *memc_stat, char
We make a copy of the keys since at some point in the not so distant future
we will add support for "found" keys.
*/
We make a copy of the keys since at some point in the not so distant future
we will add support for "found" keys.
*/
-char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *memc_stat,
+char ** memcached_stat_get_keys(memcached_st *ptr,
+ memcached_stat_st *memc_stat,
memcached_return_t *error)
{
memcached_return_t *error)
{
- (void) memc_stat;
char **list;
size_t length= sizeof(memcached_stat_keys);
char **list;
size_t length= sizeof(memcached_stat_keys);
- list= ptr->call_malloc(ptr, length);
+ (void)memc_stat;
+
+ list= libmemcached_malloc(ptr, length);
- if (!list)
+ if (!
list)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
return NULL;
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
return NULL;
@@
-467,11
+471,11
@@
void memcached_stat_free(memcached_st *ptr, memcached_stat_st *memc_stat)
if (memc_stat->root)
{
if (memc_stat->root)
{
-
memc_stat->root->call_free(ptr
, memc_stat);
+
libmemcached_free(memc_stat->root
, memc_stat);
}
else if (ptr)
{
}
else if (ptr)
{
-
ptr->call
_free(ptr, memc_stat);
+
libmemcached
_free(ptr, memc_stat);
}
else
{
}
else
{