diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-03-01 16:45:38 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-03-01 16:45:38 +0400 |
commit | 7dcf9f9bade26ca02b8706a2e4cb2066f6ba7b00 (patch) | |
tree | f69121ee5c1a0e43fe987db8ed2c9e5cc66c79f0 /src/kvstorage.c | |
parent | c93cca709b13da41b8d5bcd08874d75669e125f0 (diff) | |
download | rspamd-7dcf9f9bade26ca02b8706a2e4cb2066f6ba7b00.tar.gz rspamd-7dcf9f9bade26ca02b8706a2e4cb2066f6ba7b00.zip |
Use DB_HASH access method for bdb backend.
Fix signed and unsigned comparasion while I'm here.
Diffstat (limited to 'src/kvstorage.c')
-rw-r--r-- | src/kvstorage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kvstorage.c b/src/kvstorage.c index f02f6a568..37d2022d9 100644 --- a/src/kvstorage.c +++ b/src/kvstorage.c @@ -403,7 +403,7 @@ rspamd_kv_storage_lookup (struct rspamd_kv_storage *storage, gpointer key, guint if (elt && (elt->flags & KV_ELT_PERSISTENT) == 0 && elt->expire > 0) { /* Check expiration */ - if (now - elt->age > elt->expire) { + if (now - elt->age > (gint)elt->expire) { /* Set need expire as we have no write lock here */ elt->flags |= KV_ELT_NEED_EXPIRE; elt = NULL; @@ -639,7 +639,7 @@ rspamd_lru_expire_step (struct rspamd_kv_expire *e, struct rspamd_kv_storage *st /* Check other elements in this queue */ TAILQ_FOREACH_SAFE (elt, &expire->head, entry, temp) { if ((!forced && - (elt->flags & (KV_ELT_PERSISTENT|KV_ELT_DIRTY)) != 0) || elt->expire < (now - elt->age)) { + (elt->flags & (KV_ELT_PERSISTENT|KV_ELT_DIRTY)) != 0) || (gint)elt->expire < (now - elt->age)) { break; } storage->memory -= ELT_SIZE (elt); |