[tor-bugs] #6175 [BridgeDB]: BridgeDB learns to choose a reasonable number of bridges to give out

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sat Jun 16 00:43:35 UTC 2012


#6175: BridgeDB learns to choose a reasonable number of bridges to give out
-------------------------+--------------------------------------------------
 Reporter:  aagbsn       |          Owner:  aagbsn
     Type:  enhancement  |         Status:  new   
 Priority:  normal       |      Milestone:        
Component:  BridgeDB     |        Version:        
 Keywords:               |         Parent:        
   Points:               |   Actualpoints:        
-------------------------+--------------------------------------------------

Comment(by aagbsn):

 {{{
 diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py
 index ec13fb5..31cfcca 100644
 --- a/lib/bridgedb/Dist.py
 +++ b/lib/bridgedb/Dist.py
 @@ -187,7 +187,10 @@ class
 IPBasedDistributor(bridgedb.Bridges.BridgeHolder):
                                    populate_from=self.splitter.bridges)

          # get the bridge.
 -        return ring.getBridges(pos, N)
 +        # determine an appropriate number of bridges
 +        # XXX: assumes that N is the distributor configured maximum
 +        bridges_per_answer = min(min(len(ring) * .05, 1), N)
 +        return ring.getBridges(pos, bridges_per_answer)

      def __len__(self):
          return len(self.splitter)
 @@ -389,7 +392,9 @@ class
 EmailBasedDistributor(bridgedb.Bridges.BridgeHolder):
 filterBridgesByRules(bridgeFilterRules),
                                    populate_from=self.splitter.bridges)

 -        result = ring.getBridges(pos, N)
 +        # XXX: assumes that N is the distributor configured maximum
 +        bridges_per_answer = min(min(len(ring) * .05, 1), N)
 +        result = ring.getBridges(pos, bridges_per_answer)

          db.setEmailTime(emailaddress, now)
          db.commit()
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6175#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list