mirror of
https://github.com/TeamPiped/piped-proxy.git
synced 2024-08-14 23:50:45 +00:00
Fix for another edge case.
This commit is contained in:
parent
3e8098d105
commit
a2e77d2668
1 changed files with 5 additions and 3 deletions
|
@ -517,7 +517,7 @@ where
|
||||||
match item {
|
match item {
|
||||||
Some(Ok(bytes)) => {
|
Some(Ok(bytes)) => {
|
||||||
if this.found_stream {
|
if this.found_stream {
|
||||||
return if this.remaining > 0 {
|
if this.remaining > 0 {
|
||||||
let len = std::cmp::min(this.remaining, bytes.len());
|
let len = std::cmp::min(this.remaining, bytes.len());
|
||||||
this.remaining -= len;
|
this.remaining -= len;
|
||||||
if this.remaining == 0 {
|
if this.remaining == 0 {
|
||||||
|
@ -525,9 +525,11 @@ where
|
||||||
this.buffer.extend_from_slice(&bytes[len..]);
|
this.buffer.extend_from_slice(&bytes[len..]);
|
||||||
this.found_stream = false;
|
this.found_stream = false;
|
||||||
}
|
}
|
||||||
Poll::Ready(Some(Ok(bytes.slice(0..len))))
|
return Poll::Ready(Some(Ok(bytes.slice(0..len))));
|
||||||
} else {
|
} else {
|
||||||
Poll::Ready(None)
|
this.found_stream = false;
|
||||||
|
this.buffer.clear();
|
||||||
|
this.buffer.extend_from_slice(&bytes);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
this.buffer.extend_from_slice(&bytes);
|
this.buffer.extend_from_slice(&bytes);
|
||||||
|
|
Loading…
Reference in a new issue