diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-16 18:22:31 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-12-16 18:22:31 +0300 |
commit | b272d240f712e15a93478db124cbf4bd8f7496af (patch) | |
tree | 5c39d4c1ff9790fa69a5f45fcf093b63474c3a55 /src/kvstorage.c | |
parent | e5c2094331a24c95506764a122ffda88c5998836 (diff) | |
download | rspamd-b272d240f712e15a93478db124cbf4bd8f7496af.tar.gz rspamd-b272d240f712e15a93478db124cbf4bd8f7496af.zip |
* Add new plugin ip_score to set and get score for specified ip address.
Diffstat (limited to 'src/kvstorage.c')
-rw-r--r-- | src/kvstorage.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/kvstorage.c b/src/kvstorage.c index 4a4585094..76e58adba 100644 --- a/src/kvstorage.c +++ b/src/kvstorage.c @@ -343,9 +343,16 @@ rspamd_kv_storage_increment (struct rspamd_kv_storage *storage, gpointer key, gu lp = &ELT_LONG (elt); *lp += *value; *value = *lp; + elt->age = time (NULL); if (storage->backend) { - g_static_rw_lock_writer_unlock (&storage->rwlock); - return storage->backend->replace_func (storage->backend, key, keylen, elt); + if (storage->backend->replace_func (storage->backend, key, keylen, elt)) { + g_static_rw_lock_writer_unlock (&storage->rwlock); + return TRUE; + } + else { + g_static_rw_lock_writer_unlock (&storage->rwlock); + return FALSE; + } } else { g_static_rw_lock_writer_unlock (&storage->rwlock); |