diff options
| author | wangmenglan <[email protected]> | 2023-08-28 15:40:12 +0800 |
|---|---|---|
| committer | wangmenglan <[email protected]> | 2023-08-28 18:31:20 +0800 |
| commit | 420e41cda8e0c8bf041992828d22da88ad30adf1 (patch) | |
| tree | f879432169e72d1e2b30843c540c640da3697b39 /common/src/tfe_packet_io.cpp | |
| parent | 9f2bf29f674c8e7b6985a5e3d1b34ce428d8c1a5 (diff) | |
🐞 fix(TSG-16240): 修复Intercept选择http协议时,日志中Intercept Status值为passthroughv4.8.35-20230830
Diffstat (limited to 'common/src/tfe_packet_io.cpp')
| -rw-r--r-- | common/src/tfe_packet_io.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/src/tfe_packet_io.cpp b/common/src/tfe_packet_io.cpp index 98dfdf8..ea5b691 100644 --- a/common/src/tfe_packet_io.cpp +++ b/common/src/tfe_packet_io.cpp @@ -1029,6 +1029,9 @@ static void send_event_log(struct session_ctx *s_ctx, int thread_seq, void *ctx) char *data = NULL; size_t size; mpack_writer_t writer; + if (s_ctx->protocol != STREAM_PROTO_SSL) + return; + mpack_writer_init_growable(&writer, &data, &size); // root map @@ -1224,6 +1227,7 @@ static int handle_session_opening(struct metadata *meta, struct ctrl_pkt_parser TFE_LOG_ERROR(logger, "%s: incorrect dataoffset in the control zone of session %lu, offset:%u, l7offset:%u, payload:%p, raw_data:%p", LOG_TAG_PKTIO, meta->session_id, offset, meta->l7offset, payload, meta->raw_data); } raw_packet_parser_get_most_inner_tuple4(&raw_parser, &inner_tuple4, logger); + tfe_cmsg_get_value(parser->cmsg, TFE_CMSG_TCP_RESTORE_PROTOCOL, (unsigned char *)&stream_protocol_in_char, sizeof(stream_protocol_in_char), &size); ret = intercept_policy_enforce(thread->ref_proxy->int_ply_enforcer, parser->cmsg); if (ret != 0) { @@ -1278,7 +1282,6 @@ static int handle_session_opening(struct metadata *meta, struct ctrl_pkt_parser goto passthrough; } - tfe_cmsg_get_value(parser->cmsg, TFE_CMSG_TCP_RESTORE_PROTOCOL, (unsigned char *)&stream_protocol_in_char, sizeof(stream_protocol_in_char), &size); tfe_cmsg_get_value(parser->cmsg, TFE_CMSG_TCP_DECRYPTED_TRAFFIC_STEERING, (unsigned char *)&enable_decrypted_traffic_steering, sizeof(enable_decrypted_traffic_steering), &size); if ((STREAM_PROTO_PLAIN == (enum tfe_stream_proto)stream_protocol_in_char && thread->ref_proxy->traffic_steering_options.enable_steering_http) || (STREAM_PROTO_SSL == (enum tfe_stream_proto)stream_protocol_in_char && thread->ref_proxy->traffic_steering_options.enable_steering_ssl) || @@ -1338,6 +1341,7 @@ passthrough: s_ctx->raw_meta_e2i = metadata_new(); s_ctx->ctrl_meta = metadata_new(); + s_ctx->protocol = stream_protocol_in_char; s_ctx->ref_thread_ctx = thread; s_ctx->session_id = meta->session_id; s_ctx->session_addr = addr_tuple4_to_str(&inner_tuple4); |
