Skip to content

Commit

Permalink
* ADD [quic] Support mqttv5 over quic client
Browse files Browse the repository at this point in the history
Signed-off-by: Moi Ran <maoyi.ran@emqx.io>
  • Loading branch information
RanMaoyi committed Sep 22, 2023
1 parent 9c554fd commit dfaa813
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions nanomq/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,7 @@ hybrid_quic_client(bridge_param *bridge_arg)

// keepalive here is for QUIC only
if (node->proto_ver == MQTT_PROTOCOL_VERSION_v5) {
log_error("MQTT V5 OVER QUIC is not supported yet.");
if ((rv = nng_mqtt_quic_client_open(new)) != 0) {
if ((rv = nng_mqttv5_quic_client_open(new)) != 0) {
nng_fatal("nng_mqttv5_quic_client_open", rv);
return rv;
}
Expand Down Expand Up @@ -846,8 +845,7 @@ bridge_quic_client(nng_socket *sock, conf *config, conf_bridge_node *node, bridg
log_debug("Quic bridge service start.\n");

if (node->proto_ver == MQTT_PROTOCOL_VERSION_v5) {
log_error("MQTT V5 OVER QUIC is not supported yet.");
if ((rv = nng_mqtt_quic_client_open(sock)) != 0) {
if ((rv = nng_mqttv5_quic_client_open(sock)) != 0) {
nng_fatal("nng_mqttv5_quic_client_open", rv);
return rv;
}
Expand Down
8 changes: 3 additions & 5 deletions nanomq_cli/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,11 +1462,9 @@ create_client(nng_socket *sock, struct work **works, size_t id, size_t nwork,

if (isquic) {
#if defined(SUPP_QUIC)
if (param->opts->version == MQTT_PROTOCOL_VERSION_v5) {
console("MQTT V5 OVER QUIC is not supported yet");
return;
}
rv = nng_mqtt_quic_client_open(sock);
rv = param->opts->version == MQTT_PROTOCOL_VERSION_v5
? nng_mqttv5_quic_client_open(sock)
: nng_mqtt_quic_client_open(sock);
if (rv != 0) {
nng_fatal("nng_socket", rv);
}
Expand Down

0 comments on commit dfaa813

Please sign in to comment.