Fixed timeout and response rejects not being processed for single-packet requests. By JRG <fccab3ba809f89d870d5b8b2e2cdbad1> (commit 238e108678b7b5f58b770b44a817495f74595332)

This commit is contained in:
Mark Qvist 2026-09-29 12:08:11 +02:00
parent 06dc4ad550
commit 5cdff28703
No known key found for this signature in database

View file

@ -1395,7 +1395,7 @@ class RequestReceipt():
time.sleep(0.1)
def request_timed_out(self, packet_receipt):
if self in self.link.pending_requests and self.status == RequestReceipt.DELIVERED:
if self in self.link.pending_requests and self.status in [RequestReceipt.DELIVERED, RequestReceipt.SENT]:
self.status = RequestReceipt.FAILED
self.concluded_at = time.time()
self.link.pending_requests.remove(self)
@ -1405,7 +1405,7 @@ class RequestReceipt():
except Exception as e: RNS.log("Error while executing request timed out callback from "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
def response_rejected(self):
if self in self.link.pending_requests and self.status == RequestReceipt.DELIVERED:
if self in self.link.pending_requests and self.status in [RequestReceipt.DELIVERED, RequestReceipt.SENT]:
self.status = RequestReceipt.FAILED
self.concluded_at = time.time()
self.link.pending_requests.remove(self)