From 75db2e6cec4f03c7a8e0a0ce28d8ccc95b6dd963 Mon Sep 17 00:00:00 2001 From: linjp1 Date: Fri, 16 May 2025 15:48:18 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20fix=20issue=20#499=EF=BC=8Cto=20avoid?= =?UTF-8?q?=20unexpect=20assertion=20when=20c=20func=20return=20FFI=5FOK?= =?UTF-8?q?=20immediately.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/resty/core/socket.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/resty/core/socket.lua b/lib/resty/core/socket.lua index 9fbb158ae..b648435fa 100644 --- a/lib/resty/core/socket.lua +++ b/lib/resty/core/socket.lua @@ -257,6 +257,15 @@ local function sslhandshake(cosocket, reused_session, server_name, ssl_verify, error("no request ctx found", 2) end + if rc == FFI_OK then + if reused_session == false then + return true + end + + rc = C.ngx_http_lua_ffi_socket_tcp_get_sslhandshake_result(r, u, + session_ptr, errmsg, openssl_error_code) + end + while true do if rc == FFI_ERROR then if openssl_error_code[0] ~= 0 then