Skip to content

Commit

Permalink
* FIX [exchange] Check pair0_sock before send msg.
Browse files Browse the repository at this point in the history
Signed-off-by: wangha <[email protected]>
  • Loading branch information
wanghaEMQ committed Jan 24, 2025
1 parent d102415 commit 9b210fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mqtt/protocol/exchange/exchange_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,10 @@ static void query_send_async(exchange_sock_t *s, struct cmd_data *cmd_data)
nng_msg *newmsg = NULL;
nng_msg_alloc(&newmsg, 0);
nni_msg_append(newmsg, parquet_decoded_data->data, parquet_decoded_data->len);
nng_sendmsg(*(s->pair0_sock), newmsg, 0);
if (s->pair0_sock)
nng_sendmsg(*(s->pair0_sock), newmsg, 0);
else
log_error("pair0_sock is null!!!!!!!!!");
/* NOTE: sleep 1000ms */
nng_msleep(1000);
stream_decoded_data_free(parquet_decoded_data);
Expand Down Expand Up @@ -630,6 +633,7 @@ exchange_sock_init(void *arg, nni_sock *sock)
nni_mtx_init(&s->mtx);
nni_id_map_init(&s->rbmsgmap, 0, 0, true);
s->isBusy = false;
s->pair0_sock = NULL;

nni_lmq_init(&s->lmq, 256);

Expand Down

0 comments on commit 9b210fb

Please sign in to comment.