Enable session affinity for canaries (#7371)

This commit is contained in:
wasker 2021-07-29 14:23:19 -07:00 committed by GitHub
parent a327a809d9
commit f222c752be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 1021 additions and 322 deletions

View file

@ -65,4 +65,19 @@ function _M.split_upstream_addr(addrs_str)
return host_and_ports
end
-- Splits string by delimiter. Returns array of parsed values and the length of the array.
function _M.split_string(what, delim)
local result = {}
local idx = 0
if what and delim and delim ~= "" then
for chunk in what:gmatch("([^" .. delim .. "]+)") do
idx = idx + 1
result[idx] = chunk
end
end
return result, idx
end
return _M