diff options
| author | yangwei <[email protected]> | 2024-09-03 18:33:54 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-09-03 18:33:54 +0800 |
| commit | f42aa76d5cc0d1e9733cbc3b1f8a118db5806c9c (patch) | |
| tree | b4bd087678e18d50863c270adf857bcfc7d2b6da | |
| parent | f1628b9b60aafc7337cf5c738707f654a2693eb4 (diff) | |
🐞 fix(plugin_manager on session input): fix tcp segment leak when overlimit
| -rw-r--r-- | infra/plugin_manager/plugin_manager.c | 5 | ||||
| -rw-r--r-- | 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 <dlfcn.h> |
