From: Ian Jackson Date: Wed, 4 Aug 2021 22:04:13 +0000 (+0100) Subject: rename tx_queue from packets X-Git-Tag: hippotat/1.0.0~335 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=157a47638faf20f84c3e48dedbf227501e52d60e;p=hippotat.git rename tx_queue from packets Signed-off-by: Ian Jackson --- diff --git a/src/bin/client.rs b/src/bin/client.rs index d454342..e2d061d 100644 --- a/src/bin/client.rs +++ b/src/bin/client.rs @@ -198,7 +198,7 @@ async fn run_client( let mut rx_stream = ipif.stdin .take().unwrap(); let mut tx_stream = tokio::io::BufReader::new(tx_stream).split(SLIP_END); - let mut packets: VecDeque> = default(); + let mut tx_queue: VecDeque> = default(); let mut upbound = Frames::default(); let mut reqs: Vec @@ -225,7 +225,7 @@ async fn run_client( }, data = tx_stream.next_segment(), - if packets.is_empty() => + if tx_queue.is_empty() => { let data = data.context("read from ipif")? @@ -237,7 +237,7 @@ async fn run_client( if addr != ic.link.client.0 { throw!(PE::Src(addr)) } Ok(()) }) { - Ok(packet) => packets.push_back(packet), + Ok(packet) => tx_queue.push_back(packet), Err(PE::Empty) => { }, Err(e@ PE::Src(_)) => debug!("{}: tx discarding: {}", &ic, e), Err(e) => error!("{}: tx discarding: {}", &ic, e), @@ -246,11 +246,11 @@ async fn run_client( _ = async { }, if ! upbound.tried_full() && - ! packets.is_empty() => + ! tx_queue.is_empty() => { - while let Some(packet) = packets.pop_front() { + while let Some(packet) = tx_queue.pop_front() { match upbound.add(ic.max_batch_up, packet.into()/*todo:504*/) { - Err(packet) => { packets.push_front(packet.into()/*todo:504*/); break; } + Err(packet) => { tx_queue.push_front(packet.into()/*todo:504*/); break; } Ok(()) => { }, } }