Retry writes

This commit is contained in:
Les De Ridder 2019-05-02 02:59:08 +02:00
parent 054a1bf15b
commit 8ae0b4f6a7
1 changed files with 9 additions and 2 deletions

View File

@ -297,6 +297,12 @@ class TLSClient
auto bytesWritten = SSL_write(_ssl, cast(const char*) message, cast(int) message.length); auto bytesWritten = SSL_write(_ssl, cast(const char*) message, cast(int) message.length);
if (bytesWritten <= 0) if (bytesWritten <= 0)
{
if (SSL_get_error(_ssl, bytesWritten) == SSL_ERROR_WANT_WRITE)
{
write(message);
}
else
{ {
stderr.writeln("uh-oh"); stderr.writeln("uh-oh");
@ -304,6 +310,7 @@ class TLSClient
} }
} }
} }
}
struct Message struct Message
{ {