electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 604d5d432c4efc8614a3d306a71dd61e37297d31
parent 0ac3aebb8840967c4bd9598191e96050e3e54218
Author: ThomasV <thomasv@gitorious>
Date:   Wed,  1 Jul 2015 09:09:00 +0200

sanitize server at the interface level (follow up to issue #1330)

Diffstat:
Mlib/interface.py | 1+
Mlib/network.py | 3+--
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/interface.py b/lib/interface.py @@ -72,6 +72,7 @@ class TcpInterface(threading.Thread): # parse server self.server = server self.host, self.port, self.protocol = self.server.split(':') + self.host = str(self.host) self.port = int(self.port) self.use_ssl = (self.protocol == 's') diff --git a/lib/network.py b/lib/network.py @@ -301,12 +301,11 @@ class Network(util.DaemonThread): def set_proxy(self, proxy): self.proxy = proxy if proxy: - self.print_error("setting proxy", proxy) proxy_mode = proxy_modes.index(proxy["mode"]) + 1 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 - socket.getaddrinfo = lambda *args: [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (str(args[0]), args[1]))] + socket.getaddrinfo = lambda *args: [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))] else: socket.socket = socket._socketobject socket.getaddrinfo = socket._socket.getaddrinfo