Commit 27982485 by Bach Dániel Committed by Guba Sándor

fix unhandled exceptions

parent b9fab27a
...@@ -65,7 +65,8 @@ class VNCWebSocketHandler(Protocol): ...@@ -65,7 +65,8 @@ class VNCWebSocketHandler(Protocol):
port = value['port'] port = value['port']
host = value['host'] host = value['host']
except: except:
pass transport.loseConnection()
return
self.transport = transport self.transport = transport
self.srv_queue = defer.DeferredQueue() self.srv_queue = defer.DeferredQueue()
self.cli_queue = defer.DeferredQueue() self.cli_queue = defer.DeferredQueue()
...@@ -87,6 +88,7 @@ class VNCWebSocketHandler(Protocol): ...@@ -87,6 +88,7 @@ class VNCWebSocketHandler(Protocol):
self.cli_queue.put(frame) self.cli_queue.put(frame)
def connectionLost(self, why): def connectionLost(self, why):
if hasattr(self, 'cli_queue'):
self.cli_queue.put(False) self.cli_queue.put(False)
log.msg("HELO") log.msg("HELO")
......
...@@ -399,7 +399,6 @@ class WebSocketsProtocol(Protocol): ...@@ -399,7 +399,6 @@ class WebSocketsProtocol(Protocol):
Find frames in incoming data and pass them to the underlying protocol. Find frames in incoming data and pass them to the underlying protocol.
""" """
for opcode, data, fin in _parseFrames(self._buffer): for opcode, data, fin in _parseFrames(self._buffer):
self._receiver.frameReceived(opcode, base64.b64decode(data), fin)
if opcode == CONTROLS.CLOSE: if opcode == CONTROLS.CLOSE:
# The other side wants us to close. # The other side wants us to close.
code, reason = data code, reason = data
...@@ -416,6 +415,7 @@ class WebSocketsProtocol(Protocol): ...@@ -416,6 +415,7 @@ class WebSocketsProtocol(Protocol):
# 5.5.3 PONGs must contain the data that was sent with the # 5.5.3 PONGs must contain the data that was sent with the
# provoking PING. # provoking PING.
self.transport.write(_makeFrame(data, CONTROLS.PONG, True)) self.transport.write(_makeFrame(data, CONTROLS.PONG, True))
self._receiver.frameReceived(opcode, base64.b64decode(data), fin)
def dataReceived(self, data): def dataReceived(self, data):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment