summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2020-10-12 15:43:27 +0800
committerluwenpeng <[email protected]>2020-10-14 11:45:49 +0800
commit90ac86a10c1c82c231d8dd1f44f544e9ee9d498a (patch)
tree1e50c00b94d911f1715383e8373a3ecaf6652022 /plugin
parent40aab0a2984a6b74a9c2aed9c0c59e2c33c54e2e (diff)
TSG-3417 TFE 适配 FQDNv4.3.11-202011
* 修改 cmsg 接口 * DOH 不支持扫描 fqdn cat id
Diffstat (limited to 'plugin')
-rw-r--r--plugin/business/doh/src/doh.cpp9
-rw-r--r--plugin/business/pangu-http/src/pangu_http.cpp9
2 files changed, 7 insertions, 11 deletions
diff --git a/plugin/business/doh/src/doh.cpp b/plugin/business/doh/src/doh.cpp
index f53f5a7..aa0af29 100644
--- a/plugin/business/doh/src/doh.cpp
+++ b/plugin/business/doh/src/doh.cpp
@@ -244,8 +244,8 @@ static void doh_maat_scan(const struct tfe_stream *stream, const struct tfe_http
g_doh_conf->tables[TYPE_HOST].name, host, scan_ret, ctx->addr_string);
}
- scan_ret = tfe_scan_fqdn_cat(stream, result, &(ctx->scan_mid), hit_cnt, ctx->thread_id, g_doh_conf->local_logger, g_doh_conf->tables[TYPE_HOST].id);
- if( scan_ret > 0)
+ scan_ret = tfe_scan_fqdn_cat(stream, result, &(ctx->scan_mid), hit_cnt, ctx->thread_id, g_doh_conf->local_logger, ctx->addr_string, g_doh_conf->tables[TYPE_HOST].id);
+ if( scan_ret > 0)
{
hit_cnt += scan_ret;
}
@@ -295,11 +295,6 @@ static void doh_maat_scan(const struct tfe_stream *stream, const struct tfe_http
TFE_LOG_INFO(g_doh_conf->local_logger, "Scan %s, NO hit domain: %s scan ret: %d addr: %s",
g_doh_conf->tables[TYPE_QNAME].name, qname, scan_ret, ctx->addr_string);
}
- scan_ret = tfe_scan_fqdn_cat(stream, result, &(ctx->scan_mid), hit_cnt, ctx->thread_id, g_doh_conf->local_logger, g_doh_conf->tables[TYPE_QNAME].id);
- if( scan_ret > 0)
- {
- hit_cnt += scan_ret;
- }
if (hit_cnt)
{
diff --git a/plugin/business/pangu-http/src/pangu_http.cpp b/plugin/business/pangu-http/src/pangu_http.cpp
index 244012d..841dd9f 100644
--- a/plugin/business/pangu-http/src/pangu_http.cpp
+++ b/plugin/business/pangu-http/src/pangu_http.cpp
@@ -1957,12 +1957,14 @@ enum pangu_action http_scan(const struct tfe_http_session * session, enum tfe_ht
{
hit_cnt += scan_ret;
}
- scan_ret = tfe_scan_fqdn_cat(stream, result, &(ctx->scan_mid), hit_cnt, ctx->thread_id, g_pangu_rt->local_logger, g_pangu_rt->scan_table_id[PXY_CTRL_HTTP_FQDN]);
- if (scan_ret > 0)
+ char *addr_string = tfe_stream_addr_to_str(stream->addr);
+ scan_ret = tfe_scan_fqdn_cat(stream, result, &(ctx->scan_mid), hit_cnt, ctx->thread_id, g_pangu_rt->local_logger, addr_string, g_pangu_rt->scan_table_id[PXY_CTRL_HTTP_FQDN]);
+ if (scan_ret > 0)
{
hit_cnt += scan_ret;
}
- }
+ free(addr_string);
+ }
const char * str_url = session->req->req_spec.url;
int str_url_length = (int) (strlen(session->req->req_spec.url));
@@ -2385,7 +2387,6 @@ void pangu_on_http_begin(const struct tfe_stream * stream,
{
hit_cnt+=scan_ret;
}
-
int scan_val=106;
scan_ret=Maat_scan_intval(g_pangu_rt->maat, g_pangu_rt->scan_table_id[PXY_CTRL_APP_ID], scan_val, result+hit_cnt, MAX_SCAN_RESULT-hit_cnt, &(ctx->scan_mid), (int) thread_id);
if(scan_ret>0)