mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 16:21:39 +00:00
Fix WouldBlock being returned in wasm-ext (#1407)
* Fix WouldBlock being returned * Fix other WouldBlocks
This commit is contained in:
@ -433,7 +433,7 @@ impl<T: AsyncWrite + Unpin> AsyncWrite for NoiseOutput<T> {
|
|||||||
///
|
///
|
||||||
/// Panics if `off >= 2`.
|
/// Panics if `off >= 2`.
|
||||||
///
|
///
|
||||||
/// When [`io::ErrorKind::WouldBlock`] is returned, the given buffer and offset
|
/// When [`Poll::Pending`] is returned, the given buffer and offset
|
||||||
/// may have been updated (i.e. a byte may have been read) and must be preserved
|
/// may have been updated (i.e. a byte may have been read) and must be preserved
|
||||||
/// for the next invocation.
|
/// for the next invocation.
|
||||||
///
|
///
|
||||||
@ -466,7 +466,7 @@ fn read_frame_len<R: AsyncRead + Unpin>(
|
|||||||
///
|
///
|
||||||
/// Panics if `off >= 2`.
|
/// Panics if `off >= 2`.
|
||||||
///
|
///
|
||||||
/// When [`io::ErrorKind::WouldBlock`] is returned, the given offset
|
/// When [`Poll::Pending`] is returned, the given offset
|
||||||
/// may have been updated (i.e. a byte may have been written) and must
|
/// may have been updated (i.e. a byte may have been written) and must
|
||||||
/// be preserved for the next invocation.
|
/// be preserved for the next invocation.
|
||||||
///
|
///
|
||||||
|
@ -395,7 +395,7 @@ impl AsyncRead for Connection {
|
|||||||
Poll::Ready(Err(err)) => break Poll::Ready(Err(io::Error::from(JsErr::from(err)))),
|
Poll::Ready(Err(err)) => break Poll::Ready(Err(io::Error::from(JsErr::from(err)))),
|
||||||
Poll::Pending => {
|
Poll::Pending => {
|
||||||
self.read_state = ConnectionReadState::Waiting(promise);
|
self.read_state = ConnectionReadState::Waiting(promise);
|
||||||
break Poll::Ready(Err(io::ErrorKind::WouldBlock.into()));
|
break Poll::Pending;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user