diff options
author | Toru Maesaka <dev@torum.net> | 2008-09-09 17:24:00 +0900 |
---|---|---|
committer | Dustin Sallings <dustin@spy.net> | 2009-01-03 00:09:09 -0800 |
commit | df8cf5e79376c28327cb94c63839f9988a7f9f39 (patch) | |
tree | 77735db84d82784b29ed66064fab209ca7fe9054 /slabs.c | |
parent | a41b74df5d8e2d76c205f8536d385e42ff5593e8 (diff) | |
download | memcached-df8cf5e79376c28327cb94c63839f9988a7f9f39.tar.gz |
Support of item stats via the binary protocol.
Diffstat (limited to 'slabs.c')
-rw-r--r-- | slabs.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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; } |