[tor-commits] [bridgedb/master] Fix part 1 of #2688:

karsten at torproject.org karsten at torproject.org
Thu Mar 31 13:20:03 UTC 2011


commit c3edb77408b5612078931992ef8e1e9e352d3c12
Author: Christian Fromme <kaner at strace.org>
Date:   Thu Mar 31 13:17:16 2011 +0200

    Fix part 1 of #2688:
        - Don't re-assign buckets when its not necessary.
---
 lib/bridgedb/Bucket.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/bridgedb/Bucket.py b/lib/bridgedb/Bucket.py
index 1d5d753..5b20f95 100644
--- a/lib/bridgedb/Bucket.py
+++ b/lib/bridgedb/Bucket.py
@@ -133,7 +133,7 @@ class BucketManager:
         """
         hex_key = self.unallocatedList.pop()
         # Mark pseudo-allocators in the database as such
-        allocator_name = self.distributor_prefix + bucket.name
+        allocator_name = bucket.name
         #print "KEY: %d NAME: %s" % (hex_key, allocator_name)
         try:
             self.db.updateDistributorForHexKey(allocator_name, hex_key)
@@ -157,7 +157,8 @@ class BucketManager:
         """
         # Build distributor list
         for k, v in self.cfg.FILE_BUCKETS.items():
-            d = BucketData(k, v)
+            prefixed_key = self.distributor_prefix + k
+            d = BucketData(prefixed_key, v)
             self.bucketList.append(d)
 
         # Loop through all bridges and sort out distributors





More information about the tor-commits mailing list