aboutsummaryrefslogtreecommitdiffstats
path: root/src/kvstorage_bdb.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-01 16:45:38 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-03-01 16:45:38 +0400
commit7dcf9f9bade26ca02b8706a2e4cb2066f6ba7b00 (patch)
treef69121ee5c1a0e43fe987db8ed2c9e5cc66c79f0 /src/kvstorage_bdb.c
parentc93cca709b13da41b8d5bcd08874d75669e125f0 (diff)
downloadrspamd-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_bdb.c')
-rw-r--r--src/kvstorage_bdb.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/kvstorage_bdb.c b/src/kvstorage_bdb.c
index 99203285a..7970291f6 100644
--- a/src/kvstorage_bdb.c
+++ b/src/kvstorage_bdb.c
@@ -157,13 +157,18 @@ rspamd_bdb_init (struct rspamd_kv_backend *backend)
*/
db->envp->set_lk_detect (db->envp, DB_LOCK_DEFAULT);
+ /*
+ * Avoid explicit sync on committing
+ */
+ db->envp->set_flags (db->envp, DB_TXN_NOSYNC, 1);
+
flags = DB_CREATE | DB_THREAD;
/* Create and open db pointer */
if ((ret = db_create (&db->dbp, db->envp, 0)) != 0) {
goto err;
}
- if ((ret = db->dbp->open (db->dbp, NULL, db->filename, NULL, DB_BTREE, flags, 0)) != 0) {
+ if ((ret = db->dbp->open (db->dbp, NULL, db->filename, NULL, DB_HASH, flags, 0)) != 0) {
goto err;
}