From 8aeea711eb10875eb2370351e355fc252aa53b42 Mon Sep 17 00:00:00 2001 From: meejah Date: Mon, 12 Apr 2021 09:43:07 -0600 Subject: [PATCH] cleanup --- src/wormhole_transit_relay/test/test_transit_server.py | 1 + src/wormhole_transit_relay/transit_server.py | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/wormhole_transit_relay/test/test_transit_server.py b/src/wormhole_transit_relay/test/test_transit_server.py index 994121e..400c234 100644 --- a/src/wormhole_transit_relay/test/test_transit_server.py +++ b/src/wormhole_transit_relay/test/test_transit_server.py @@ -396,6 +396,7 @@ class TransitWebSockets(_Transit, ServerBase, unittest.TestCase): # should be an immediate error) with self.assertRaises(Disconnected): p1.send(b"more message") + self.flush() def new_protocol(self): ws_factory = WebSocketServerFactory("ws://localhost:4002") diff --git a/src/wormhole_transit_relay/transit_server.py b/src/wormhole_transit_relay/transit_server.py index d85e383..8bbc8d1 100644 --- a/src/wormhole_transit_relay/transit_server.py +++ b/src/wormhole_transit_relay/transit_server.py @@ -261,11 +261,7 @@ class WebSocketTransitConnection(WebSocketServerProtocol): if token is None: self._state.bad_token() else: - try: - self._state.got_bytes(payload) - except Exception as e: - log.err("Failed to send to partner: {}".format(e)) - self.sendClose(3000, "send to partner failed") + self._state.got_bytes(payload) def onClose(self, wasClean, code, reason): """