commit 17eb811465e1755b328d23cf305483e2b27c406b Author: David Fifield david@bamsoftware.com Date: Thu Nov 14 23:50:06 2013 -0800
Remove a Python 2.7 dependency from flashproxy-reg-appspot.
The error was: Failed to get external IP address: PinHTTPSConnection instance has no attribute 'source_address' The documentation for httplib says this member was added in Python 2.7.
I discovered the problem while testing the 3.x pluggable transports bundles for Mac OS X. Because of the way M2Crypto is cross-compiled, running the flashproxy client programs requires Python 2.6. Failure to run flashproxy-reg-appspot means that the slower flashproxy-reg-email would be used instead. --- ChangeLog | 2 ++ flashproxy-reg-appspot | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 15c61f7..0a96dce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ o Enabled binary frames (avoiding the overhead of base64 encoding) for Firefox 11 and later. Patch by Arlo Breault. Fixes bug 9069.
+ o Removed a Python 2.7–dependent reference in flashproxy-reg-appspot. + Changes in version 1.4 o Allowed websocket-server to gracefully handle SIGTERM.
diff --git a/flashproxy-reg-appspot b/flashproxy-reg-appspot index 87567ba..5522dcf 100755 --- a/flashproxy-reg-appspot +++ b/flashproxy-reg-appspot @@ -109,7 +109,7 @@ def generate_url(addr):
# Like socket.create_connection in that it tries resolving different address # families, but doesn't connect the socket. -def create_socket(address, timeout = None, source_address = None): +def create_socket(address, timeout = None): host, port = address addrs = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM) if not addrs: @@ -120,8 +120,6 @@ def create_socket(address, timeout = None, source_address = None): s = socket.socket(addr[0], addr[1], addr[2]) if timeout is not None and type(timeout) == float: s.settimeout(timeout) - if source_address is not None: - s.bind(source_address) return s except Exception, e: err = e @@ -132,7 +130,7 @@ def create_socket(address, timeout = None, source_address = None):
class PinHTTPSConnection(httplib.HTTPSConnection): def connect(self): - sock = create_socket((self.host, self.port), self.timeout, self.source_address) + sock = create_socket((self.host, self.port), self.timeout) if self._tunnel_host: self.sock = sock self._tunnel()
tor-commits@lists.torproject.org