chiark / gitweb /
rename [Frame]QueueBuf
[hippotat.git] / client / client.rs
index 8597cfd3ba2264ccff8b81dfafe149e7f5286e80..cd87c8ad9ceb9b4f87117d2c96d5f51c96178c66 100644 (file)
@@ -192,7 +192,7 @@ async fn run_client<C:HCC>(
   let mut reqs: Vec<OutstandingRequest>
     = Vec::with_capacity(ic.max_requests_outstanding.sat());
 
-  let mut rx_queue: FrameQueue = default();
+  let mut rx_queue: FrameQueueBuf = default();
 
   let trouble = async {
     loop {
@@ -221,15 +221,13 @@ async fn run_client<C:HCC>(
           let _ = tx_queue.pop_front();
         },
 
-        data = ipif.tx.next_segment(),
+        data = Ipif::next_frame(&mut ipif.tx),
         if tx_queue.is_empty() =>
         {
-          let data = (||{
-            data?.ok_or_else(|| io::Error::from(io::ErrorKind::UnexpectedEof))
-          })().context("read from ipif")?;
+          let data = data?;
           //eprintln!("data={:?}", DumpHex(&data));
 
-          match check1(Slip2Mime, ic.mtu, &data, |header| {
+          match slip::process1(Slip2Mime, ic.mtu, &data, |header| {
             let saddr = ip_packet_addr::<false>(header)?;
             if saddr != ic.link.client.0 { throw!(PE::Src(saddr)) }
             Ok(())
@@ -278,7 +276,7 @@ async fn run_client<C:HCC>(
           if let Some(got) = got {
             
             //eprintln!("got={:?}", DumpHex(&got));
-            match checkn(SlipNoConv,ic.mtu, &got, |header| {
+            match slip::processn(SlipNoConv,ic.mtu, &got, |header| {
               let addr = ip_packet_addr::<true>(header)?;
               if addr != ic.link.client.0 { throw!(PE::Dst(addr)) }
               Ok(())