From c38c1b4cf56ccf4e86b1dd1631233e5825969b12 Mon Sep 17 00:00:00 2001 From: Tindy X <49061470+tindy2013@users.noreply.github.com> Date: Sun, 29 Dec 2019 19:31:17 +0800 Subject: [PATCH] Bug fixes Fix when rulesets and groups are provided in request URLs, new rules will not be used. Fix cached rule base not updating after calling "/readconf", "/refreshrules" or "/updateconf". --- src/main.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c950d6d..b61ac7a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,7 +75,7 @@ void setcd(char *argv[]) chdir(path.data()); } -std::string refreshRulesets(string_array &ruleset_list, std::vector &rca) +void refreshRulesets(string_array &ruleset_list, std::vector &rca) { eraseElements(rca); std::string rule_group, rule_url; @@ -128,8 +128,6 @@ std::string refreshRulesets(string_array &ruleset_list, std::vector std::string @@ -610,6 +610,7 @@ int main(int argc, char *argv[]) return "Unauthorized"; } readConf(); + generateBase(); return "done"; }); @@ -631,6 +632,7 @@ int main(int argc, char *argv[]) readConf(); if(!update_ruleset_on_request) refreshRulesets(rulesets, ruleset_content_array); + generateBase(); return "done"; });