Fix empty buffer
This commit is contained in:
parent
185f010937
commit
d6d06041d9
@ -227,6 +227,10 @@ impl<S, C> io::Write for TlsStream<S, C>
|
|||||||
where S: AsyncRead + AsyncWrite, C: Session
|
where S: AsyncRead + AsyncWrite, C: Session
|
||||||
{
|
{
|
||||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
|
if buf.len() == 0 {
|
||||||
|
return Ok(0);
|
||||||
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let output = self.session.write(buf)?;
|
let output = self.session.write(buf)?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user