[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r9723 - GNUnet/src/applications/dv_dht/module
From: |
gnunet |
Subject: |
[GNUnet-SVN] r9723 - GNUnet/src/applications/dv_dht/module |
Date: |
Wed, 9 Dec 2009 17:01:14 +0100 |
Author: grothoff
Date: 2009-12-09 17:01:14 +0100 (Wed, 09 Dec 2009)
New Revision: 9723
Modified:
GNUnet/src/applications/dv_dht/module/table.c
Log:
commenting on questions
Modified: GNUnet/src/applications/dv_dht/module/table.c
===================================================================
--- GNUnet/src/applications/dv_dht/module/table.c 2009-12-09 15:47:26 UTC
(rev 9722)
+++ GNUnet/src/applications/dv_dht/module/table.c 2009-12-09 16:01:14 UTC
(rev 9723)
@@ -318,6 +318,16 @@
* bucket. Why do all this nonsense? Also why break in error when we have
* a peer that matches lots of our bits? We WANT that peer in our table,
* but returning NULL and erroring out keeps it far far away from us!
+ *
+ * ANSWER:
+ * A bucket is for more than one bit distance; a bucket can be for a range
+ * of bit distances. I.e., we may have one bucket for 0 bits shared,
+ * one bucket for 1 bit shared, one bucket for 2 bits shared, one bucket
+ * for 2 or 3 bits shared and one bucket for 4 to N bits shared.
+ * Finally, if there are more bits shared than we have buckets for,
+ * our bucket initialization was wrong (the entire range was not covered!),
+ * so we throw an assertion failure and return NULL --- after all, how
+ * can another peer have all the same bits as we do but still be different?
*/
i = bucketCount - 1;
while ((buckets[i].bstart > index) && (i > 0))
@@ -991,11 +1001,17 @@
buckets[i].bend = 512 * (i + 1) / bucketCount;
}
*/
+ /* ANSWER:
+ GNUNET_array_grow updates bucketCount to i as a side effect -- it
+ is a really tricky macro, not a function call!
+ Other than the bucketCount = i which is a NO-OP here,
+ I don't see a difference between your new code and the
+ code commented out above... -CG */
/* So if we are trying to cover all locations with i (not bucketCount,
* which will always be zero at this point) we set bucketCount = i.
*/
- bucketCount = i;
+ bucketCount = i;
for (i = 0; i < bucketCount; i++)
{
buckets[i].bstart = 512 * i / bucketCount;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r9723 - GNUnet/src/applications/dv_dht/module,
gnunet <=