From be35cf5db2000f4f085ec487401a72a0a775abe1 Mon Sep 17 00:00:00 2001 From: eeff Date: Wed, 26 Jan 2022 00:11:09 +0800 Subject: [PATCH] Fix neu_manager loop to use the correct pipe when sub/unsub node 1. When handling MSG_CMD_SUBSCRIBE_NODE, use the pipe of the destination node 2. When handling MSG_CMD_UNSUBSCRIBE_NODE, use the pipe of the destination node --- src/core/neu_manager.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/neu_manager.c b/src/core/neu_manager.c index ba9a2aa8..aa771508 100644 --- a/src/core/neu_manager.c +++ b/src/core/neu_manager.c @@ -1415,8 +1415,8 @@ static void manager_loop(void *arg) nng_mtx_unlock(manager->adapters_mtx); msg_size = msg_inplace_data_get_size(sizeof(subscribe_node_cmd_t)); rv = nng_msg_alloc(&out_msg, msg_size); - need_forward = sub_grp_config_with_pipe(cmd_ptr->grp_config, - nng_msg_get_pipe(msg)); + need_forward = sub_grp_config_with_pipe( + cmd_ptr->grp_config, sub_reg_entity->adapter_pipe); if (rv == 0 && need_forward == 1) { message_t * msg_ptr; subscribe_node_cmd_t *out_cmd_ptr; @@ -1463,8 +1463,8 @@ static void manager_loop(void *arg) msg_size = msg_inplace_data_get_size(sizeof(unsubscribe_node_cmd_t)); rv = nng_msg_alloc(&out_msg, msg_size); - need_forward = unsub_grp_config_with_pipe(cmd_ptr->grp_config, - nng_msg_get_pipe(msg)); + need_forward = unsub_grp_config_with_pipe( + cmd_ptr->grp_config, sub_reg_entity->adapter_pipe); if (rv == 0 && need_forward == 1) { message_t * msg_ptr; unsubscribe_node_cmd_t *out_cmd_ptr;