From 7b40d5b0ff1ad40ebd1164b6a7ae13151ef29cac Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 8 Feb 2020 19:07:09 +0800 Subject: [PATCH] Revert "luci-app-ssr-plus: fix ssr subscribe (#2960)" This reverts commit 1631d29f8746b8eb70e9270e6ede7a3ece9b99fa. --- .../root/usr/share/shadowsocksr/subscribe.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua b/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua index a785d88e3..8b9b75954 100644 --- a/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua +++ b/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua @@ -31,16 +31,16 @@ local function split(full, sep) full = full:gsub("%z", "") -- 这里不是很清楚 有时候结尾带个\0 local off, result = 1, {} while true do - local nStart, nEnd = full:find(sep, off) - if not nStart then + local nEnd = full:find(sep, off) + if not nEnd then local res = ssub(full, off, slen(full)) if #res > 0 then -- 过滤掉 \0 tinsert(result, res) end break else - tinsert(result, ssub(full, off, nStart - 1)) - off = nEnd + 1 + tinsert(result, ssub(full, off, nEnd - 1)) + off = nEnd + slen(sep) end end return result @@ -107,7 +107,7 @@ local function processData(szType, content) } result.hashkey = type(content) == 'string' and md5(content) or md5(jsonStringify(content)) if szType == 'ssr' then - local dat = split(content, "/%?") + local dat = split(content, "/\\?") local hostInfo = split(dat[1], ':') result.server = hostInfo[1] result.server_port = hostInfo[2] @@ -191,7 +191,7 @@ local function processData(szType, content) result.type = "ss" result.server = host[1] if host[2]:find("/\\?") then - local query = split(host[2], "/%?") + local query = split(host[2], "/\\?") result.server_port = query[1] -- local params = {} -- for _, v in pairs(split(query[2], '&')) do