Skip to content

Commit

Permalink
* FIX [cli/client] Fix the error that subscriptions in quic client no…
Browse files Browse the repository at this point in the history
…t works.

Signed-off-by: wanghaemq <wangwei@emqx.io>
  • Loading branch information
wanghaEMQ authored and JaylinYu committed Sep 27, 2023
1 parent 23aefff commit fecc6f7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions nanomq_cli/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,27 @@ quic_connect_cb(void *rmsg, void *arg)

console("%s: %s connect\n", __FUNCTION__, param->opts->url);

if (reason == 0) {
if (param->opts->type == SUB && param->opts->topic_count > 0) {
nng_mqtt_topic_qos *topics_qos =
nng_mqtt_topic_qos_array_create(
param->opts->topic_count);
size_t i = 0;
for (struct topic *tp = param->opts->topic;
tp != NULL && i < param->opts->topic_count;
tp = tp->next, i++) {
nng_mqtt_topic_qos_array_set(
topics_qos, i, tp->val, param->opts->qos, 1, 0, 0);
}
nng_mqtt_subscribe(*param->sock, topics_qos,
param->opts->topic_count,
param->opts->sub_properties);
nng_mqtt_topic_qos_array_free(
topics_qos, param->opts->topic_count);
}
}


return 0;
}

Expand Down

0 comments on commit fecc6f7

Please sign in to comment.