[Fixed] TlsStream should not check poll_write

This commit is contained in:
quininer kel 2017-02-28 08:53:52 +08:00
parent 7e4fcca032
commit 1921f2bf49
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -221,7 +221,7 @@ impl<S, C> io::Write for TlsStream<S, C>
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(())