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

[tor-commits] [flashproxy/master] Make find_client_addr return an Endpoint.



commit 8494d2b226fb56f68652dde8720533d0e7613d55
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Thu Oct 17 02:44:57 2013 -0700

    Make find_client_addr return an Endpoint.
---
 facilitator/fac.py                 |    4 +++-
 facilitator/facilitator-reg-daemon |    6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/facilitator/fac.py b/facilitator/fac.py
index 58db4cf..1ad1abd 100644
--- a/facilitator/fac.py
+++ b/facilitator/fac.py
@@ -160,7 +160,9 @@ def find_client_addr(body):
         client_specs = qs["client"]
         if len(client_specs) != 1:
             continue
-        return parse_addr_spec(client_specs[0])
+        addr = parse_addr_spec(client_specs[0])
+        transport = "websocket"
+        return Endpoint(addr, transport)
     return None
 
 
diff --git a/facilitator/facilitator-reg-daemon b/facilitator/facilitator-reg-daemon
index 77a6bc8..33921dd 100755
--- a/facilitator/facilitator-reg-daemon
+++ b/facilitator/facilitator-reg-daemon
@@ -107,9 +107,9 @@ class Handler(SocketServer.StreamRequestHandler):
         try:
             ciphertext = b64_ciphertext.decode("base64")
             plaintext = rsa.private_decrypt(ciphertext, RSA.pkcs1_oaep_padding)
-            client_addr = fac.find_client_addr(plaintext)
-            log(u"registering %s" % safe_str(fac.format_addr(client_addr)))
-            if fac.put_reg(FACILITATOR_ADDR, client_addr, "websocket"):
+            client_reg = fac.find_client_addr(plaintext)
+            log(u"registering %s" % safe_str(fac.format_addr(client_reg.addr)))
+            if fac.put_reg(FACILITATOR_ADDR, client_reg.addr, client_reg.transport):
                 print >> self.wfile, "OK"
             else:
                 print >> self.wfile, "FAIL"



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits