[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r13336: real exits should also be chosen when using uniform, but not (torflow/trunk/TorCtl)



Author: renner
Date: 2008-01-30 10:26:14 -0500 (Wed, 30 Jan 2008)
New Revision: 13336

Modified:
   torflow/trunk/TorCtl/PathSupport.py
Log:
real exits should also be chosen when using uniform, but not order_exits

Modified: torflow/trunk/TorCtl/PathSupport.py
===================================================================
--- torflow/trunk/TorCtl/PathSupport.py	2008-01-30 00:21:04 UTC (rev 13335)
+++ torflow/trunk/TorCtl/PathSupport.py	2008-01-30 15:26:14 UTC (rev 13336)
@@ -656,8 +656,11 @@
         exitgen = self.__ordered_exit_gen = \
           OrderedExitGenerator(80, sorted_r, self.exit_rstr)
     elif self.uniform:
+      # 'real' exits should also be chosen when not using 'order_exits'
+      self.exit_rstr.add_restriction(ExitPolicyRestriction("255.255.255.255", 80)) 
       exitgen = UniformGenerator(sorted_r, self.exit_rstr)
     else:
+      self.exit_rstr.add_restriction(ExitPolicyRestriction("255.255.255.255", 80))
       exitgen = BwWeightedGenerator(sorted_r, self.exit_rstr, self.pathlen, exit=True)
 
     if self.uniform:
@@ -669,8 +672,6 @@
       # Remove ConserveExitsRestrictions for entry and middle positions
       entry_rstr.del_restriction(ConserveExitsRestriction)
       mid_rstr.del_restriction(ConserveExitsRestriction)
-      # Initially setup the PathSelector to port 80 and return      
-      self.exit_rstr.add_restriction(ExitPolicyRestriction("255.255.255.255", 80))
       self.path_selector = PathSelector(
          BwWeightedGenerator(sorted_r, entry_rstr, self.pathlen),
          BwWeightedGenerator(sorted_r, mid_rstr, self.pathlen),