Support filter-size in fs block plugin
authorDavid Barksdale <amatus@amat.us>
Sun, 1 Oct 2017 22:19:05 +0000 (17:19 -0500)
committerDavid Barksdale <amatus@amat.us>
Sun, 1 Oct 2017 22:31:02 +0000 (17:31 -0500)
This should fix some assertions failures I'm seeing in the DHT service.

src/fs/plugin_block_fs.c

index 902519f15522acd241d27ccbedf0210795a8c717..c762835ce12de34398164e41b8c3ea6af7437e2e 100644 (file)
@@ -71,17 +71,22 @@ block_plugin_fs_create_group (void *cls,
     return NULL;
   case GNUNET_BLOCK_TYPE_FS_UBLOCK:
     guard = va_arg (va, const char *);
-    if (0 != strcmp (guard,
+    if (0 == strcmp (guard,
                      "seen-set-size"))
     {
-      /* va-args invalid! bad bug, complain! */
-      GNUNET_break (0);
-      size = 8;
+      size = GNUNET_BLOCK_GROUP_compute_bloomfilter_size (va_arg (va, unsigned int),
+                                                          BLOOMFILTER_K);
+    }
+    else if (0 == strcmp (guard,
+                          "filter-size"))
+    {
+      size = va_arg (va, unsigned int);
     }
     else
     {
-      size = GNUNET_BLOCK_GROUP_compute_bloomfilter_size (va_arg (va, unsigned int),
-                                                          BLOOMFILTER_K);
+      /* va-args invalid! bad bug, complain! */
+      GNUNET_break (0);
+      size = 8;
     }
     if (0 == size)
       size = raw_data_size; /* not for us to determine, use what we got! */