mirror of
https://github.com/ratspeak/rsReticulum
synced 2026-11-27 13:52:16 +00:00
transport: skip path requests for outbound proofs
This commit is contained in:
1 parent
d2ad997caf
commit
6638c80c55
2 files changed
+25
-1
No files matched your search
@@ -3047,6 +3047,28 @@ mod tests {
|
||||
assert!(rx2.try_recv().is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn outbound_no_path_proof_does_not_request_path() {
|
||||
let (mut actor, _tx) = TransportActor::new();
|
||||
let (entry, mut rx) = make_test_interface("iface1");
|
||||
actor.interfaces.insert(1, entry);
|
||||
|
||||
let dest_hash = [0x42; 16];
|
||||
let raw = make_proof_packet(dest_hash, 0);
|
||||
actor.on_outbound(OutboundRequest {
|
||||
raw: raw.clone(),
|
||||
destination_hash: dest_hash,
|
||||
});
|
||||
|
||||
let sent = rx.try_recv().expect("proof should broadcast");
|
||||
assert_eq!(sent, raw);
|
||||
assert!(
|
||||
rx.try_recv().is_err(),
|
||||
"proof should not be followed by a path request"
|
||||
);
|
||||
assert!(!actor.path_requests.contains_key(&dest_hash));
|
||||
}
|
||||
|
||||
fn assert_link_request_pins_to_path_owner(
|
||||
owner_name: &str,
|
||||
owner_mode: InterfaceMode,
|
||||
|
||||
@@ -129,7 +129,9 @@ impl TransportActor {
|
||||
"outbound: no path, broadcasting"
|
||||
);
|
||||
self.broadcast_on_interfaces(&request.raw, None);
|
||||
self.on_automatic_path_request(request.destination_hash);
|
||||
if parsed.flags.packet_type != rns_wire::flags::PacketType::Proof {
|
||||
self.on_automatic_path_request(request.destination_hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user