This commit is contained in:
quininer 2019-09-01 13:30:29 +08:00
parent c190031761
commit 0386abcee1
3 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "tokio-rustls"
version = "0.12.0-alpha.1"
version = "0.12.0-alpha.2"
authors = ["quininer kel <quininer@live.com>"]
license = "MIT/Apache-2.0"
repository = "https://github.com/quininer/tokio-rustls"

View File

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

View File

@ -45,12 +45,14 @@ lazy_static!{
let mut stream = acceptor.accept(stream?).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<()>
};