From 734305e9c7a0d20b68ab35000db46200131a6f6e Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 2 Oct 2021 23:30:38 +0200 Subject: [PATCH] General structure for LXMF propagation --- LXMF/LXMF.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/LXMF/LXMF.py b/LXMF/LXMF.py index 75b77e9..9002b7e 100644 --- a/LXMF/LXMF.py +++ b/LXMF/LXMF.py @@ -499,7 +499,7 @@ class LXMFPropagationAnnounceHandler: class LXMPeer: - OFFER_REQUEST_PATH = "o" + OFFER_REQUEST_PATH = "/offer" IDLE = 0x00 LINK_ESTABLISHING = 0x01 @@ -861,7 +861,13 @@ class LXMRouter: # TODO: The peer this was received from should # have the transient id added to it's list of # already handled messages. - self.lxmf_propagation(resource.data.read()) + try: + messages = msgpack.unpackb(resource.data.read()) + for message in messages: + self.lxmf_propagation(lxmessage) + + except Exception as e: + RNS.log("Error while unpacking received propagation messages", RNS.LOG_DEBUG) def lxmf_propagation(self, lxmf_data):