summaryrefslogtreecommitdiffstats
path: root/src/node.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-28 02:54:55 +0100
committertv <tv@krebsco.de>2026-10-28 02:54:55 +0100
commitb88be3ea1b475b1a656298b98708026388eaf2af (patch)
tree9ffb3c42800c348ae4d67d1d9a43daa608c2269d /src/node.rs
parent24327be7e09c20a9820eac61ba3ac60fb7bdb424 (diff)
move keepalive and firewall to paths
Diffstat (limited to 'src/node.rs')
-rw-r--r--src/node.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/node.rs b/src/node.rs
index 8e4ace7..97dec79 100644
--- a/src/node.rs
+++ b/src/node.rs
@@ -23,7 +23,7 @@ use crate::swarm::state_file::StateFile;
use crate::swarm::sync::SyncEvent;
use crate::swarm::{self, peer, sync};
use crate::transport::Transport;
-use crate::transport::firewall::{Firewall, FirewallTransport};
+use crate::transport::firewall::Firewall;
use crate::transport::identity::{IdentityConfig, IdentityTransport};
use crate::transport::traffic::{CountingTransport, Traffic};
@@ -77,6 +77,7 @@ impl Node {
config.transport,
identity,
Arc::clone(&traffic),
+ Some(Arc::clone(&firewall)),
)) as Arc<dyn Transport>,
None => config.transport,
};
@@ -91,13 +92,11 @@ impl Node {
discovered_swarm_id: None,
})),
peer_states: Arc::new(RwLock::new(HashMap::new())),
- // Counted outside the firewall: what it drops outbound counts as sent (it
- // plays a lossy network), what it drops inbound never arrived. Both above
- // the identity layer, so by node ID.
- transport: Arc::new(CountingTransport::new(
- Arc::new(FirewallTransport::new(transport, Arc::clone(&firewall))),
- Arc::clone(&traffic),
- )),
+ // Counted above the firewall (in the paths layer, under the identity layer):
+ // what it drops outbound counts as sent (it plays a lossy network), what it
+ // drops inbound never arrived. Without the identity layer (tests) there is
+ // no firewall.
+ transport: Arc::new(CountingTransport::new(transport, Arc::clone(&traffic))),
firewall,
traffic,
stats: Default::default(),