commit 9e4eda24b5d2e25655a7be72e5ecb495c25c22c8
parent f32f1183fc49f37be8696913f2059d374a059b8c
Author: ThomasV <thomasv@gitorious>
Date: Fri, 13 Mar 2015 12:00:08 +0100
fix #1082
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/network.py b/lib/network.py
@@ -282,11 +282,11 @@ class Network(threading.Thread):
socks.setdefaultproxy(proxy_mode, proxy["host"], int(proxy["port"]))
socket.socket = socks.socksocket
# prevent dns leaks, see http://stackoverflow.com/questions/13184205/dns-over-proxy
- def getaddrinfo(*args):
- return [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))]
- socket.getaddrinfo = getaddrinfo
+ socket.getaddrinfo = lambda *args: [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))]
else:
- reload(socket)
+ socket.socket = socket._socketobject
+ socket.getaddrinfo = socket._socket.getaddrinfo
+
def set_parameters(self, host, port, protocol, proxy, auto_connect):
proxy_str = serialize_proxy(proxy)