Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Sep 10, 2024
1 parent fb55ce9 commit 69358cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ntex-glommio/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct Write(TcpStream);
impl ntex_io::AsyncWrite for Write {
#[inline]
async fn write(&mut self, mut buf: BytesVec) -> (BytesVec, io::Result<()>) {
match lazy(|cx| flush_io(&mut self.0, &mut buf, cx)).await {
match lazy(|cx| flush_io(&mut *self.0.0.borrow_mut(), &mut buf, cx)).await {
Poll::Ready(res) => (buf, res),
Poll::Pending => (buf, Ok(())),
}
Expand All @@ -74,7 +74,7 @@ impl ntex_io::AsyncWrite for Write {

#[inline]
async fn shutdown(&mut self) -> io::Result<()> {
poll_fn(|cx| Pin::new(&mut self.0).poll_close(cx)).await
poll_fn(|cx| Pin::new(&mut *self.0.0.borrow_mut()).poll_close(cx)).await
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ struct UnixWrite(UnixStream);
impl ntex_io::AsyncWrite for UnixWrite {
#[inline]
async fn write(&mut self, mut buf: BytesVec) -> (BytesVec, io::Result<()>) {
match lazy(|cx| flush_io(&mut self.0, &mut buf, cx)).await {
match lazy(|cx| flush_io(&mut *self.0.0.borrow_mut(), &mut buf, cx)).await {
Poll::Ready(res) => (buf, res),
Poll::Pending => (buf, Ok(())),
}
Expand All @@ -189,6 +189,6 @@ impl ntex_io::AsyncWrite for UnixWrite {

#[inline]
async fn shutdown(&mut self) -> io::Result<()> {
poll_fn(|cx| Pin::new(&mut self.0).poll_close(cx)).await
poll_fn(|cx| Pin::new(&mut *self.0.0.borrow_mut()).poll_close(cx)).await
}
}

0 comments on commit 69358cc

Please sign in to comment.