[Fixed] TlsStream::read ConnectionAborted
This commit is contained in:
parent
66835b5040
commit
6e7d67cccb
@ -7,3 +7,7 @@ authors = ["quininer kel <quininer@live.com>"]
|
|||||||
futures = "*"
|
futures = "*"
|
||||||
tokio-core = "*"
|
tokio-core = "*"
|
||||||
rustls = "*"
|
rustls = "*"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
clap = "*"
|
||||||
|
webpki-roots = "*"
|
||||||
|
10
src/lib.rs
10
src/lib.rs
@ -161,11 +161,11 @@ impl<S, C> io::Read for TlsStream<S, C>
|
|||||||
where S: Io, C: Session
|
where S: Io, C: Session
|
||||||
{
|
{
|
||||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||||
loop {
|
self.do_io()?;
|
||||||
match self.session.read(buf) {
|
if self.eof {
|
||||||
Ok(0) if !self.eof => self.do_io()?,
|
Ok(0)
|
||||||
output => return output
|
} else {
|
||||||
}
|
self.session.read(buf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user