Compare commits
No commits in common. "08113e45fb2472050ee2643bcb166112377fa230" and "7d8bfbbb62ac034472381e4d4be32ee9ee336206" have entirely different histories.
08113e45fb
...
7d8bfbbb62
16
src/main.rs
16
src/main.rs
|
@ -202,20 +202,18 @@ async fn git_proto(payload : web::Payload, web::Path((owner, reponame)): web::Pa
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("Write body...");
|
println!("Write body...");
|
||||||
//let mut body = Vec::new();
|
let mut body = Vec::new();
|
||||||
//rdr.bytes()
|
//rdr.bytes()
|
||||||
let response = builder.streaming(stream::repeat_with(|| {
|
|
||||||
let mut buff : [u8; 1024] = [0; 1024];
|
let mut buff : [u8; 1024] = [0; 1024];
|
||||||
match rdr.read(&mut buff[..]) {
|
builder.streaming(stream::repeat_with(|| {
|
||||||
Ok(l) => {Ok(Bytes::copy_from_slice(&buff[0..l]))}
|
match rdr.read(&buff) {
|
||||||
Err(e) => {Err(e)}
|
Ok(l) => {Bytes::copy_from_slice(&buff[0..l])}
|
||||||
|
Err(_) => {}
|
||||||
}
|
}
|
||||||
}).take_while(|bytes| {
|
|
||||||
future::ready(bytes.is_ok())
|
|
||||||
}));
|
}));
|
||||||
//rdr.read_to_end(&mut body)?;
|
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(response);
|
return Ok(builder.body(body));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue