Skip to content

Commit

Permalink
Prevent ohter websocekts sessions from cloding. Fixes Issue #104
Browse files Browse the repository at this point in the history
  • Loading branch information
prologic committed May 16, 2014
1 parent 2ba0b3f commit f4e2f1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -6,6 +6,7 @@ Change Log
==========


- :bug:`104` Prevent other websockets sessions from closing.
- :feature`103` Added the firing of a ``disconnect`` event for the
WebSocketsDispatcher.
- :bug:`102` Fixed minor bug with WebSocketsDispatcher causing superflusous
Expand Down
3 changes: 3 additions & 0 deletions circuits/protocols/websocket.py
Expand Up @@ -214,6 +214,9 @@ def _write(self, data):

@handler("close")
def _on_close(self, *args):
if self._sock is not None:
if args and (args[0] != self._sock):
return
if not self._close_sent:
self._write(b"\x88\x00")
self._close_sent = True
Expand Down

0 comments on commit f4e2f1f

Please sign in to comment.