From: Timo Sirainen Date: Fri, 5 Feb 2016 13:48:25 +0000 (+0200) Subject: auth: If auth cache lookup results in expired entry, it should be tracked in stats... X-Git-Tag: 2.2.22.rc1~205 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a6a995b34fbfab76265b9db43a910efef962173;p=thirdparty%2Fdovecot%2Fcore.git auth: If auth cache lookup results in expired entry, it should be tracked in stats as a "miss" --- diff --git a/src/auth/auth-cache.c b/src/auth/auth-cache.c index 16ce9db00f..7608ac8d0e 100644 --- a/src/auth/auth-cache.c +++ b/src/auth/auth-cache.c @@ -373,7 +373,6 @@ auth_cache_lookup(struct auth_cache *cache, const struct auth_request *request, cache->miss_count++; return NULL; } - cache->hit_count++; value = node->data + strlen(node->data) + 1; ttl_secs = *value == '\0' ? cache->neg_ttl_secs : cache->ttl_secs; @@ -381,6 +380,7 @@ auth_cache_lookup(struct auth_cache *cache, const struct auth_request *request, now = time(NULL); if (node->created < now - (time_t)ttl_secs) { /* TTL expired */ + cache->miss_count++; *expired_r = TRUE; } else { /* move to head */ @@ -388,6 +388,7 @@ auth_cache_lookup(struct auth_cache *cache, const struct auth_request *request, auth_cache_node_unlink(cache, node); auth_cache_node_link_head(cache, node); } + cache->hit_count++; } if (node->created < now - (time_t)cache->neg_ttl_secs) *neg_expired_r = TRUE;