[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [flashproxy/rtmfp] Do getaddrinfo on the HOST and PORT from the command line to convert
commit 4401b29b2c28566b1e808d606e3834504afc064e
Author: David Fifield <david@xxxxxxxxxxxxxxx>
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")
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits