diff options
| -rw-r--r-- | mullvad-rpc/src/tcp_stream.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mullvad-rpc/src/tcp_stream.rs b/mullvad-rpc/src/tcp_stream.rs index e006c4f3dd..4930777541 100644 --- a/mullvad-rpc/src/tcp_stream.rs +++ b/mullvad-rpc/src/tcp_stream.rs @@ -92,7 +92,10 @@ impl AsyncWrite for TcpStream { ) -> Poll<io::Result<usize>> { self.do_stream( |stream| Pin::new(stream).poll_write(cx, buf), - Poll::Ready(Ok(0)), + Poll::Ready(Err(io::Error::new( + io::ErrorKind::ConnectionReset, + "socket is closed", + ))), ) } @@ -119,7 +122,10 @@ impl AsyncRead for TcpStream { ) -> Poll<io::Result<()>> { self.do_stream( |stream| Pin::new(stream).poll_read(cx, buf), - Poll::Ready(Ok(())), + Poll::Ready(Err(io::Error::new( + io::ErrorKind::ConnectionReset, + "socket is closed", + ))), ) } } |
