From 3793fdb392266c08b59b2e5815f9db6a60c48fda Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Fri, 13 Mar 2009 10:54:04 +0100 Subject: [PATCH 1/1] Silently ignore the new stats fields The 1.3 beta includes new stats elements, so libmemcached will print out multiple error messages when you issue the stats call. memcached_stat_st is publicly available, so we cannot add new members to the struct without breaking binary compatibility. --- libmemcached/memcached_stats.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libmemcached/memcached_stats.c b/libmemcached/memcached_stats.c index 3ad236d2..1c8c174f 100644 --- a/libmemcached/memcached_stats.c +++ b/libmemcached/memcached_stats.c @@ -136,7 +136,15 @@ static void set_data(memcached_stat_st *stat, char *key, char *value) { stat->threads= strtol(value, (char **)NULL, 10); } - else + else if (!(strcmp("delete_misses", key) == 0 ||/* New stats in the 1.3 beta */ + strcmp("delete_hits", key) == 0 ||/* Just swallow them for now.. */ + strcmp("incr_misses", key) == 0 || + strcmp("incr_hits", key) == 0 || + strcmp("decr_misses", key) == 0 || + strcmp("decr_hits", key) == 0 || + strcmp("cas_misses", key) == 0 || + strcmp("cas_hits", key) == 0 || + strcmp("cas_badval", key) == 0)) { fprintf(stderr, "Unknown key %s\n", key); } -- 2.30.2