git » swiftpm » commit 6f33bf1

Retry handshake on would block

author Stephen Paul Weber
2026-10-27 21:18:51 UTC
committer Stephen Paul Weber
2026-10-27 21:29:30 UTC
parent d3fe10a19884bce813c95672d82e9c429546966b

Retry handshake on would block

otherwise haxe just throws Block, no good

Sources/c_borogove/src/hx/libs/ssl/SSL.cpp +1 -1

diff --git a/Sources/c_borogove/src/hx/libs/ssl/SSL.cpp b/Sources/c_borogove/src/hx/libs/ssl/SSL.cpp
index c58f79e..a76bd19 100644
--- a/Sources/c_borogove/src/hx/libs/ssl/SSL.cpp
+++ b/Sources/c_borogove/src/hx/libs/ssl/SSL.cpp
@@ -149,7 +149,7 @@ void _hx_ssl_set_hostname(Dynamic hssl, String hostname) {
 void _hx_ssl_handshake(Dynamic hssl) {
 	sslctx* ctx = val_ssl(hssl);
 	OSStatus s = SSLHandshake(ctx->sslCtx);
-	if (s == errSSLWouldBlock) hx::Throw(HX_CSTRING("Blocking"));
+	if (s == errSSLWouldBlock) return _hx_ssl_handshake(hssl);
 	if (s != noErr) hx::Throw(HX_CSTRING("SSL handshake error"));
 }