|
|
@ -15,12 +15,14 @@ pub async fn full(who: &IpAddr, state: State, mut body: impl Unpin + Stream<Item
|
|
|
|
while let Some(buf) = body.next().await {
|
|
|
|
while let Some(buf) = body.next().await {
|
|
|
|
let mut body = buf.map_err(|_| FillBodyError)?;
|
|
|
|
let mut body = buf.map_err(|_| FillBodyError)?;
|
|
|
|
while body.has_remaining() {
|
|
|
|
while body.has_remaining() {
|
|
|
|
buffer.extend_from_slice(body.bytes());
|
|
|
|
if body.bytes().len() > 0 {
|
|
|
|
|
|
|
|
buffer.extend_from_slice(body.bytes()); // XXX: what the fuck is wrong with this??? why it eat spaces????
|
|
|
|
let cnt = body.bytes().len();
|
|
|
|
let cnt = body.bytes().len();
|
|
|
|
body.advance(cnt);
|
|
|
|
body.advance(cnt);
|
|
|
|
written += cnt;
|
|
|
|
written += cnt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if !buffer.ends_with(&[b'\n']) { // probably useless eh?
|
|
|
|
if !buffer.ends_with(&[b'\n']) { // probably useless eh?
|
|
|
|
buffer.push(b'\n');
|
|
|
|
buffer.push(b'\n');
|
|
|
|
}
|
|
|
|
}
|
|
|
|