Skip to content

Commit dbef7a7

Browse files
committed
Don't try to write to a buffered socket if there's no data.
This can cause the SSL modules to act weirdly because the TLS library will return 0 bytes written (correctly) which is then interpreted as an error.
1 parent fca421a commit dbef7a7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/socket_transport.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ bool BufferedSocket::ProcessRead()
4242

4343
bool BufferedSocket::ProcessWrite()
4444
{
45+
if (this->write_buffer.empty())
46+
return true;
47+
4548
int count = this->io->Send(this, this->write_buffer);
4649
if (count == 0)
4750
return false;

0 commit comments

Comments
 (0)