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<Box<[u8]>> = default();
+ let mut tx_queue: VecDeque<Box<[u8]>> = default();
let mut upbound = Frames::default();
let mut reqs: Vec<OutstandingRequest>
},
data = tx_stream.next_segment(),
- if packets.is_empty() =>
+ if tx_queue.is_empty() =>
{
let data =
data.context("read from ipif")?
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),
_ = 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(()) => { },
}
}