Skip to content

Commit

Permalink
* MDF [mqtt_quic] parsing qos_first/multistream bool to transport & p…
Browse files Browse the repository at this point in the history
…rotocol via conf_quic
  • Loading branch information
JaylinYu committed Mar 22, 2023
1 parent 4db19ef commit c0eb36f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/nng/mqtt/mqtt_quic.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct conf_tls {
struct conf_quic {
conf_tls tls;
bool qos_first; // send QoS msg in high priority
bool multi_stream;
uint64_t qkeepalive; //keepalive timeout interval of QUIC transport
uint64_t qconnect_timeout; // HandshakeIdleTimeoutMs of QUIC
uint32_t qdiscon_timeout; // DisconnectTimeoutMs
Expand Down
8 changes: 8 additions & 0 deletions src/mqtt/protocol/mqtt/mqtt_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ static conf_quic config_default = {
.verify_peer = true,
.set_fail = true,
},
.multi_stream = false,
.qos_first = false,
.qkeepalive = 30,
.qconnect_timeout = 60,
.qdiscon_timeout = 30,
Expand Down Expand Up @@ -1827,11 +1829,17 @@ nng_mqtt_quic_client_open_conf(nng_socket *sock, const char *url, conf_quic *con
{
nni_sock *nsock = NULL;
int rv = 0;
if (conf == NULL) {
return -1;
}
// Quic settings
if ((rv = nni_proto_open(sock, &mqtt_msquic_proto)) == 0) {
nni_sock_find(&nsock, sock->id);
if (nsock) {
mqtt_sock_t *mqtt_sock = nni_sock_proto_data(nsock);
quic_open();
mqtt_sock->multi_stream = conf->multi_stream;
mqtt_sock->qos_first = conf->qos_first;
quic_proto_open(&mqtt_msquic_proto);
quic_proto_set_sdk_config((void *)conf);
quic_connect_ipv4(url, nsock, NULL);
Expand Down

0 comments on commit c0eb36f

Please sign in to comment.