fqdn服务划分接口适配修改

This commit is contained in:
fengweihao
2020-10-12 11:04:35 +08:00
committed by luwenpeng
parent e16931d7c5
commit 40aab0a298
8 changed files with 106 additions and 62 deletions

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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);