Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* ADD [quic] Support mqttv5 over quic client #1453

Merged
merged 3 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions nanomq/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,10 @@ hybrid_quic_client(bridge_param *bridge_arg)

// keepalive here is for QUIC only
if (node->proto_ver == MQTT_PROTOCOL_VERSION_v5) {
log_info("MQTT V5 OVER QUIC is not supported yet.");
/*
if ((rv = nng_mqtt_quic_client_open(new)) != 0) {
nng_fatal("nng_mqtt_quic_client_open", rv);
if ((rv = nng_mqttv5_quic_client_open(new)) != 0) {
nng_fatal("nng_mqttv5_quic_client_open", rv);
return rv;
}
*/
} else {
if ((rv = nng_mqtt_quic_client_open(new)) != 0) {
nng_fatal("nng_mqtt_quic_client_open", rv);
Expand Down Expand Up @@ -943,7 +940,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) {
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