From 132d807af17882081510ce8af05bdd9706eac52e Mon Sep 17 00:00:00 2001 From: liuxueli Date: Tue, 26 Nov 2019 16:58:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B0=83=E8=AF=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_entry.cpp | 8 ++++---- src/tsg_rule.cpp | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index e2fa348..c755b04 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -14,7 +14,7 @@ -char TSG_MASTER_VERSION_20191125=0; +char TSG_MASTER_VERSION_20191126=0; const char *tsg_conffile="tsgconf/main.conf"; g_tsg_para_t g_tsg_para; @@ -100,7 +100,7 @@ static Maat_rule_t *tsg_policy_decision_criteria(Maat_rule_t *result, int result if(result[i].action==p_result->action) { - if(result[i].config_idconfig_id) + if(result[i].config_id>p_result->config_id) { p_result=&result[i]; } @@ -157,7 +157,7 @@ extern "C" char TSG_MASTER_TCP_ENTRY(struct streaminfo *a_tcp, void **pme, int t FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_HIT_SHARE], 0, FS_OP_ADD, 1); MESA_handle_runtime_log(g_tsg_para.logger, RLOG_LV_DEBUG, - "SCAN_IP_AND_DOAMIN", + "SCAN_IP_AND_FQDN", "Hit %s: %s addr: %s", (identify_info.proto==PROTO_HTTP) ? "host" : "sni", identify_info.domain, @@ -169,7 +169,7 @@ extern "C" char TSG_MASTER_TCP_ENTRY(struct streaminfo *a_tcp, void **pme, int t { MESA_handle_runtime_log(g_tsg_para.logger, RLOG_LV_DEBUG, - "SCAN_IP_AND_DOAMIN", + "SCAN_IP_AND_FQDN", "Not hit %s: %s addr: %s", (ret==-1) ? "NULL" : ((identify_info.proto==PROTO_HTTP) ? "host" : "sni"), (ret==-1) ? "NULL" : identify_info.domain, diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index e812eb9..dcdd430 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -215,16 +215,21 @@ int tsg_pull_policy_result(struct streaminfo *a_stream, PULL_RESULT_TYPE pull_re else { MESA_handle_runtime_log(g_tsg_para.logger, RLOG_LV_DEBUG, "PULL_RESULT", - "pull policy failed, result_type: %s, addr: %s", + "pull policy failed, hit: %s %s: %s policy_id: %d service: %d action: %d addr: %s", (label->result_type==PULL_KNI_RESULT) ? "KNI" : "FW", + label->proto==PROTO_HTTP ? "host" : "sni", + label->domain, + label->result->config_id, + label->result->service_id, + label->result->action, printaddr(&a_stream->addr, a_stream->threadnum)); } } else { - MESA_handle_runtime_log(g_tsg_para.logger, RLOG_LV_FATAL, "PULL_RESULT", - "pull policy failed, result_type=%d, addr: %s", - (label==NULL) ? -1 : label->result_type, + MESA_handle_runtime_log(g_tsg_para.logger, RLOG_LV_DEBUG, "PULL_RESULT", + "pull policy failed, Not hit, label is %s addr: %s", + (label==NULL) ? "NULL" : label->domain, printaddr(&a_stream->addr, a_stream->threadnum)); }