Browse Source

Merge pull request #3343 from fr3aker/fix-ipv6addr-parsing

fix parsing of ipv6 addresses in interface
3.0.x
ThomasV 7 years ago
committed by GitHub
parent
commit
b97402b796
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lib/interface.py

6
lib/interface.py

@ -50,7 +50,7 @@ def Connection(server, queue, config_path):
queue of the form (server, socket), where socket is None if queue of the form (server, socket), where socket is None if
connection failed. connection failed.
""" """
host, port, protocol = server.split(':') host, port, protocol = server.rsplit(':', 2)
if not protocol in 'st': if not protocol in 'st':
raise Exception('Unknown protocol: %s' % protocol) raise Exception('Unknown protocol: %s' % protocol)
c = TcpConnection(server, queue, config_path) c = TcpConnection(server, queue, config_path)
@ -65,7 +65,7 @@ class TcpConnection(threading.Thread, util.PrintError):
self.config_path = config_path self.config_path = config_path
self.queue = queue self.queue = queue
self.server = server self.server = server
self.host, self.port, self.protocol = self.server.split(':') self.host, self.port, self.protocol = self.server.rsplit(':', 2)
self.host = str(self.host) self.host = str(self.host)
self.port = int(self.port) self.port = int(self.port)
self.use_ssl = (self.protocol == 's') self.use_ssl = (self.protocol == 's')
@ -247,7 +247,7 @@ class Interface(util.PrintError):
def __init__(self, server, socket): def __init__(self, server, socket):
self.server = server self.server = server
self.host, _, _ = server.split(':') self.host, _, _ = server.rsplit(':', 2)
self.socket = socket self.socket = socket
self.pipe = util.SocketPipe(socket) self.pipe = util.SocketPipe(socket)

Loading…
Cancel
Save