From 0913af1af98ea59f9620ecf4fad38bb68ca8cf9a Mon Sep 17 00:00:00 2001 From: quininer kel Date: Thu, 30 Mar 2017 15:39:11 +0800 Subject: [PATCH] [Fixed] should flush when shutdown --- Cargo.toml | 8 +++----- src/lib.rs | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4663061..0ea33f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,13 @@ [package] name = "tokio-rustls" -version = "0.1.4" +version = "0.1.5" authors = ["quininer kel "] license = "MIT/Apache-2.0" repository = "https://github.com/quininer/tokio-rustls" homepage = "https://github.com/quininer/tokio-rustls" documentation = "https://docs.rs/tokio-rustls" -description = """ -An implementation of TLS/SSL streams for Tokio giving an implementation of TLS -for nonblocking I/O streams. -""" +description = "Asynchronous TLS/SSL streams for Tokio using Rustls." +categories = ["asynchronous", "network-programming"] [dependencies] futures = "0.1" diff --git a/src/lib.rs b/src/lib.rs index fa945c4..dc92868 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ #[cfg_attr(feature = "tokio-proto", macro_use)] extern crate futures; -extern crate tokio_io; +#[macro_use] extern crate tokio_io; extern crate rustls; pub mod proto; @@ -244,6 +244,7 @@ impl AsyncWrite for TlsStream { fn shutdown(&mut self) -> Poll<(), io::Error> { self.session.send_close_notify(); + try_nb!(io::Write::flush(self)); self.io.shutdown() } }