From 222cb6ba7307c935df092dfe2cc9e7b3befa2e2f Mon Sep 17 00:00:00 2001 From: alan crouau Date: Mon, 9 Sep 2024 14:52:43 +0200 Subject: [PATCH] [tls socket] rm non-blocking i/o code --- tool/net/ltls.inc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tool/net/ltls.inc b/tool/net/ltls.inc index d18e697ea..a3b697376 100644 --- a/tool/net/ltls.inc +++ b/tool/net/ltls.inc @@ -212,12 +212,9 @@ static int tls_read(lua_State *L) { lua_pushnil(L); return 1; } else { + // All negative values are treated as errors lua_pushnil(L); - if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) { - lua_pushstring(L, "EAGAIN"); - } else { - lua_pushfstring(L, "Read error: %d", ret); - } + lua_pushfstring(L, "Read error: %d", ret); return 2; } }