summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2020-10-12 11:04:35 +0800
committerluwenpeng <[email protected]>2020-10-14 11:40:06 +0800
commit40aab0a2984a6b74a9c2aed9c0c59e2c33c54e2e (patch)
tree7610fb12d68d26f45be4673bf1f748c944520036 /plugin
parente16931d7c5ec1faabc90d852c2c9353111de1578 (diff)
fqdn服务划分接口适配修改
Diffstat (limited to 'plugin')
-rw-r--r--plugin/business/doh/src/doh.cpp11
-rw-r--r--plugin/business/pangu-http/src/pangu_http.cpp11
-rw-r--r--plugin/protocol/http2/src/http2_stream.cpp4
3 files changed, 18 insertions, 8 deletions
diff --git a/plugin/business/doh/src/doh.cpp b/plugin/business/doh/src/doh.cpp
index dfc2eb3..f53f5a7 100644
--- a/plugin/business/doh/src/doh.cpp
+++ b/plugin/business/doh/src/doh.cpp
@@ -243,6 +243,12 @@ 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 host: %s scan ret: %d addr: %s",
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)
+ {
+ hit_cnt += scan_ret;
+ }
}
// scan addr
@@ -289,6 +295,11 @@ 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 058fa8e..244012d 100644
--- a/plugin/business/pangu-http/src/pangu_http.cpp
+++ b/plugin/business/pangu-http/src/pangu_http.cpp
@@ -1934,7 +1934,7 @@ static void http_manipulate(const struct tfe_stream * stream, const struct tfe_h
}
enum pangu_action http_scan(const struct tfe_http_session * session, enum tfe_http_event events,
- const unsigned char * body_frag, size_t frag_size, struct pangu_http_ctx * ctx)
+ const unsigned char * body_frag, size_t frag_size, struct pangu_http_ctx * ctx, const struct tfe_stream * stream)
{
void * iterator = NULL;
const char * field_val = NULL;
@@ -1957,6 +1957,11 @@ 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)
+ {
+ hit_cnt += scan_ret;
+ }
}
const char * str_url = session->req->req_spec.url;
@@ -2046,8 +2051,6 @@ enum pangu_action http_scan(const struct tfe_http_session * session, enum tfe_ht
session->req->req_spec.url, hit_cnt, buff, ctx->enforce_rules[0].config_id);
}
}
-
-
__out:
return ctx->action;
}
@@ -2059,7 +2062,7 @@ void enforce_control_policy(const struct tfe_stream * stream, const struct tfe_h
if(ctx->action==PG_ACTION_NONE||ctx->action==PG_ACTION_MONIT)
{
//ctx->action changed in http_scan.
- http_scan(session, events, body_frag, frag_size, ctx);
+ http_scan(session, events, body_frag, frag_size, ctx, stream);
}
switch (ctx->action)
{
diff --git a/plugin/protocol/http2/src/http2_stream.cpp b/plugin/protocol/http2/src/http2_stream.cpp
index a493a13..58c1f6b 100644
--- a/plugin/protocol/http2/src/http2_stream.cpp
+++ b/plugin/protocol/http2/src/http2_stream.cpp
@@ -448,9 +448,6 @@ void h2_half_ops_free(struct tfe_http_half * half)
delete_stream_half_data(&h2_private, 1, CONN_DIR_DOWNSTREAM);
- free(h2_private);
- h2_private = NULL;
-
return;
}
@@ -952,7 +949,6 @@ nghttp2_submit_frame_settings(struct tfe_h2_stream *connection,const nghttp2_fra
nghttp2_settings settings = frame->settings;
nghttp2_session *ngh2_session = tfe_h2_stream_get_nghttp2_session(connection, dir);
- nghttp2_session *ngh2_peer_session = tfe_h2_stream_get_nghttp2_peer_session(connection, dir);
rv = nghttp2_submit_settings(ngh2_session, settings.hd.flags,
nghttp2_iv_packet(settings, iv), settings.niv);