From 9362e251290426e819551f05a0bc6135582acb74 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 2 Nov 2015 16:23:49 -0400 Subject: [bug] use embedded minitornado. Closes: #7562 using system tornado library raises a bug due to a mismatching signature. - Resolves: #7562 - Releases: 0.9.1 --- src/leap/bitmask/backend/backend_proxy.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/backend/backend_proxy.py b/src/leap/bitmask/backend/backend_proxy.py index ae300b32..1f90657b 100644 --- a/src/leap/bitmask/backend/backend_proxy.py +++ b/src/leap/bitmask/backend/backend_proxy.py @@ -25,6 +25,7 @@ import threading import zmq from zmq.eventloop import ioloop +from zmq.eventloop.minitornado.ioloop import PollIOLoop from zmq.eventloop import zmqstream from leap.bitmask.backend.api import API, STOP_REQUEST, PING_REQUEST @@ -34,9 +35,20 @@ from leap.bitmask.backend.utils import get_backend_certificates from leap.bitmask.config import flags from leap.bitmask.logs.utils import get_logger + logger = get_logger() +class _ZMQIOLoop(ioloop.ZMQIOLoop): + """ + Returns a global ``IOLoop`` instance, but forcing the use of the embedded + minitornado. + """ + @staticmethod + def instance(): + return PollIOLoop.instance() + + class ZmqREQConnection(threading.Thread): """ A threaded zmq req connection. @@ -67,7 +79,7 @@ class ZmqREQConnection(threading.Thread): socket = context.socket(zmq.REQ) # we use zmq's eventloop in order to asynchronously send requests - loop = ioloop.ZMQIOLoop.current() + loop = _ZMQIOLoop.instance() self._stream = zmqstream.ZMQStream(socket, loop) if flags.ZMQ_HAS_CURVE: -- cgit v1.2.3