Poll should be pending when there's not enough data to read.

This commit is contained in:
Kavin 2023-12-14 22:19:09 +00:00
parent 1dbe891119
commit 437ee17508
No known key found for this signature in database
GPG Key ID: 6E4598CA5C92C41F
1 changed files with 2 additions and 2 deletions

View File

@ -119,11 +119,11 @@ where
if !this.found_stream && !this.buffer.is_empty() {
let (segment_type, s1) = match read_variable_integer(&this.buffer, 0) {
Ok(result) => result,
Err(e) => return Poll::Ready(Some(Err(e))),
Err(_) => return Poll::Pending,
};
let (segment_length, s2) = match read_variable_integer(&this.buffer, s1) {
Ok(result) => result,
Err(e) => return Poll::Ready(Some(Err(e))),
Err(_) => return Poll::Pending,
};
if segment_type != 21 {
// Not the stream