|
|
@ -15,10 +15,12 @@ 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 {
|
|
|
|
let cnt = body.bytes().len();
|
|
|
|
buffer.extend_from_slice(body.bytes()); // XXX: what the fuck is wrong with this??? why it eat spaces????
|
|
|
|
body.advance(cnt);
|
|
|
|
let cnt = body.bytes().len();
|
|
|
|
written += cnt;
|
|
|
|
body.advance(cnt);
|
|
|
|
|
|
|
|
written += cnt;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if !buffer.ends_with(&[b'\n']) { // probably useless eh?
|
|
|
|
if !buffer.ends_with(&[b'\n']) { // probably useless eh?
|
|
|
|