chiark / gitweb /
rename tx_queue from packets
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 4 Aug 2021 22:04:13 +0000 (23:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 4 Aug 2021 22:04:13 +0000 (23:04 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/client.rs

index d45434292a18023d317d6124388c41dbecbca8b1..e2d061d2dc850556fdbe89480371f34f57877ac6 100644 (file)
@@ -198,7 +198,7 @@ async fn run_client<C:HCC>(
   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>
@@ -225,7 +225,7 @@ async fn run_client<C:HCC>(
         },
 
         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<C:HCC>(
             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<C:HCC>(
 
         _ = 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(()) => { },
             }
           }