diff options
| author | luwenpeng <[email protected]> | 2024-08-13 15:26:32 +0800 |
|---|---|---|
| committer | luwenpeng <[email protected]> | 2024-08-13 15:33:09 +0800 |
| commit | bdb520452a2e9e43f578e94c6d4a4149676fc4b0 (patch) | |
| tree | ae5bb3e024e145e59ccea54c11655f0ef5f541f9 | |
| parent | d0abc8817b4488301d51873dec7f947835fdc254 (diff) | |
fix: After the plugin manager triggers multiple TCP stream messages, if HTTP decode triggers a message on each TCP stream, it will cause logic confusion
| -rw-r--r-- | src/plugin/plugin_manager.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugin/plugin_manager.cpp b/src/plugin/plugin_manager.cpp index 85728b0..c14aab0 100644 --- a/src/plugin/plugin_manager.cpp +++ b/src/plugin/plugin_manager.cpp @@ -1037,7 +1037,7 @@ void plugin_manager_on_session_ingress(struct session *sess, struct packet *pkt) { case SESSION_TYPE_TCP: session_mq_publish_message_with_priority(sess, plug_mgr_rt->plug_mgr->tcp_topic_id ,(void *)pkt, STELLAR_MQ_PRIORITY_HIGH); - while ((seg = session_get_tcp_segment(sess)) != NULL) + if ((seg = session_get_tcp_segment(sess)) != NULL) { session_mq_publish_message_with_priority(sess, plug_mgr_rt->plug_mgr->tcp_stream_topic_id, (void *)seg, STELLAR_MQ_PRIORITY_HIGH); } @@ -1053,11 +1053,15 @@ void plugin_manager_on_session_ingress(struct session *sess, struct packet *pkt) //TODO: check TCP topic active subscirber num, if 0, return disable assembler state, to reduce tcp reassemble overhead int tid=stellar_get_current_thread_index(); stellar_mq_dispatch(plug_mgr_rt->plug_mgr->per_thread_data[tid].priority_mq, &plug_mgr_rt->plug_mgr->per_thread_data[tid].dealth_letter_queue, sess, pkt); - plugin_manager_scratch_session_set(NULL); - + while ((seg = session_get_tcp_segment(sess)) != NULL) + { + session_mq_publish_message_with_priority(sess, plug_mgr_rt->plug_mgr->tcp_stream_topic_id, (void *)seg, STELLAR_MQ_PRIORITY_HIGH); + stellar_mq_dispatch(plug_mgr_rt->plug_mgr->per_thread_data[tid].priority_mq, &plug_mgr_rt->plug_mgr->per_thread_data[tid].dealth_letter_queue, sess, pkt); + } + plugin_manager_scratch_session_set(NULL); - return; + return; } void plugin_manager_on_session_egress(struct session *sess, struct packet *pkt) |
