From bf2915d8bd042edb1d9c575309e91712d7412227 Mon Sep 17 00:00:00 2001 From: Mute Date: Thu, 13 Aug 2026 09:25:27 +0000 Subject: [PATCH] fix: add tokio time feature, make SendState/RecvState::new public - tokio 'time' feature needed for tokio::time::interval in retransmit timer - SendState::new and RecvState::new must be pub for use from main.rs - prefix unused tx param with underscore --- gatunad/Cargo.toml | 2 +- gatunad/src/session.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gatunad/Cargo.toml b/gatunad/Cargo.toml index a4e2756..dbd51c0 100644 --- a/gatunad/Cargo.toml +++ b/gatunad/Cargo.toml @@ -10,7 +10,7 @@ path = "src/main.rs" [dependencies] libc = "0.2" -tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "sync", "io-util"] } +tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "sync", "io-util", "time"] } clap = { version = "4", features = ["derive"] } pnet_datalink = "0.35" tracing = "0.1" diff --git a/gatunad/src/session.rs b/gatunad/src/session.rs index 7a017d1..c4807e1 100644 --- a/gatunad/src/session.rs +++ b/gatunad/src/session.rs @@ -33,7 +33,7 @@ pub struct RecvState { } impl SendState { - fn new() -> Self { + pub fn new() -> Self { SendState { send_seq: 0, acked_seq: 0, @@ -83,7 +83,7 @@ impl SendState { } impl RecvState { - fn new() -> Self { + pub fn new() -> Self { RecvState { expected_seq: 0, deliver_seq: 0, @@ -155,7 +155,7 @@ pub async fn handle_data( seq: u32, ack_seq: u32, payload: &[u8], - tx: &TxChan, + _tx: &TxChan, ) -> Result { let handle = { let store = store.lock().expect("store lock poisoned");