Skip to content

Commit

Permalink
style(globalpatches): remove the compatibility code for the sock:conn…
Browse files Browse the repository at this point in the history
…ect 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 openresty/lua-nginx-module#860.
  • Loading branch information
chobits authored and AndyZhang0707 committed Dec 26, 2023
1 parent 6e91c99 commit 28d130f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions kong/globalpatches.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 28d130f

Please sign in to comment.