summaryrefslogtreecommitdiff
path: root/slabs.c
diff options
context:
space:
mode:
authorToru Maesaka <dev@torum.net>2008-09-09 17:24:00 +0900
committerDustin Sallings <dustin@spy.net>2009-01-03 00:09:09 -0800
commitdf8cf5e79376c28327cb94c63839f9988a7f9f39 (patch)
tree77735db84d82784b29ed66064fab209ca7fe9054 /slabs.c
parenta41b74df5d8e2d76c205f8536d385e42ff5593e8 (diff)
downloadmemcached-df8cf5e79376c28327cb94c63839f9988a7f9f39.tar.gz
Support of item stats via the binary protocol.
Diffstat (limited to 'slabs.c')
-rw-r--r--slabs.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/slabs.c b/slabs.c
index ab9f633..25461ac 100644
--- a/slabs.c
+++ b/slabs.c
@@ -311,13 +311,13 @@ char *get_stats(const bool bin_prot, const char *stat_type,
int size = 0;
*buflen = 0;
- if(!stat_type) {
- if((buf = malloc(512)) == NULL)
+ if (!stat_type) {
+ if ((buf = malloc(512)) == NULL)
return NULL;
pos = buf;
- if(bin_prot) {
- if(add_stats == NULL) {
+ if (bin_prot) {
+ if (add_stats == NULL) {
free(buf);
return NULL;
}
@@ -353,7 +353,12 @@ char *get_stats(const bool bin_prot, const char *stat_type,
*buflen = strlen(buf);
return buf;
}
+ } else if (strcmp(stat_type, "items") == 0) {
+ buf = item_stats(&size, add_stats, bin_prot);
+ *buflen = size;
+ return buf;
}
+
return NULL;
}