From f42aa76d5cc0d1e9733cbc3b1f8a118db5806c9c Mon Sep 17 00:00:00 2001 From: yangwei Date: Tue, 3 Sep 2024 18:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(plugin=5Fmanager=20on=20sess?= =?UTF-8?q?ion=20input):=20fix=20tcp=20segment=20leak=20when=20overlimit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/plugin_manager/plugin_manager.c | 5 ++++- infra/plugin_manager/plugin_manager_interna.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/infra/plugin_manager/plugin_manager.c b/infra/plugin_manager/plugin_manager.c index 37f6fe9..634665a 100644 --- a/infra/plugin_manager/plugin_manager.c +++ b/infra/plugin_manager/plugin_manager.c @@ -1016,7 +1016,10 @@ void plugin_manager_on_session_input(struct session *sess, struct packet *pkt) session_mq_publish_message_with_priority(sess, plug_mgr_rt->plug_mgr->tcp_input_topic_id ,(void *)pkt, STELLAR_MQ_PRIORITY_HIGH); 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); + if(session_mq_publish_message_with_priority(sess, plug_mgr_rt->plug_mgr->tcp_stream_topic_id, (void *)seg, STELLAR_MQ_PRIORITY_HIGH)!=0) + { + session_free_tcp_segment(sess, seg); + } } break; case SESSION_TYPE_UDP: diff --git a/infra/plugin_manager/plugin_manager_interna.h b/infra/plugin_manager/plugin_manager_interna.h index eb075bf..c5e29d5 100644 --- a/infra/plugin_manager/plugin_manager_interna.h +++ b/infra/plugin_manager/plugin_manager_interna.h @@ -177,7 +177,7 @@ struct registered_session_plugin_schema * PLUGIN MANAGER INIT & EXIT * *******************************/ -#define MAX_MSG_PER_DISPATCH 128 +#define MAX_MSG_PER_DISPATCH 256 #include