TSG-1167 proxy-event-log增加注入文件大小

This commit is contained in:
fengweihao
2020-04-03 16:16:07 +08:00
parent c94eab176b
commit ab492252a9
4 changed files with 8 additions and 1 deletions

View File

@@ -1041,6 +1041,7 @@ struct pangu_http_ctx
struct policy_action_param *param;
struct evbuffer* log_req_body, *log_resp_body;
size_t inject_sz;
struct replace_ctx * rep_ctx;
struct insert_ctx * ins_ctx;
@@ -1696,6 +1697,7 @@ static void http_hijack(const struct tfe_http_session * session, enum tfe_http_e
ctx->action = PG_ACTION_NONE;
return;
}
ctx->inject_sz = hijack_size;
char cont_len_str[16];
@@ -1748,6 +1750,7 @@ static int format_insert_rule(int profile_id, struct insert_rule *rule)
rule->script = tfe_strdup(insert_profile->profile_msg);
rule->type = tfe_strdup(insert_profile->profile_type);
rule->position = tfe_strdup(insert_profile->profile_position);
rule->inject_sz = insert_profile->msg_len;
ma_profile_table_free(insert_profile);
insert_profile = NULL;
@@ -1787,6 +1790,7 @@ static void http_insert(const struct tfe_stream * stream, const struct tfe_http_
ctx->action = PG_ACTION_NONE;
return;
}
ctx->inject_sz = ins_ctx->rule->inject_sz;
}
else
{
@@ -2474,7 +2478,7 @@ void pangu_on_http_end(const struct tfe_stream * stream,
}
}
struct pangu_log log_msg = {.stream=stream, .http=session, .result=ctx->enforce_rules, .result_num=ctx->n_enforce,
.req_body= ctx->log_req_body, .resp_body=ctx->log_resp_body, .action=0};
.req_body=ctx->log_req_body, .resp_body=ctx->log_resp_body, .action=0, .inject_sz=ctx->inject_sz};
if(ctx->action == PG_ACTION_MANIPULATE)
{