From 1921f2bf4964a9090633420d38d2535e4cd1f647 Mon Sep 17 00:00:00 2001 From: quininer kel Date: Tue, 28 Feb 2017 08:53:52 +0800 Subject: [PATCH] [Fixed] TlsStream should not check poll_write --- examples/server.rs | 1 + src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/server.rs b/examples/server.rs index ca67f0e..283d016 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -77,6 +77,7 @@ fn main() { \r\n\ Hello world!".as_bytes() )) + .and_then(|(stream, _)| io::flush(stream)) .map(move |_| println!("Accept: {}", addr)) .map_err(move |err| println!("Error: {:?} - {}", err, addr)); handle.spawn(done); diff --git a/src/lib.rs b/src/lib.rs index 9bd1953..e815aff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -221,7 +221,7 @@ impl io::Write for TlsStream fn flush(&mut self) -> io::Result<()> { self.session.flush()?; - while self.session.wants_write() && self.io.poll_write().is_ready() { + while self.session.wants_write() { self.session.write_tls(&mut self.io)?; } Ok(())