fixing calculation of Bloom filter size that was too large by 1024x because it was...
authorChristian Grothoff <christian@grothoff.org>
Mon, 19 Dec 2011 09:32:53 +0000 (09:32 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 19 Dec 2011 09:32:53 +0000 (09:32 +0000)
src/datastore/gnunet-service-datastore.c

index e6f822c5959b545140518f018787a9daad2299f0..6adc1132d9ba656bd00b11b984d72f3c7717acb6 100644 (file)
@@ -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",