From 9c1af2667e28dc6d1cb38a9d307cfa51bcf6cb43 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 20 Apr 2016 12:10:35 -0700 Subject: [PATCH] send_data(): add wait=True This doesn't do anything yet (the HTTP-based Channel always waits), but will matter in an upcoming implementation change. --- src/txwormhole/transcribe.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/txwormhole/transcribe.py b/src/txwormhole/transcribe.py index bce8ddc..5654ba6 100644 --- a/src/txwormhole/transcribe.py +++ b/src/txwormhole/transcribe.py @@ -448,7 +448,7 @@ class Wormhole: @close_on_error @inlineCallbacks - def send_data(self, outbound_data, phase=u"data"): + def send_data(self, outbound_data, phase=u"data", wait=False): if not isinstance(outbound_data, type(b"")): raise TypeError(type(outbound_data)) if not isinstance(phase, type(u"")): raise TypeError(type(phase)) @@ -467,6 +467,8 @@ class Wormhole: data_key = self.derive_key(u"wormhole:phase:%s" % phase) outbound_encrypted = self._encrypt_data(data_key, outbound_data) yield self._channel.send(phase, outbound_encrypted) + # Since that always waits for the server to ack the POST, we always + # behave as if wait=True. self._timing.finish_event(_sent) @close_on_error