You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by me...@apache.org on 2020/06/16 05:35:04 UTC
[incubator-apisix] branch master updated: change: use `iterate` to
scan items in etcd. (#1717)
This is an automated email from the ASF dual-hosted git repository.
membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 1251385 change: use `iterate` to scan items in etcd. (#1717)
1251385 is described below
commit 12513857346e7cc66620484bedea2a9c80717108
Author: xxm404 <46...@users.noreply.github.com>
AuthorDate: Tue Jun 16 13:34:53 2020 +0800
change: use `iterate` to scan items in etcd. (#1717)
related issue: #1685
---
apisix/http/router/radixtree_sni.lua | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/apisix/http/router/radixtree_sni.lua b/apisix/http/router/radixtree_sni.lua
index bfe7160..1eb7aa5 100644
--- a/apisix/http/router/radixtree_sni.lua
+++ b/apisix/http/router/radixtree_sni.lua
@@ -18,7 +18,8 @@ local get_request = require("resty.core.base").get_request
local radixtree_new = require("resty.radixtree").new
local core = require("apisix.core")
local ngx_ssl = require("ngx.ssl")
-local ipairs = ipairs
+local config_util = require("apisix.core.config_util")
+local ipairs = ipairs
local type = type
local error = error
local str_find = string.find
@@ -52,9 +53,8 @@ local function create_router(ssl_items)
local aes_128_cbc_with_iv = (type(iv)=="string" and #iv == 16) and
assert(aes:new(iv, nil, aes.cipher(128, "cbc"), {iv=iv})) or nil
- for _, ssl in ipairs(ssl_items) do
- if type(ssl) == "table" and
- ssl.value ~= nil and
+ for _, ssl in config_util.iterate_values(ssl_items) do
+ if ssl.value ~= nil and
(ssl.value.status == nil or ssl.value.status == 1) then -- compatible with old version
local j = 0