summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-11-02 16:23:49 -0400
committerKali Kaneko <kali@leap.se>2015-11-02 16:47:41 -0400
commit9362e251290426e819551f05a0bc6135582acb74 (patch)
treee9b26ab92f835a614b0c84bfa8ae13fc09b83c80
parentcc1461ef68e734adf65c2c7b2391225df4e1e86c (diff)
[bug] use embedded minitornado. Closes: #7562
using system tornado library raises a bug due to a mismatching signature. - Resolves: #7562 - Releases: 0.9.1
-rw-r--r--src/leap/bitmask/backend/backend_proxy.py14
1 files changed, 13 insertions, 1 deletions
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: