fix: not write zero
This commit is contained in:
parent
8b8647b43d
commit
681cbe68ca
@ -187,10 +187,8 @@ where IO: AsyncRead + AsyncWrite
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let mut stream = Stream::new(&mut self.io, &mut self.session);
|
||||
try_nb!(stream.complete_io());
|
||||
}
|
||||
self.io.shutdown()
|
||||
stream.io.shutdown()
|
||||
}
|
||||
}
|
||||
|
@ -110,8 +110,14 @@ impl<'a, IO: AsyncRead + AsyncWrite, S: Session> Write for Stream<'a, IO, S> {
|
||||
Err(err) => return Err(err)
|
||||
}
|
||||
}
|
||||
|
||||
if len == 0 && !buf.is_empty() {
|
||||
// not write zero
|
||||
Err(io::ErrorKind::WouldBlock.into())
|
||||
} else {
|
||||
Ok(len)
|
||||
}
|
||||
}
|
||||
|
||||
fn flush(&mut self) -> io::Result<()> {
|
||||
self.session.flush()?;
|
||||
|
@ -24,12 +24,14 @@ use tokio_io::{ AsyncRead, AsyncWrite, try_nb };
|
||||
use common::Stream;
|
||||
|
||||
|
||||
/// A wrapper around a `rustls::ClientConfig`, providing an async `connect` method.
|
||||
#[derive(Clone)]
|
||||
pub struct TlsConnector {
|
||||
inner: Arc<ClientConfig>,
|
||||
early_data: bool
|
||||
}
|
||||
|
||||
/// A wrapper around a `rustls::ServerConfig`, providing an async `accept` method.
|
||||
#[derive(Clone)]
|
||||
pub struct TlsAcceptor {
|
||||
inner: Arc<ServerConfig>
|
||||
|
@ -130,10 +130,8 @@ where IO: AsyncRead + AsyncWrite,
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
let mut stream = Stream::new(&mut self.io, &mut self.session);
|
||||
try_nb!(stream.complete_io());
|
||||
}
|
||||
self.io.shutdown()
|
||||
stream.io.shutdown()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user