[tor-commits] [flashproxy/rtmfp] Do getaddrinfo on the HOST and PORT from the command line to convert

dcf at torproject.org dcf at torproject.org
Fri Jun 10 13:59:54 UTC 2011


commit 4401b29b2c28566b1e808d606e3834504afc064e
Author: David Fifield <david at bamsoftware.com>
Date:   Thu May 26 23:05:19 2011 -0700

    Do getaddrinfo on the HOST and PORT from the command line to convert
    text port identifier to numbers.
---
 facilitator.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/facilitator.py b/facilitator.py
index c9859db..d5bac75 100755
--- a/facilitator.py
+++ b/facilitator.py
@@ -259,13 +259,15 @@ else:
     usage(sys.stderr)
     sys.exit(1)
 
+addrinfo = socket.getaddrinfo(address[0], address[1], 0, socket.SOCK_STREAM, socket.IPPROTO_TCP)[0]
+
 class Server(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):
     pass
 
 # Setup the server
-server = Server(address, Handler)
+server = Server(addrinfo[4], Handler)
 
-log(u"start on %s" % format_addr(address))
+log(u"start on %s" % format_addr(addrinfo[4]))
 
 if options.daemonize:
     log(u"daemonizing")





More information about the tor-commits mailing list