🐞 fix(plugin_manager on session input): fix tcp segment leak when overlimit

This commit is contained in:
yangwei
2024-09-03 18:33:54 +08:00
parent f1628b9b60
commit f42aa76d5c
2 changed files with 5 additions and 2 deletions

View File

@@ -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); 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) 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; break;
case SESSION_TYPE_UDP: case SESSION_TYPE_UDP:

View File

@@ -177,7 +177,7 @@ struct registered_session_plugin_schema
* PLUGIN MANAGER INIT & EXIT * * PLUGIN MANAGER INIT & EXIT *
*******************************/ *******************************/
#define MAX_MSG_PER_DISPATCH 128 #define MAX_MSG_PER_DISPATCH 256
#include <dlfcn.h> #include <dlfcn.h>