From 28d130f5d24dfb3d3ed72bb78135ca403d2abf10 Mon Sep 17 00:00:00 2001 From: Xiaochen Wang Date: Mon, 25 Dec 2023 16:56:32 +0800 Subject: [PATCH] style(globalpatches): remove the compatibility code for the sock:connect bug The official OpenResty has fixed the bug of sock:connect API, so we do not need to make it compatible for this. For more details of this bug, see https://github.com/openresty/lua-nginx-module/issues/860. --- kong/globalpatches.lua | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/kong/globalpatches.lua b/kong/globalpatches.lua index c3782f0c8a0f..9de84f9588b0 100644 --- a/kong/globalpatches.lua +++ b/kong/globalpatches.lua @@ -534,15 +534,6 @@ return function(options) local old_tcp_connect local old_udp_setpeername - -- need to do the extra check here: https://github.com/openresty/lua-nginx-module/issues/860 - local function strip_nils(first, second) - if second then - return first, second - elseif first then - return first - end - end - local function resolve_connect(f, sock, host, port, opts) if sub(host, 1, 5) ~= "unix:" then local try_list @@ -553,7 +544,7 @@ return function(options) end end - return f(sock, host, strip_nils(port, opts)) + return f(sock, host, port, opts) end local function tcp_resolve_connect(sock, host, port, opts)