diff options
| author | 彭宣正 <[email protected]> | 2021-11-02 17:39:42 +0800 |
|---|---|---|
| committer | 彭宣正 <[email protected]> | 2021-11-02 17:40:18 +0800 |
| commit | 5d23e095e8a9961a70c073cf17ff5908a5fe73d5 (patch) | |
| tree | b0c174904f1573ce9699bfb5bd2f11cc01de21bc | |
| parent | 0b0292961eece87784fe5fc618fc55e9cb6f06ac (diff) | |
🐞 fix(TSG-8103): 修复lssh monitor日志发送失败的错误v5.4.11
| -rw-r--r-- | src/tsg_entry.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index 23e2645..cd3a2d0 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -1641,26 +1641,29 @@ static unsigned char tsg_master_data_entry(const struct streaminfo *a_stream, vo int ssh_project_id = project_customer_register("SKETCH_PROTO_CTX_LABEL", PROJECT_VAL_TYPE_STRUCT); if (ssh_project_id >= 0) { - session_record_ctx * ssh_session_record_ctx = (session_record_ctx *)project_req_get_struct(a_stream, ssh_project_id); - if (ssh_session_record_ctx != NULL && ssh_session_record_ctx->proto_type == PROTO_SSH) - { - tsg_log_t log_msg; - log_msg.a_stream = (streaminfo *)a_stream; - log_msg.result = p_result; - log_msg.result_num = 1; - - struct TLD_handle_t *_handle = TLD_duplicate(ssh_session_record_ctx->log); - if (_handle != NULL) - { - tsg_send_log(g_tsg_log_instance, _handle, &log_msg, thread_seq); - } - } + session_record_ctx *ssh_session_record_ctx = (session_record_ctx *)project_req_get_struct(a_stream, ssh_project_id); + if (ssh_session_record_ctx != NULL && ssh_session_record_ctx->proto_type == PROTO_SSH) + { + tsg_log_t log_msg; + log_msg.a_stream = (streaminfo *)a_stream; + log_msg.result = context->result; + log_msg.result_num = context->hit_cnt; + + struct TLD_handle_t *_handle = TLD_duplicate(ssh_session_record_ctx->log); + if (_handle != NULL) + { + tsg_send_log(g_tsg_log_instance, _handle, &log_msg, thread_seq); + } + } } } - context->is_log=1; - master_send_log(a_stream, context->result, context->hit_cnt, context, thread_seq); + if (context->proto != PROTO_SSH) + { + context->is_log = 1; + master_send_log(a_stream, context->result, context->hit_cnt, context, thread_seq); + } } - *pme=NULL; + *pme = NULL; } return state; |
