From 0386abcee1036f9ae18a7d50226a223c74a21eab Mon Sep 17 00:00:00 2001 From: quininer Date: Sun, 1 Sep 2019 13:30:29 +0800 Subject: [PATCH] Fix test --- Cargo.toml | 2 +- src/common/mod.rs | 1 + tests/test.rs | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cd8a8de..723ffaa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tokio-rustls" -version = "0.12.0-alpha.1" +version = "0.12.0-alpha.2" authors = ["quininer kel "] license = "MIT/Apache-2.0" repository = "https://github.com/quininer/tokio-rustls" diff --git a/src/common/mod.rs b/src/common/mod.rs index 60f0465..ac72608 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -249,6 +249,7 @@ impl<'a, IO: AsyncRead + AsyncWrite + Unpin, S: Session> AsyncWrite for Stream<' while this.session.wants_write() { futures::ready!(this.complete_inner_io(cx, Focus::Writable))?; } + Pin::new(&mut this.io).poll_shutdown(cx) } } diff --git a/tests/test.rs b/tests/test.rs index 42dd9ed..5749efe 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -44,13 +44,15 @@ lazy_static!{ let fut = async move { let mut stream = acceptor.accept(stream?).await?; -// TODO split -// let (mut reader, mut write) = stream.split(); -// reader.copy(&mut write).await?; + // TODO split + // + // let (mut reader, mut write) = stream.split(); + // reader.copy(&mut write).await?; let mut buf = vec![0; 8192]; let n = stream.read(&mut buf).await?; stream.write(&buf[..n]).await?; + let _ = stream.read(&mut buf).await?; Ok(()) as io::Result<()> };