summaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
authorwangmenglan <[email protected]>2024-07-10 16:53:51 +0800
committerwangmenglan <[email protected]>2024-07-10 16:53:51 +0800
commit5eccfbb882852a9c4779ee4d7039b1ae7e6a9bbb (patch)
tree158c58a9ae0ce9ef16d8c4e486b106efb631e2b4 /common/src
parentb73ad5eff73e253a50eb21cff20ba9dfe1749ab4 (diff)
增加控制报文解析错误计数
Diffstat (limited to 'common/src')
-rw-r--r--common/src/tfe_packet_io.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/src/tfe_packet_io.cpp b/common/src/tfe_packet_io.cpp
index 7cb89c0..f3525dc 100644
--- a/common/src/tfe_packet_io.cpp
+++ b/common/src/tfe_packet_io.cpp
@@ -1396,6 +1396,7 @@ static int handle_control_packet(struct packet_io *handle, marsio_buff_t *rx_buf
{
TFE_LOG_ERROR(logger, "%s: unexpected control packet, unable to get metadata\n\tMETA={session_id: %lu, raw_len: %d, is_e2i_dir: %d, is_ctrl_pkt: %d, l7offset: %d, is_decrypted: %u, sids_num: %d}",
LOG_TAG_PKTIO, meta.session_id, meta.raw_len, meta.is_e2i_dir, meta.is_ctrl_pkt, meta.l7offset, meta.is_decrypted, meta.sids.num);
+ __atomic_fetch_add(&packet_io_fs->ctrl_pkt_error_num, 1, __ATOMIC_RELAXED);
return -1;
}
@@ -1404,12 +1405,14 @@ static int handle_control_packet(struct packet_io *handle, marsio_buff_t *rx_buf
if (ctrl_packet_parser_parse(&ctrl_parser, meta.raw_data + meta.l7offset, meta.raw_len - meta.l7offset, logger, thread->ref_acceptor_ctx->debug) == -1)
{
TFE_LOG_ERROR(logger, "%s: unexpected control packet, metadata's session %lu unable to parse data", LOG_TAG_PKTIO, meta.session_id);
+ __atomic_fetch_add(&packet_io_fs->ctrl_pkt_error_num, 1, __ATOMIC_RELAXED);
return -1;
}
if (ctrl_parser.session_id != meta.session_id)
{
TFE_LOG_ERROR(logger, "%s: unexpected control packet, metadata's session %lu != control packet's session %lu", LOG_TAG_PKTIO, meta.session_id, ctrl_parser.session_id);
+ __atomic_fetch_add(&packet_io_fs->ctrl_pkt_error_num, 1, __ATOMIC_RELAXED);
ctrl_packet_cmsg_destroy(&ctrl_parser);
return -1;
}