aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/hash.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-02 22:17:48 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-02 22:17:48 +0000
commitcb515a1e358ee8ab130c66621c0ba87e3ee59935 (patch)
tree7e33ab4a2aabfe8b6f49f2cbbaa738b2dbf53415 /src/libutil/hash.c
parent4e5107dd39adb721d95cbb10bf17a16002ceaffb (diff)
downloadrspamd-cb515a1e358ee8ab130c66621c0ba87e3ee59935.tar.gz
rspamd-cb515a1e358ee8ab130c66621c0ba87e3ee59935.zip
Update keypairs cache.
Diffstat (limited to 'src/libutil/hash.c')
-rw-r--r--src/libutil/hash.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libutil/hash.c b/src/libutil/hash.c
index ec952e87b..9a9f98e2e 100644
--- a/src/libutil/hash.c
+++ b/src/libutil/hash.c
@@ -151,6 +151,10 @@ rspamd_lru_hash_lookup (rspamd_lru_hash_t *hash, gpointer key, time_t now)
return NULL;
}
}
+ else {
+ res->store_time = now;
+ }
+
return res->data;
}
@@ -188,6 +192,9 @@ rspamd_lru_hash_insert (rspamd_lru_hash_t *hash, gpointer key, gpointer value,
}
}
}
+ else {
+ /* XXX: use binary heap here */
+ }
if (removed == 0) {
rspamd_lru_hash_destroy_node (hash->elements);
}