summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-08-19 18:20:21 +0800
committeryangwei <[email protected]>2024-08-19 18:20:21 +0800
commitfb69895f77270a30a2cbb86274e6fd077aa13255 (patch)
treec5a364527049c98c336fe98a38520c9ce1786efb
parent6e92f11af00cfdd756112d1626726f8c1c084e06 (diff)
🐞 fix(stellar_mq_dispatch): check sess and pkt before dispatchv2.1.6
-rw-r--r--src/plugin_manager/plugin_manager.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugin_manager/plugin_manager.c b/src/plugin_manager/plugin_manager.c
index 5f83ef0..57a2ff0 100644
--- a/src/plugin_manager/plugin_manager.c
+++ b/src/plugin_manager/plugin_manager.c
@@ -586,8 +586,14 @@ static void stellar_mq_dispatch(struct stellar_message *priority_mq[], struct st
}
DL_FOREACH_SAFE(priority_mq[cur_priority], mq_elt, mq_tmp)
{
- if(mq_elt->header.type==ON_SESSION_TOPIC)stellar_mq_dispatch_one_session_message(sess, mq_elt);
- if(mq_elt->header.type==ON_PACKET_TOPIC)stellar_mq_dispatch_one_packet_message(pkt, mq_elt);
+ if(mq_elt->header.type==ON_SESSION_TOPIC && sess)
+ {
+ stellar_mq_dispatch_one_session_message(sess, mq_elt);
+ }
+ if(mq_elt->header.type==ON_PACKET_TOPIC && pkt)
+ {
+ stellar_mq_dispatch_one_packet_message(pkt, mq_elt);
+ }
DL_DELETE(priority_mq[mq_elt->header.priority], mq_elt);
DL_APPEND(*dealth_letter_queue, mq_elt); // move to dlq list