[tor-commits] [flashproxy/master] Code uniformity.

dcf at torproject.org dcf at torproject.org
Sun May 19 16:11:39 UTC 2013


commit 8692851568c88ffb4fd2a387ba2ef4f12c99e69f
Author: David Fifield <david at bamsoftware.com>
Date:   Sat May 18 22:45:25 2013 -0700

    Code uniformity.
---
 flashproxy-reg-appspot |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/flashproxy-reg-appspot b/flashproxy-reg-appspot
index c1c9763..f0c5d5e 100755
--- a/flashproxy-reg-appspot
+++ b/flashproxy-reg-appspot
@@ -10,6 +10,7 @@ import urllib2
 
 from M2Crypto import RSA, BIO
 
+DEFAULT_REMOTE_ADDRESS = None
 DEFAULT_REMOTE_PORT = 9000
 DEFAULT_FACILITATOR_URL = "https://fp-facilitator.org/"
 DEFAULT_FACILITATOR_PUBKEY_PEM = """\
@@ -127,13 +128,13 @@ for o, a in opt:
         sys.exit()
 
 if len(args) != 1:
-    usage(f=sys.stderr)
+    usage(sys.stderr)
     sys.exit(1)
 
-remote_addr = parse_addr_spec(args[0], defport=DEFAULT_REMOTE_PORT)
-if remote_addr[0] is None:
+remote_addr = parse_addr_spec(args[0], DEFAULT_REMOTE_ADDRESS, DEFAULT_REMOTE_PORT)
+if not remote_addr[0]:
     remote_addr = parse_addr_spec(get_external_ip(), defport=remote_addr[1])
-if remote_addr[0] is None:
+if not remote_addr[0]:
     print >> sys.stderr, "Could not determine external ip address."
     sys.exit(1)
 





More information about the tor-commits mailing list