cmd_send: wait for ack from close()
Without this, the sender drops the connection before the "close" message has made it to the server, which leaves the mailbox hanging until it expires. It still lives in a 'd.addBoth()' slot, so it gets closed even if some error occurrs, but we wait for it's Deferred to fire in both success and failure cases.
This commit is contained in:
parent
1d3b22a0b4
commit
de8efdb9f9
|
@ -48,10 +48,9 @@ class Sender:
|
|||
w = wormhole(APPID, self._args.relay_url,
|
||||
self._reactor, self._tor_manager,
|
||||
timing=self._timing)
|
||||
try:
|
||||
yield self._go(w)
|
||||
finally:
|
||||
w.close()
|
||||
d = self._go(w)
|
||||
d.addBoth(w.close) # must wait for ack from close()
|
||||
yield d
|
||||
|
||||
def _send_data(self, data, w):
|
||||
data_bytes = dict_to_bytes(data)
|
||||
|
|
Loading…
Reference in New Issue
Block a user