Skip to content

Commit

Permalink
chore: fix comment and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Jan 12, 2024
1 parent aa56680 commit 25485ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions kong/resty/dns_client/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ local function resolve_all(self, name, opts, tries)

-- lookup fastly: no callback, which is only used for real network query
local answers, err, hit_level = self.cache:get(name)

if not answers then
answers, err, tries = resolve_names_and_types(self, name, opts, tries)
if answers then
Expand Down Expand Up @@ -343,8 +342,8 @@ function _M:resolve(name, opts, tries)

-- option: return_random
if answers[1].type == resolver.TYPE_SRV then
local answer = utils.get_rrw_ans(answers)
opts.port = (answer.port ~= 0 and answer.port) or opts.port
local answer = utils.get_wrr_ans(answers)
opts.port = answer.port ~= 0 and answer.port or opts.port
return self:resolve(answer.target, opts, tries)
end

Expand Down
2 changes: 1 addition & 1 deletion kong/resty/dns_client/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function _M.is_fqdn(name, ndots)
end


-- construct <names, types> from resolv options: search/ndots and domain
-- construct names from resolv options: search, ndots and domain
function _M.search_names(name, resolv)
if not resolv.search or _M.is_fqdn(name, resolv.ndots) then
return { name }
Expand Down

0 comments on commit 25485ba

Please sign in to comment.