aboutsummaryrefslogtreecommitdiff
path: root/src/datacache
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-17 18:47:17 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-17 18:47:17 +0000
commit8f47080f45f5ecc1cdec238b2d3e688f74cfad8c (patch)
treeb26a1713076fd4f2d0527af5e14c8f28bd15a1cc /src/datacache
parentd73ab29514e8431ea6810cb943a2cd3f7a94e4fd (diff)
downloadgnunet-8f47080f45f5ecc1cdec238b2d3e688f74cfad8c.tar.gz
gnunet-8f47080f45f5ecc1cdec238b2d3e688f74cfad8c.zip
-tolerate bloomfilter creation failures bettter
Diffstat (limited to 'src/datacache')
-rw-r--r--src/datacache/datacache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c
index d68ba72b5..936031b91 100644
--- a/src/datacache/datacache.c
+++ b/src/datacache/datacache.c
@@ -161,10 +161,17 @@ GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg,
161 ret->filter = GNUNET_CONTAINER_bloomfilter_load (ret->bloom_name, quota / 1024, /* 8 bit per entry in DB, expect 1k entries */ 161 ret->filter = GNUNET_CONTAINER_bloomfilter_load (ret->bloom_name, quota / 1024, /* 8 bit per entry in DB, expect 1k entries */
162 5); 162 5);
163 } 163 }
164 else 164 if (NULL == ret->filter)
165 { 165 {
166 ret->filter = GNUNET_CONTAINER_bloomfilter_init (NULL, bf_size, 5); /* approx. 3% false positives at max use */ 166 ret->filter = GNUNET_CONTAINER_bloomfilter_init (NULL, bf_size, 5); /* approx. 3% false positives at max use */
167 } 167 }
168 if (NULL == ret->filter)
169 {
170 GNUNET_free (name);
171 GNUNET_free (ret->bloom_name);
172 GNUNET_free (ret);
173 return NULL;
174 }
168 ret->stats = GNUNET_STATISTICS_create ("datacache", cfg); 175 ret->stats = GNUNET_STATISTICS_create ("datacache", cfg);
169 ret->section = GNUNET_strdup (section); 176 ret->section = GNUNET_strdup (section);
170 ret->env.cfg = cfg; 177 ret->env.cfg = cfg;