diff options
Diffstat (limited to 'plugin/business/tsg-http/src')
| -rw-r--r-- | plugin/business/tsg-http/src/tsg_http.cpp | 29 | ||||
| -rw-r--r-- | plugin/business/tsg-http/src/tsg_logger.cpp | 4 |
2 files changed, 5 insertions, 28 deletions
diff --git a/plugin/business/tsg-http/src/tsg_http.cpp b/plugin/business/tsg-http/src/tsg_http.cpp index 6b17216..d07d529 100644 --- a/plugin/business/tsg-http/src/tsg_http.cpp +++ b/plugin/business/tsg-http/src/tsg_http.cpp @@ -1149,14 +1149,6 @@ struct edit_element_ctx int actually_edited; }; -struct ip_data_ctx -{ - char *asn_client; - char *asn_server; - char *location_client; - char *location_server; -}; - struct proxy_http_ctx { int magic_num; @@ -1177,7 +1169,6 @@ struct proxy_http_ctx struct insert_ctx * ins_ctx; struct edit_element_ctx * edit_ctx; struct tsg_script_ctx *tsg_ctx; - struct ip_data_ctx ip_ctx; int (* resumed_cb)(const struct tfe_stream * stream, const struct tfe_http_session * session, enum tfe_http_event event, const unsigned char * data, @@ -1316,18 +1307,6 @@ void http_tsg_ctx_free(struct tsg_script_ctx *tsg_ctx, int thread_id) return; } -void http_ip_ctx_free(struct ip_data_ctx *ip_ctx) -{ - if(ip_ctx->asn_client) - FREE(&ip_ctx->asn_client); - if(ip_ctx->asn_server) - FREE(&ip_ctx->asn_server); - if(ip_ctx->location_client) - FREE(&ip_ctx->location_client); - if(ip_ctx->location_server) - FREE(&ip_ctx->location_server); -} - #define HTTP_CTX_MAGIC_NUM 20181021 static struct proxy_http_ctx * proxy_http_ctx_new(unsigned int thread_id) { @@ -1362,7 +1341,6 @@ static void proxy_http_ctx_free(struct proxy_http_ctx * ctx) ctx->tsg_ctx = NULL; } - http_ip_ctx_free(&ctx->ip_ctx); ctx->manipulate_replaced=0; FREE(&ctx->enforce_rules); policy_action_param_free(ctx->param); @@ -2939,7 +2917,7 @@ void proxy_on_http_begin(const struct tfe_stream *stream, const struct tfe_http_ hit_cnt+=scan_ret; } - scan_ret = tfe_scan_ip_asn(stream, result, ctx->scan_mid, hit_cnt, g_proxy_rt->local_logger, &(ctx->ip_ctx.asn_server), &(ctx->ip_ctx.asn_client)); + scan_ret = tfe_scan_ip_asn(stream, result, ctx->scan_mid, hit_cnt, g_proxy_rt->local_logger); if(scan_ret>0) { hit_cnt+=scan_ret; @@ -3021,9 +2999,8 @@ void proxy_on_http_end(const struct tfe_stream * stream, } } struct proxy_log log_msg = {.stream=stream, .http=session, .result=(struct log_rule_t *)ctx->enforce_rules, .result_num=ctx->n_enforce, - .req_body=ctx->log_req_body, .resp_body=ctx->log_resp_body, .action=0, .inject_sz=ctx->inject_sz, - .asn_client=ctx->ip_ctx.asn_client, .asn_server=ctx->ip_ctx.asn_server, .location_client=ctx->ip_ctx.location_client, - .location_server=ctx->ip_ctx.location_server, .c2s_byte_num=ctx->c2s_byte_num, .s2c_byte_num=ctx->s2c_byte_num}; + .req_body=ctx->log_req_body, .resp_body=ctx->log_resp_body, .action=0, .inject_sz=ctx->inject_sz, .c2s_byte_num=ctx->c2s_byte_num, + .s2c_byte_num=ctx->s2c_byte_num}; if(ctx->action == PX_ACTION_MANIPULATE) { log_msg.action = ctx->param->action; diff --git a/plugin/business/tsg-http/src/tsg_logger.cpp b/plugin/business/tsg-http/src/tsg_logger.cpp index f411a40..52a99e6 100644 --- a/plugin/business/tsg-http/src/tsg_logger.cpp +++ b/plugin/business/tsg-http/src/tsg_logger.cpp @@ -141,7 +141,7 @@ static int get_ip_client_geolocation(struct tfe_cmsg * cmsg, cJSON *per_hit_obj) { unsigned int i=0, j=0; char opt_val[128]={0}; uint16_t opt_out_size; - const char *client_geo_area_map[] = {"client_country","client_province","client_city","client_subdivision"}; + const char *client_geo_area_map[] = {"client_country","client_super_administrative_area","client_administrative_area","client_sub_administrative_area"}; for(i=TFE_CMSG_SRC_REGION_STR; i <= TFE_CMSG_DST_SUBDIVISION_STR; i+=2) { @@ -159,7 +159,7 @@ static int get_ip_server_geolocation(struct tfe_cmsg * cmsg, cJSON *per_hit_obj) { unsigned int i=0, j=0; char opt_val[128]={0}; uint16_t opt_out_size; - const char *server_geo_area_map[] = {"server_country","server_province","server_city","server_subdivision"}; + const char *server_geo_area_map[] = {"server_country","server_super_administrative_area","server_administrative_area","server_sub_administrative_area"}; for(i=TFE_CMSG_DST_REGION_STR; i <= TFE_CMSG_DST_SUBDIVISION_STR; i+=2) { |
