cmd_send: allow multiple things in a single message
This commit is contained in:
parent
8e7c6f16cb
commit
afdbbe84c3
|
@ -132,16 +132,19 @@ class Sender:
|
||||||
# TODO: get() fired, so now it's safe to use w.derive_key()
|
# TODO: get() fired, so now it's safe to use w.derive_key()
|
||||||
them_d = json.loads(them_d_bytes.decode("utf-8"))
|
them_d = json.loads(them_d_bytes.decode("utf-8"))
|
||||||
#print("GOT", them_d)
|
#print("GOT", them_d)
|
||||||
|
recognized = False
|
||||||
if u"transit" in them_d:
|
if u"transit" in them_d:
|
||||||
|
recognized = True
|
||||||
yield self._handle_transit(them_d[u"transit"])
|
yield self._handle_transit(them_d[u"transit"])
|
||||||
continue
|
|
||||||
if u"answer" in them_d:
|
if u"answer" in them_d:
|
||||||
|
recognized = True
|
||||||
if not want_answer:
|
if not want_answer:
|
||||||
raise TransferError("duplicate answer")
|
raise TransferError("duplicate answer")
|
||||||
yield self._handle_answer(them_d[u"answer"])
|
yield self._handle_answer(them_d[u"answer"])
|
||||||
done = True
|
done = True
|
||||||
returnValue(None)
|
returnValue(None)
|
||||||
log.msg("unrecognized message %r" % (them_d,))
|
if not recognized:
|
||||||
|
log.msg("unrecognized message %r" % (them_d,))
|
||||||
|
|
||||||
def _handle_transit(self, receiver_hints):
|
def _handle_transit(self, receiver_hints):
|
||||||
ts = self._transit_sender
|
ts = self._transit_sender
|
||||||
|
|
Loading…
Reference in New Issue
Block a user