From 399efb374c99e94ba85e0d5383fa27b38ac0c823 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 20 May 2016 11:07:21 -0700 Subject: [PATCH] don't close websocket when mailbox is deleted This made sense for ServerSentEvent channels (which has no purpose once the channel was gone), but not so much for websockets. And it prevented testing duplicate-close. --- src/wormhole/server/rendezvous_websocket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wormhole/server/rendezvous_websocket.py b/src/wormhole/server/rendezvous_websocket.py index 7e72813..e37fb6b 100644 --- a/src/wormhole/server/rendezvous_websocket.py +++ b/src/wormhole/server/rendezvous_websocket.py @@ -194,7 +194,7 @@ class WebSocketRendezvous(websocket.WebSocketServerProtocol): def _send(event): self.send("message", message=event) def _stop(): - self._reactor.callLater(0, self.transport.loseConnection) + pass for old_message in self._mailbox.add_listener(self, _send, _stop): _send(old_message)