ekumenlabs / rocon_web_proxy_server

Server component of the Rocon Web Proxy
0 stars 3 forks source link

Inproper disconnect hangs server #56

Open adamantivm opened 9 years ago

adamantivm commented 9 years ago

There seems to be a problem handling disconnection of clients properly which causes an infinite error loop on the proxy server.

In order to reproduce:

You will notice the proxy server starts printing endlessly:

...
AttributeError: 'NoneType' object has no attribute 'write_message'
Unexpected error: <type 'exceptions.AttributeError'>
Traceback (most recent call last):
  File "main.py", line 127, in on_message
    self.pass_message(msg, clients)
  File "main.py", line 209, in pass_message
    client.ws_conns[-1].write_message(message)
  File "/usr/local/lib/python2.7/dist-packages/tornado/websocket.py", line 165, in write_message
    self.ws_connection.write_message(message, binary=binary)
AttributeError: 'NoneType' object has no attribute 'write_message'
Unexpected error: <type 'exceptions.AttributeError'>
Traceback (most recent call last):
  File "main.py", line 127, in on_message
    self.pass_message(msg, clients)
  File "main.py", line 209, in pass_message
    client.ws_conns[-1].write_message(message)
  File "/usr/local/lib/python2.7/dist-packages/tornado/websocket.py", line 165, in write_message
    self.ws_connection.write_message(message, binary=binary)
...