From 04b8b4334378bc9b6f6e27c2d5dbc946c0ee5fa0 Mon Sep 17 00:00:00 2001 From: Hubert Date: Thu, 8 Jul 2021 08:48:04 +0200 Subject: [PATCH] try debug --- src/main.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 16b2a33..d373abf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,6 +26,7 @@ use std::io::{Read, BufRead, Write, ErrorKind}; use futures::{StreamExt, TryStreamExt, future}; use actix_web::web::Buf; use actix_web::http::header::IntoHeaderValue; +use futures::stream; #[derive(Template)] #[template(path = "hello.html")] @@ -181,14 +182,16 @@ async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Pa .push(value.to_string()); } + println!("headers : {:?}", headers); + let status_code : u16 = { let line = headers.remove("Status").unwrap_or_default(); - // println!("{:?}", &line); + println!("{:?}", &line); let line = line.into_iter().next().unwrap_or_default(); let parts : Vec<&str> = line.split(' ').collect(); parts.into_iter().next().unwrap_or("").parse().unwrap_or(200) }; - // println!("{}", status_code); + println!("status code {}", status_code); let statusCode = match StatusCode::from_u16(status_code) { Ok(v) => {Ok(v)} @@ -201,9 +204,12 @@ async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Pa } } + println!("headers written"); + 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")); + // builder.streaming(stream::repeat_with(rdr.rea)) return Ok(builder.body(body)); }