summaryrefslogtreecommitdiff
path: root/src/tsg_rule.cpp
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2023-06-18 15:56:06 +0800
committerliuxueli <[email protected]>2023-06-18 15:56:06 +0800
commita9bf36ac67f0131a0f16a061358affaab71d541a (patch)
tree9e093d4c2a9b73278b633fd84517a1a5ec465b50 /src/tsg_rule.cpp
parent910f97b3bf4ce87dd08d81a8b7883cff6415496f (diff)
TSG-13421: 错误的free app_id_dict导致app_full_path为空的现象
Diffstat (limited to 'src/tsg_rule.cpp')
-rw-r--r--src/tsg_rule.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp
index 3b43790..eadb191 100644
--- a/src/tsg_rule.cpp
+++ b/src/tsg_rule.cpp
@@ -562,24 +562,18 @@ void ex_data_location_new(const char *table_name, int table_id, const char* key,
tsg_str_unescape(location->country_full);
tsg_str_unescape(location->province_full);
tsg_str_unescape(location->city_full);
-
- if(g_tsg_maat_rt_para.location_field_num==19)
- {
- location->subdivision_addr=column_string_get_value(table_line, 17); // subdivision_addr
- tsg_str_unescape(location->subdivision_addr);
- location->full_location_len=snprintf(full_address,
+ location->subdivision_addr=column_string_get_value(table_line, 17); // subdivision_addr
+ tsg_str_unescape(location->subdivision_addr);
+
+ location->full_location_len=snprintf(full_address,
sizeof(full_address),
"%s.%s.%s.%s.",
location->country_full,
location->province_full,
location->city_full,
location->subdivision_addr==NULL ? "" : location->subdivision_addr);
- }
- else
- {
- location->full_location_len=snprintf(full_address, sizeof(full_address), "%s.%s.", location->country_full, location->city_full);
- }
+
if(location->full_location_len>0)
{
@@ -2078,7 +2072,6 @@ int tsg_maat_rule_init(const char* conffile)
MESA_load_profile_int_def(conffile, "MAAT","SESSION_RECORD_SWITCH", &g_tsg_maat_rt_para.session_record_switch, 0);
- MESA_load_profile_int_def(conffile, "MAAT","LOCATION_TABLE_TYPE", &g_tsg_maat_rt_para.location_field_num, 18);
MESA_load_profile_string_def(conffile, "MAAT", "PROFILE", maat_conffile, sizeof(maat_conffile), "./tsgconf/maat.conf");
g_tsg_maat_feather=init_maat_feather(maat_conffile, (char *)"STATIC", (char *)"STATIC");
if(g_tsg_maat_feather==NULL)
@@ -3099,7 +3092,7 @@ void *matched_rule_cites_dns_profile_record(struct maat *feather, long long prof
void plugin_ex_data_dns_profile_record_free(struct dns_profile_records *records)
{
- ex_data_app_id_dict_free(g_tsg_maat_rt_para.plugin_tb[MAAT_PLUGIN_DNS_PROFILE_RECORD].id, (void **)&records, 0, NULL);
+ ex_data_dns_profile_records_free(g_tsg_maat_rt_para.plugin_tb[MAAT_PLUGIN_DNS_PROFILE_RECORD].id, (void **)&records, 0, NULL);
}
size_t tsg_matched_rules_select(struct maat *feather, TSG_SERVICE service, long long *matched_rules, size_t n_matched_rules, struct maat_rule *rules, size_t n_rules)
@@ -3207,11 +3200,6 @@ int tsg_session_record_switch_get(void)
return g_tsg_maat_rt_para.session_record_switch;
}
-int tsg_location_type_get(void)
-{
- return g_tsg_maat_rt_para.location_field_num;
-}
-
long long tsg_default_compile_id_get(void)
{
return g_tsg_maat_rt_para.default_compile_id;