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

[tor-commits] [flashproxy/master] Allow --register-addr to inherit from the remote spec.



commit 4b0292e01bca5aa6e2585340f8bd8a2a09034682
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Sun Sep 23 16:30:12 2012 -0700

    Allow --register-addr to inherit from the remote spec.
    
    That is, if you've set a remote port, but gave no port for
    --register-addr, then --register-addr takes the port from the remote
    spec.
---
 flashproxy-client |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/flashproxy-client b/flashproxy-client
index 637cdc5..f0491dd 100755
--- a/flashproxy-client
+++ b/flashproxy-client
@@ -870,6 +870,8 @@ def main():
             report_pending()
 
 if __name__ == "__main__":
+    register_addr_spec = None
+
     opts, args = getopt.gnu_getopt(sys.argv[1:], "f:hl:r", ["daemon", "facilitator=", "help", "log=", "pidfile=", "register", "register-addr=", "unsafe-logging"])
     for o, a in opts:
         if o == "--daemon":
@@ -890,7 +892,7 @@ if __name__ == "__main__":
                 print >> sys.stderr, "%s: only one --register-addr is allowed." % sys.argv[0]
                 sys.exit(1)
             options.register = True
-            options.register_addr = parse_addr_spec(a, defport=DEFAULT_REMOTE_PORT)
+            register_addr_spec = a
         elif o == "--unsafe-logging":
             options.safe_logging = False
 
@@ -927,8 +929,7 @@ if __name__ == "__main__":
         options.remote_addrs.append(("0.0.0.0", remote_addr[1]))
         if socket.has_ipv6:
             options.remote_addrs.append(("::", remote_addr[1]))
-    if options.register_addr is None:
-        options.register_addr = remote_addr
+    options.register_addr = parse_addr_spec(register_addr_spec or ":", *remote_addr)
 
     # Local sockets, accepting SOCKS requests from localhost
     local_listen = []



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