From 4cf87d6c3b8c35e331183c7e582f0410eb5bdf5f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 19 Dec 2011 09:32:53 +0000 Subject: [PATCH] fixing calculation of Bloom filter size that was too large by 1024x because it was not adjusted when the unit for the quota was changed from kb to bytes --- src/datastore/gnunet-service-datastore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index e6f822c59..6adc1132d 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c @@ -1526,10 +1526,10 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, cache_size = quota / 8; /* Or should we make this an option? */ GNUNET_STATISTICS_set (stats, gettext_noop ("# cache size"), cache_size, GNUNET_NO); - if (quota / 32LL > (1 << 31)) + if (quota / (32 * 1024LL) > (1 << 31)) bf_size = (1 << 31); /* absolute limit: ~2 GB, beyond that BF just won't help anyway */ else - bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */ + bf_size = quota / (32 * / 1024LL); /* 8 bit per entry, 1 bit per 32 kb in DB */ fn = NULL; if ((GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "DATASTORE", "BLOOMFILTER", -- 2.25.1