diff --git a/src/wormhole/server/rendezvous_websocket.py b/src/wormhole/server/rendezvous_websocket.py index 1000b0d..d6585bb 100644 --- a/src/wormhole/server/rendezvous_websocket.py +++ b/src/wormhole/server/rendezvous_websocket.py @@ -161,7 +161,7 @@ class WebSocketRendezvous(websocket.WebSocketServerProtocol): def send(self, mtype, **kwargs): kwargs["type"] = mtype - kwargs["sent"] = time.time() + kwargs["server_tx"] = time.time() payload = json.dumps(kwargs).encode("utf-8") self.sendMessage(payload, False) diff --git a/src/wormhole/test/test_server.py b/src/wormhole/test/test_server.py index 71a1239..a9eb684 100644 --- a/src/wormhole/test/test_server.py +++ b/src/wormhole/test/test_server.py @@ -685,8 +685,8 @@ class WebSocketAPI(ServerBase, unittest.TestCase): self.assertEqual(msg["type"], "message") self.assertEqual(strip_message(msg["message"]), {"phase": "1", "body": "msg1A"}) - self.assertIn("sent", msg) - self.assertIsInstance(msg["sent"], float) + self.assertIn("server_tx", msg) + self.assertIsInstance(msg["server_tx"], float) c1.send(u"add", phase="1", body="msg1B") c1.send(u"add", phase="2", body="msg2A") diff --git a/src/wormhole/twisted/transcribe.py b/src/wormhole/twisted/transcribe.py index b2d34fb..d6a7c5d 100644 --- a/src/wormhole/twisted/transcribe.py +++ b/src/wormhole/twisted/transcribe.py @@ -140,7 +140,7 @@ class Wormhole: return meth(msg) def _ws_handle_welcome(self, msg): - self._timing.add("welcome").server_sent(msg["sent"]) + self._timing.add("welcome").server_sent(msg["server_tx"]) welcome = msg["welcome"] if ("motd" in welcome and not self.motd_displayed): @@ -191,7 +191,7 @@ class Wormhole: self._wakeup() def _ws_handle_error(self, msg): - self._timing.add("error").server_sent(msg["sent"]) + self._timing.add("error").server_sent(msg["server_tx"]) err = ServerError("%s: %s" % (msg["error"], msg["orig"]), self._ws_url) return self._signal_error(err) @@ -224,7 +224,7 @@ class Wormhole: returnValue(code) def _ws_handle_allocated(self, msg): - self._allocate_t.server_sent(msg["sent"]) + self._allocate_t.server_sent(msg["server_tx"]) if self._channelid is not None: return self._signal_error("got duplicate channelid") self._channelid = msg["channelid"]