From 87339921eac261954e39901e3563851830309cc5 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 20 Jul 2015 19:18:03 -0400 Subject: [bug] do not add a port string to non-tcp addresses this, together with the events server registration, was breaking the events signalling on the client whenever it used ipc:// sockets. --- src/leap/common/events/zmq_components.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/leap/common/events') diff --git a/src/leap/common/events/zmq_components.py b/src/leap/common/events/zmq_components.py index 04f71e0..f99c754 100644 --- a/src/leap/common/events/zmq_components.py +++ b/src/leap/common/events/zmq_components.py @@ -128,16 +128,21 @@ class TxZmqComponent(object): proto, addr, port = ADDRESS_RE.search(address).groups() - if port is None or port is '0': - params = proto, addr - port = socket.bind_to_random_port("%s://%s" % params) - # XXX this log doesn't appear - logger.debug("Binded %s to %s://%s." % ((connClass,) + params)) + if proto == "tcp": + if port is None or port is '0': + params = proto, addr + port = socket.bind_to_random_port("%s://%s" % params) + logger.debug("Binded %s to %s://%s." % ((connClass,) + params)) + else: + params = proto, addr, int(port) + socket.bind("%s://%s:%d" % params) + logger.debug( + "Binded %s to %s://%s:%d." % ((connClass,) + params)) else: - params = proto, addr, int(port) - socket.bind("%s://%s:%d" % params) - # XXX this log doesn't appear - logger.debug("Binded %s to %s://%s:%d." % ((connClass,) + params)) + params = proto, addr + socket.bind("%s://%s" % params) + logger.debug( + "Binded %s to %s://%s" % ((connClass,) + params)) self._connections.append(connection) return connection, port -- cgit v1.2.3