diff options
| author | fengweihao <[email protected]> | 2023-11-22 19:30:27 +0800 |
|---|---|---|
| committer | 冯伟浩 <[email protected]> | 2023-11-22 11:30:49 +0000 |
| commit | 6efee0fdc8694911e9cef84002a1da2e1a025388 (patch) | |
| tree | b17cb101022b295d4c2219db4ffc9e73a23a1763 /plugin | |
| parent | 15582f5d51f0700c07f5b428185b55c13fc4a568 (diff) | |
TSG-17512 Proxy适配Maat4关于compile表特性变更v4.8.47-20231122
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/business/doh/src/doh.cpp | 2 | ||||
| -rw-r--r-- | plugin/business/tsg-http/src/tsg_http.cpp | 12 | ||||
| -rw-r--r-- | plugin/business/tsg-http/src/tsg_web_cache.cpp | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/plugin/business/doh/src/doh.cpp b/plugin/business/doh/src/doh.cpp index 500f577..9d280d8 100644 --- a/plugin/business/doh/src/doh.cpp +++ b/plugin/business/doh/src/doh.cpp @@ -152,7 +152,7 @@ static void doh_get_cheat_data(long long p_result, int qtype, struct doh_ctx *ct cJSON *answer_array = NULL; int table_id=0; - table_id=maat_get_table_id(g_doh_conf->maat, "PXY_CTRL_COMPILE"); + table_id=maat_get_table_id(g_doh_conf->maat, "PXY_CTRL_COMPILE_PLUGIN"); if(table_id < 0) { return; diff --git a/plugin/business/tsg-http/src/tsg_http.cpp b/plugin/business/tsg-http/src/tsg_http.cpp index a72326d..01afccc 100644 --- a/plugin/business/tsg-http/src/tsg_http.cpp +++ b/plugin/business/tsg-http/src/tsg_http.cpp @@ -174,7 +174,7 @@ struct tsg_proxy_rt Ratelimiter_handle_t ratelimiter; int enable_rate; - int ctrl_compile_idx; + int ctrl_plugin_idx; int ca_store_reseting; int enable_plugin; }; @@ -1037,8 +1037,8 @@ int proxy_policy_init(const char* profile_path, const char* static_section, cons } } - g_proxy_rt->ctrl_compile_idx=maat_get_table_id(g_proxy_rt->feather, "PXY_CTRL_COMPILE"); - maat_plugin_table_ex_schema_register(g_proxy_rt->feather, "PXY_CTRL_COMPILE", + g_proxy_rt->ctrl_plugin_idx=maat_get_table_id(g_proxy_rt->feather, "PXY_CTRL_COMPILE_PLUGIN"); + maat_plugin_table_ex_schema_register(g_proxy_rt->feather, "PXY_CTRL_COMPILE_PLUGIN", policy_action_param_new, policy_action_param_free_cb, policy_action_param_dup, @@ -1499,7 +1499,7 @@ static enum proxy_action decide_ctrl_action(long long *results, size_t n_hit, hit_rules=ALLOC(struct maat_rule_t, n_hit); for (i = 0; i < n_hit && i<MAX_SCAN_RESULT; i++) { - get_ex_param =(struct policy_action_param *)maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_compile_idx, (const char *)&results[i], sizeof(results[i])); + get_ex_param =(struct policy_action_param *)maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_plugin_idx, (const char *)&results[i], sizeof(results[i])); if(get_ex_param==NULL) { continue; @@ -1548,7 +1548,7 @@ static enum proxy_action decide_ctrl_action(long long *results, size_t n_hit, } *enforce_rules[0]=*prior_rule; *n_enforce=1; - ex_data=maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_compile_idx, (const char *)&prior_rule->config_id, sizeof(prior_rule->config_id)); + ex_data=maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_plugin_idx, (const char *)&prior_rule->config_id, sizeof(prior_rule->config_id)); if(ex_data!=NULL) { *param=(struct policy_action_param*)ex_data; @@ -1582,7 +1582,7 @@ static enum proxy_action decide_ctrl_action(long long *results, size_t n_hit, memcpy(*enforce_rules + exist_enforce_num + 1, monit_rule, n_monit * sizeof(struct maat_rule_t)); } - ex_data=maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_compile_idx, (const char *)&prior_rule->config_id, sizeof(prior_rule->config_id)); + ex_data=maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_plugin_idx, (const char *)&prior_rule->config_id, sizeof(prior_rule->config_id)); if(ex_data!=NULL) { *param=(struct policy_action_param*)ex_data; diff --git a/plugin/business/tsg-http/src/tsg_web_cache.cpp b/plugin/business/tsg-http/src/tsg_web_cache.cpp index 1f63d55..5f2d10e 100644 --- a/plugin/business/tsg-http/src/tsg_web_cache.cpp +++ b/plugin/business/tsg-http/src/tsg_web_cache.cpp @@ -784,10 +784,10 @@ struct cache_handle* create_web_cache_handle(const char* profile_path, const cha if(cache->cache_policy_enabled) { - cache->cache_param_idx=maat_get_table_id(feather, "PXY_CACHE_COMPILE"); + cache->cache_param_idx=maat_get_table_id(feather, "PXY_CACHE_COMPILE_PLUGIN"); cache->table_url_constraint=maat_get_table_id(feather, "PXY_CACHE_HTTP_URL"); cache->table_cookie_constraint=maat_get_table_id(feather, "PXY_CACHE_HTTP_COOKIE"); - cache->cache_param_idx=maat_plugin_table_ex_schema_register(feather, "PXY_CACHE_COMPILE", + cache->cache_param_idx=maat_plugin_table_ex_schema_register(feather, "PXY_CACHE_COMPILE_PLUGIN", cache_param_new, cache_param_free, cache_param_dup, 0, cache); cache->ref_feather=feather; |
