mirror of
https://github.com/ratspeak/rsLXMF
synced 2026-11-22 23:10:35 +00:00
delivery: reconcile backchannel outcomes and reverse resources
This commit is contained in:
1 parent
681c0f5961
commit
b40dcd37f2
2 files changed
+2086
-65
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -1978,15 +1978,19 @@ impl LxmRouter {
|
||||
let mut raw = header.pack();
|
||||
raw.extend_from_slice(&packet_payload);
|
||||
|
||||
if transport_tx
|
||||
let dispatched = transport_tx
|
||||
.try_send(rns_transport::messages::TransportMessage::Outbound(
|
||||
rns_transport::messages::OutboundRequest {
|
||||
raw: Bytes::from(raw),
|
||||
destination_hash: dest_hash,
|
||||
},
|
||||
))
|
||||
.is_ok()
|
||||
&& message.state == MessageState::Sending
|
||||
.is_ok();
|
||||
if dispatched
|
||||
&& matches!(
|
||||
message.state,
|
||||
MessageState::Sending | MessageState::Sent
|
||||
)
|
||||
{
|
||||
message.mark_sent();
|
||||
message.progress = 1.0;
|
||||
@@ -3643,6 +3647,10 @@ mod tests {
|
||||
|
||||
let received = rx.try_recv();
|
||||
assert!(received.is_ok(), "expected outbound packet from tick()");
|
||||
assert!(
|
||||
router.pending_outbound.is_empty(),
|
||||
"a successful fire-and-forget tick must not requeue the sent packet"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user