aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/hash.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-19 17:28:09 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-19 17:28:09 +0100
commit406063d0a3354cbae40a00e8fcdb6cab55a58a08 (patch)
treee1ceaf0cf1d13a1aa102f7805cb5ff7322206408 /src/libutil/hash.c
parent7e4b88f7bc3ccccbf462a62de865beff388deae6 (diff)
downloadrspamd-406063d0a3354cbae40a00e8fcdb6cab55a58a08.tar.gz
rspamd-406063d0a3354cbae40a00e8fcdb6cab55a58a08.zip
[CritFix] Fix ttl based expiration from LRU cache
Diffstat (limited to 'src/libutil/hash.c')
-rw-r--r--src/libutil/hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/hash.c b/src/libutil/hash.c
index ddf916c20..f1279798a 100644
--- a/src/libutil/hash.c
+++ b/src/libutil/hash.c
@@ -122,7 +122,7 @@ rspamd_lru_hash_lookup (rspamd_lru_hash_t *hash, gconstpointer key, time_t now)
res = g_hash_table_lookup (hash->tbl, key);
if (res != NULL) {
if (res->ttl != 0) {
- if (((guint)now) - res->helt.pri > res->ttl) {
+ if (((guint)now) - res->storage > res->ttl) {
rspamd_min_heap_remove_elt (hash->heap, &res->helt);
g_hash_table_remove (hash->tbl, key);
return NULL;