Fix WouldBlock being returned in wasm-ext (#1407)

* Fix WouldBlock being returned

* Fix other WouldBlocks
This commit is contained in:
Pierre Krieger
2020-01-24 15:18:45 +01:00
committed by GitHub
parent d8bafc1f0a
commit 0cb3cd4262
2 changed files with 3 additions and 3 deletions

View File

@ -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.
/// ///

View File

@ -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;
} }
}; };