[tor-commits] [flashproxy/master] Store relays as addr tuples, not as strings.

infinity0 at torproject.org infinity0 at torproject.org
Mon Oct 28 14:47:40 UTC 2013


commit 77a9e79d23a1d3c5a829124d8534dba7c9dd55d2
Author: David Fifield <david at bamsoftware.com>
Date:   Fri Sep 20 22:50:30 2013 -0700

    Store relays as addr tuples, not as strings.
---
 facilitator/facilitator |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/facilitator/facilitator b/facilitator/facilitator
index ff3ad2b..986b166 100755
--- a/facilitator/facilitator
+++ b/facilitator/facilitator
@@ -47,7 +47,7 @@ class options(object):
     @staticmethod
     def add_relay(addr, transport):
         RELAYS.setdefault(transport, [])
-        RELAYS[transport].append(fac.format_addr(addr))
+        RELAYS[transport].append(addr)
 
 def usage(f = sys.stdout):
     print >> f, """\
@@ -122,7 +122,7 @@ class TCPReg(object):
         self.relay = self._get_matching_relay()
 
     def _get_matching_relay(self):
-        """Return a matching relay addr_spec for this registration. Raise
+        """Return a matching relay address for this registration. Raise
         UnknownTransport if a relay with a matching transport chain could not be
         found."""
         if self.transports not in RELAYS:
@@ -306,7 +306,7 @@ class Handler(SocketServer.StreamRequestHandler):
         if reg:
             log(u"proxy (%s) gets client '%s' (transports: %s) (num relays: %s) (remaining regs: %d/%d)" %
                 (safe_str(repr(proxy_spec)), safe_str(unicode(reg)), reg.transports, num_relays(), num_unhandled_regs(), num_regs()))
-            print >> self.wfile, fac.render_transaction("OK", ("CLIENT", str(reg)), ("RELAY", reg.relay), ("CHECK-BACK-IN", str(check_back_in)))
+            print >> self.wfile, fac.render_transaction("OK", ("CLIENT", str(reg)), ("RELAY", fac.format_addr(reg.relay)), ("CHECK-BACK-IN", str(check_back_in)))
         else:
             log(u"proxy (%s) gets none" % safe_str(repr(proxy_spec)))
             print >> self.wfile, fac.render_transaction("NONE", ("CHECK-BACK-IN", str(check_back_in)))





More information about the tor-commits mailing list