chiark / gitweb /
server: collect body
[hippotat.git] / src / bin / server.rs
index 0c6cfb63f23056e25abe186345b3da75e72f8025..b956101e681a2fba8c20dc0f5652fc80a1e15ba4 100644 (file)
@@ -244,16 +244,14 @@ async fn run_client(_ic: Arc<InstanceConfig>,
         } = req.ok_or_else(|| anyhow!("webservers all shut down!"))?;
 
         match async {
-          let whole_request =
-            StreamExt::chain(
-              stream::once(Ok(
-                &initial[initial_remaining..]
-              )),
-              body.map_ok(
-                |by| &*by
-              ),
-            )
-            .try_collect().await.context("read request body")?;
+
+          let whole_request = body.try_fold(
+            initial.into_vec(),
+            |mut w, by| async move { w.extend_from_slice(&by); Ok(w) },
+          ).await.context("read request body")?;
+
+          dbg!(whole_request.len());
+
 /*          
 
           multipart::ComponentIterator::resume_mid_component(