Show More
@@ -106,12 +106,11 b' class ZMQStreamHandler(WebSocketHandler):' | |||
|
106 | 106 | # we can close the connection more gracefully. |
|
107 | 107 | self.stream.close() |
|
108 | 108 | |
|
109 | ||
|
109 | ||
|
110 | 110 | def check_origin(self, origin): |
|
111 | 111 | """Check Origin == Host or Access-Control-Allow-Origin. |
|
112 | 112 | |
|
113 | 113 | Tornado >= 4 calls this method automatically, raising 403 if it returns False. |
|
114 | We call it explicitly in `open` on Tornado < 4. | |
|
115 | 114 | """ |
|
116 | 115 | if self.allow_origin == '*': |
|
117 | 116 | return True |
@@ -173,7 +172,10 b' class ZMQStreamHandler(WebSocketHandler):' | |||
|
173 | 172 | def _on_zmq_reply(self, stream, msg_list): |
|
174 | 173 | # Sometimes this gets triggered when the on_close method is scheduled in the |
|
175 | 174 | # eventloop but hasn't been called. |
|
176 |
if stream.closed(): |
|
|
175 | if self.stream.closed() or stream.closed(): | |
|
176 | self.log.warn("zmq message arrived on closed channel") | |
|
177 | self.close() | |
|
178 | return | |
|
177 | 179 | channel = getattr(stream, 'channel', None) |
|
178 | 180 | try: |
|
179 | 181 | msg = self._reserialize_reply(msg_list, channel=channel) |
General Comments 0
You need to be logged in to leave comments.
Login now