[BUGFIX]fix xx_plugin user_tag lifecycle
This commit is contained in:
@@ -38,11 +38,12 @@ struct ip_plugin_schema {
|
||||
struct ip_plugin_runtime {
|
||||
struct ip_matcher *ip_matcher;
|
||||
struct ex_data_runtime *ex_data_rt;
|
||||
long long rule_num;
|
||||
long long update_err_cnt;
|
||||
size_t n_worker_thread;
|
||||
struct maat_garbage_bin *ref_garbage_bin;
|
||||
struct log_handle *logger;
|
||||
|
||||
long long rule_num;
|
||||
long long update_err_cnt;
|
||||
};
|
||||
|
||||
void *ip_plugin_schema_new(cJSON *json, struct table_manager *tbl_mgr,
|
||||
@@ -494,11 +495,9 @@ int ip_plugin_runtime_commit(void *ip_plugin_runtime, const char *table_name,
|
||||
return 0;
|
||||
}
|
||||
|
||||
ex_data_runtime_commit(ex_data_rt);
|
||||
|
||||
struct ip_rule *rules = NULL;
|
||||
struct ex_container **ex_container = NULL;
|
||||
size_t rule_cnt = ex_data_runtime_list_ex_container(ex_data_rt, &ex_container);
|
||||
size_t rule_cnt = ex_data_runtime_list_updating_ex_container(ex_data_rt, &ex_container);
|
||||
if (rule_cnt > 0) {
|
||||
rules = ALLOC(struct ip_rule, rule_cnt);
|
||||
for (size_t i = 0; i < rule_cnt; i++) {
|
||||
@@ -529,6 +528,8 @@ int ip_plugin_runtime_commit(void *ip_plugin_runtime, const char *table_name,
|
||||
|
||||
old_ip_matcher = ip_plugin_rt->ip_matcher;
|
||||
ip_plugin_rt->ip_matcher = new_ip_matcher;
|
||||
ex_data_runtime_commit(ex_data_rt);
|
||||
|
||||
if (old_ip_matcher != NULL) {
|
||||
maat_garbage_bagging(ip_plugin_rt->ref_garbage_bin, old_ip_matcher, NULL,
|
||||
garbage_ip_matcher_free);
|
||||
|
||||
Reference in New Issue
Block a user