wtf is wrong with the space eating

serve
Avril 4 years ago
parent 93e1d335dc
commit d44fa5c40b
Signed by: flanchan
GPG Key ID: 284488987C31F630

2
Cargo.lock generated

@ -639,7 +639,7 @@ dependencies = [
[[package]]
name = "markov"
version = "0.3.3"
version = "0.3.4"
dependencies = [
"async-compression",
"cfg-if 1.0.0",

@ -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 {
let mut body = buf.map_err(|_| FillBodyError)?;
while body.has_remaining() {
buffer.extend_from_slice(body.bytes());
let cnt = body.bytes().len();
body.advance(cnt);
written += cnt;
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();
body.advance(cnt);
written += cnt;
}
}
}
if !buffer.ends_with(&[b'\n']) { // probably useless eh?

Loading…
Cancel
Save