From 91e78e2621b4672d1fc27090988f38b591775031 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 15 Aug 2021 21:51:37 +0100 Subject: [PATCH] server: parse incoming multipart Signed-off-by: Ian Jackson --- src/bin/server.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bin/server.rs b/src/bin/server.rs index ae130d8..9f3267a 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs @@ -261,7 +261,7 @@ async fn run_client(ic: Arc, let WebRequest { initial, initial_remaining, length_hint, mut body, boundary_finder, - reply_to, warnings, + reply_to, mut warnings, } = req.ok_or_else(|| anyhow!("webservers all shut down!"))?; match async { @@ -275,7 +275,7 @@ async fn run_client(ic: Arc, &mut body ).await.context("read request body")?; - let (meta, comps) = + let (meta, mut comps) = multipart::ComponentIterator::resume_mid_component( &whole_request[initial_used..], boundary_finder @@ -322,6 +322,10 @@ async fn run_client(ic: Arc, let server, client = meta.parse()?.unwrap_or(server); } + while let Some(comp) = comps.next(&mut warnings, PartName::d)? { + dbg!(comp.name, DumpHex(comp.payload)); + } + Ok::<_,AE>(()) }.await { Ok(()) => outstanding.push_back(Outstanding { -- 2.30.2