Skip to content

Commit

Permalink
* FIX [proto] Fix some errors and fall-through warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: wanghaemq <[email protected]>
  • Loading branch information
wanghaEMQ authored and JaylinYu committed Nov 16, 2023
1 parent b6acb5b commit dae258f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/mqtt/protocol/mqtt/mqtt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ mqtt_ctx_send(void *arg, nni_aio *aio)
if (qos == 0) {
break;
}
// fall through
case NNG_MQTT_SUBSCRIBE:
case NNG_MQTT_UNSUBSCRIBE:
packet_id = mqtt_sock_get_next_packet_id(s);
Expand Down
1 change: 0 additions & 1 deletion src/mqtt/protocol/mqtt/mqtt_quic_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,6 @@ mqtt_quic_ctx_send(void *arg, nni_aio *aio)
} else {
nni_id_set(s->topic_map, hash, (void *)(num_ptr + 1));
}
>>>>>>> e7f708c6 (* FIX [quic/proto] Add error handler when alloc a quic stream failed.)
} else {
if ((rv = mqtt_pipe_send_msg(aio, msg, pub_pipe, 0)) >= 0) {
nni_mtx_unlock(&s->mtx);
Expand Down
1 change: 1 addition & 0 deletions src/mqtt/protocol/mqtt/mqttv5_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,7 @@ mqtt_ctx_send(void *arg, nni_aio *aio)
if (qos == 0) {
break;
}
// fall through
case NNG_MQTT_SUBSCRIBE:
case NNG_MQTT_UNSUBSCRIBE:
packet_id = mqtt_sock_get_next_packet_id(s);
Expand Down
3 changes: 3 additions & 0 deletions src/mqtt/protocol/mqtt/mqttv5_quic_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ mqtt_send_msg(nni_aio *aio, nni_msg *msg, mqtt_sock_t *s)
if (qos == 0) {
break; // QoS 0 need no packet id
}
// fall through
case NNG_MQTT_SUBSCRIBE:
case NNG_MQTT_UNSUBSCRIBE:
packet_id = nni_mqtt_msg_get_packet_id(msg);
Expand Down Expand Up @@ -329,6 +330,7 @@ mqtt_pipe_send_msg(nni_aio *aio, nni_msg *msg, mqtt_pipe_t *p, uint16_t packet_i
if (qos == 0) {
break; // QoS 0 need no packet id
}
// fall through
case NNG_MQTT_SUBSCRIBE:
case NNG_MQTT_UNSUBSCRIBE:
packet_id = nni_mqtt_msg_get_packet_id(msg);
Expand Down Expand Up @@ -1694,6 +1696,7 @@ mqtt_quic_ctx_send(void *arg, nni_aio *aio)
if (nni_mqtt_msg_get_publish_qos(msg) == 0) {
break;
}
// fall through
case NNG_MQTT_SUBSCRIBE:
case NNG_MQTT_UNSUBSCRIBE:
packet_id = mqtt_pipe_get_next_packet_id(s);
Expand Down

0 comments on commit dae258f

Please sign in to comment.