tolerate duplicate fragment ids
authorChristian Grothoff <christian@grothoff.org>
Tue, 19 Jul 2011 09:30:23 +0000 (09:30 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 19 Jul 2011 09:30:23 +0000 (09:30 +0000)
src/fragmentation/test_fragmentation.c

index 1a231bbb45e57f3e9e9b16159d724d7885a480ce..70fd84944d45078fea0bc9ef100e93efd36754e8 100644 (file)
@@ -81,7 +81,8 @@ proc_msgs (void *cls,
   if (0 == (total % (NUM_MSGS / 100)))
     fprintf (stderr, ".");
 #endif
-  if (total == NUM_MSGS)
+  /* tolerate 10% loss, i.e. due to duplicate fragment IDs */
+  if (total >= NUM_MSGS - (NUM_MSGS / 10))
     {
       ret = 0;
       GNUNET_DEFRAGMENT_context_destroy (defrag);