mirror of
https://github.com/markqvist/LXMF.git
synced 2025-05-22 15:51:44 -04:00
Cleanup
This commit is contained in:
parent
1bdcf6ad53
commit
005d71707c
2 changed files with 8 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
||||||
import time
|
import time
|
||||||
|
import threading
|
||||||
import RNS
|
import RNS
|
||||||
import RNS.vendor.umsgpack as msgpack
|
import RNS.vendor.umsgpack as msgpack
|
||||||
|
|
||||||
|
@ -17,10 +18,11 @@ class LXMFDeliveryAnnounceHandler:
|
||||||
if lxmessage.method == LXMessage.DIRECT or lxmessage.method == LXMessage.OPPORTUNISTIC:
|
if lxmessage.method == LXMessage.DIRECT or lxmessage.method == LXMessage.OPPORTUNISTIC:
|
||||||
lxmessage.next_delivery_attempt = time.time()
|
lxmessage.next_delivery_attempt = time.time()
|
||||||
|
|
||||||
while self.lxmrouter.processing_outbound:
|
def outbound_trigger():
|
||||||
time.sleep(0.1)
|
while self.lxmrouter.processing_outbound: time.sleep(0.1)
|
||||||
|
self.lxmrouter.process_outbound()
|
||||||
|
|
||||||
self.lxmrouter.process_outbound()
|
threading.Thread(target=outbound_trigger, daemon=True).start()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
stamp_cost = stamp_cost_from_app_data(app_data)
|
stamp_cost = stamp_cost_from_app_data(app_data)
|
||||||
|
@ -55,10 +57,8 @@ class LXMFPropagationAnnounceHandler:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if len(data) >= 3:
|
if len(data) >= 3:
|
||||||
try:
|
try: propagation_transfer_limit = float(data[2])
|
||||||
propagation_transfer_limit = float(data[2])
|
except: propagation_transfer_limit = None
|
||||||
except:
|
|
||||||
propagation_transfer_limit = None
|
|
||||||
|
|
||||||
if destination_hash in self.lxmrouter.static_peers:
|
if destination_hash in self.lxmrouter.static_peers:
|
||||||
self.lxmrouter.peer(destination_hash, node_timebase, propagation_transfer_limit, wanted_inbound_peers)
|
self.lxmrouter.peer(destination_hash, node_timebase, propagation_transfer_limit, wanted_inbound_peers)
|
||||||
|
|
|
@ -2301,8 +2301,7 @@ class LXMRouter:
|
||||||
else:
|
else:
|
||||||
RNS.log("Outbound processing for "+str(lxmessage)+" to "+RNS.prettyhexrep(lxmessage.get_destination().hash), RNS.LOG_DEBUG)
|
RNS.log("Outbound processing for "+str(lxmessage)+" to "+RNS.prettyhexrep(lxmessage.get_destination().hash), RNS.LOG_DEBUG)
|
||||||
|
|
||||||
if lxmessage.progress == None or lxmessage.progress < 0.01:
|
if lxmessage.progress == None or lxmessage.progress < 0.01: lxmessage.progress = 0.01
|
||||||
lxmessage.progress = 0.01
|
|
||||||
|
|
||||||
# Outbound handling for opportunistic messages
|
# Outbound handling for opportunistic messages
|
||||||
if lxmessage.method == LXMessage.OPPORTUNISTIC:
|
if lxmessage.method == LXMessage.OPPORTUNISTIC:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue