mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-29 02:31:20 +00:00
Fix infinite loop in read_one (#910)
* Fix infinite loop in read_one * Also fix request_respond
This commit is contained in:
parent
4fe77e8658
commit
21810e46bd
@ -219,6 +219,7 @@ where
|
||||
len_buf,
|
||||
max_size,
|
||||
};
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -229,6 +230,7 @@ where
|
||||
}
|
||||
Async::NotReady => {
|
||||
self.inner = ReadOneInner::ReadRest(inner);
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -376,6 +378,7 @@ where
|
||||
}
|
||||
Async::NotReady => {
|
||||
self.inner = RequestResponseInner::Write(inner, max_size, then);
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -383,6 +386,7 @@ where
|
||||
Async::Ready(packet) => return Ok(Async::Ready(packet)),
|
||||
Async::NotReady => {
|
||||
self.inner = RequestResponseInner::Read(inner);
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
},
|
||||
RequestResponseInner::Poisoned => panic!(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user