mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 22:10:01 -04:00
make wisp-mux no longer eat data, fix wisp-mux stream read api
This commit is contained in:
parent
0c8fe25089
commit
f3a78a1715
4 changed files with 23 additions and 16 deletions
|
@ -73,7 +73,7 @@ pin_project! {
|
|||
/// Read side of a multiplexor stream that implements futures `Stream`.
|
||||
pub struct MuxStreamIoStream {
|
||||
#[pin]
|
||||
pub(crate) rx: Pin<Box<dyn Stream<Item = Bytes> + Send>>,
|
||||
pub(crate) rx: Pin<Box<dyn Stream<Item = Result<Bytes, WispError>> + Send>>,
|
||||
pub(crate) is_closed: Arc<AtomicBool>,
|
||||
pub(crate) close_reason: Arc<AtomicCloseReason>,
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ impl MuxStreamIoStream {
|
|||
impl Stream for MuxStreamIoStream {
|
||||
type Item = Result<Bytes, std::io::Error>;
|
||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
self.project().rx.poll_next(cx).map(|x| x.map(Ok))
|
||||
self.project().rx.poll_next(cx).map_err(std::io::Error::other)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue