From ee1efbe8aa22d25306bff203d90443e1f6f634b7 Mon Sep 17 00:00:00 2001 From: Hubert Date: Thu, 8 Jul 2021 08:32:23 +0200 Subject: [PATCH] push OK, clone KO --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index de8bd18..16b2a33 100644 --- a/src/main.rs +++ b/src/main.rs @@ -125,6 +125,7 @@ async fn git_main(web::Path((owner, reponame)): web::Path<(String, String)>, web } //#[get("/git/{owner}/{repo}.git/{path:.*}")] async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Path<(String, String)>, mut req: HttpRequest) -> io::Result{ + println!("enter git_proto"); let mut cmd = Command::new("git"); cmd.arg("http-backend"); @@ -154,6 +155,7 @@ async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Pa input.write(bytes.bytes()); future::ready(Ok(())) }).await; + println!("input sent"); //io::copy(&mut req.take_payload(), &mut p.stdin.take().unwrap())?; // Parse the headers coming out, and the pass through the rest of the // process back down the stack. @@ -201,7 +203,7 @@ async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Pa let mut body = Vec::new(); rdr.read_to_end(&mut body)?; - println!("{}", String::from_utf8(body.clone()).expect("bad utf8")); + // println!("{}", String::from_utf8(body.clone()).expect("bad utf8")); return Ok(builder.body(body)); }