chiark / gitweb /
client: rename saddr variable
[hippotat.git] / src / bin / client.rs
index 2497780c52a1e54c5707b7137426247535b37dd3..14d81ce2a79e4b567a0988c8d1a01d96d43375b9 100644 (file)
@@ -65,11 +65,13 @@ fn submit_request<'r, 'c:'r, C:HCC>(
        {}
        {}
        {}
+       {}
        {}"#),
                        &c.ic.link.client,
                        token,
                        c.ic.target_requests_outstanding,
                        show_timeout,
+                       c.ic.mtu,
                        c.ic.max_batch_down,
                        c.ic.max_batch_up,
   );
@@ -140,7 +142,9 @@ fn submit_request<'r, 'c:'r, C:HCC>(
       let status = resp.status();
       let mut resp = resp.into_body();
       let max_body = c.ic.max_batch_down.sat() + MAX_OVERHEAD;
-      let resp = read_limited_bytes(max_body, &mut resp).await
+      let resp = read_limited_bytes(
+        max_body, default(), default(), &mut resp
+      ).await
         .discard_data().context("fetching response body")?;
 
       if ! status.is_success() {
@@ -226,8 +230,8 @@ async fn run_client<C:HCC>(
           //eprintln!("data={:?}", DumpHex(&data));
 
           match check1(Slip2Mime, ic.mtu, &data, |header| {
-            let addr = ip_packet_addr::<false>(header)?;
-            if addr != ic.link.client.0 { throw!(PE::Src(addr)) }
+            let saddr = ip_packet_addr::<false>(header)?;
+            if saddr != ic.link.client.0 { throw!(PE::Src(saddr)) }
             Ok(())
           }) {
             Ok(data) => tx_queue.push_back(TxQueued {
@@ -274,11 +278,13 @@ async fn run_client<C:HCC>(
           if let Some(got) = got {
             
             //eprintln!("got={:?}", DumpHex(&got));
-            match checkn(SlipNoConv,ic.mtu, &got, &mut rx_queue, |header| {
+            match checkn(SlipNoConv,ic.mtu, &got, |header| {
               let addr = ip_packet_addr::<true>(header)?;
               if addr != ic.link.client.0 { throw!(PE::Dst(addr)) }
               Ok(())
-            }, |e| error!("{} #{}: rx discarding: {}", &ic, req_num, e)) {
+            }, |o| rx_queue.push(o),
+               |e| error!("{} #{}: rx discarding: {}", &ic, req_num, e))
+            {
               Ok(()) => reporter.lock().success(),
               Err(ErrorOnlyBad) => {
                 reqs.push(Box::pin(async {