diff options
author | dormando <dormando@rydia.net> | 2023-04-20 21:19:05 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2023-04-20 21:19:05 -0700 |
commit | 1e17c001682e4989db6458370a63a929ac0f107f (patch) | |
tree | 62d5cdef220311126bd586441beebd2ee9a35c81 | |
parent | 8e1058b9380ffe045234fcbbd50554d615dca3b0 (diff) | |
download | memcached-1e17c001682e4989db6458370a63a929ac0f107f.tar.gz |
proxy: don't print null ustats from "stats proxy"
If you had a numerical gap you would print junk.
-rw-r--r-- | proto_proxy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/proto_proxy.c b/proto_proxy.c index 2e1a2df..842f166 100644 --- a/proto_proxy.c +++ b/proto_proxy.c @@ -89,8 +89,10 @@ void process_proxy_stats(void *arg, ADD_STAT add_stats, conn *c) { // return all of the user generated stats for (int x = 0; x < us->num_stats; x++) { - snprintf(key_str, STAT_KEY_LEN-1, "user_%s", us->names[x]); - APPEND_STAT(key_str, "%llu", (unsigned long long)counters[x]); + if (us->names[x]) { + snprintf(key_str, STAT_KEY_LEN-1, "user_%s", us->names[x]); + APPEND_STAT(key_str, "%llu", (unsigned long long)counters[x]); + } } STAT_UL(ctx); |