Skip to content

Commit

Permalink
remove qos<0
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Jun 3, 2024
1 parent ed7bbd6 commit 31f29a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/v5/mqtt5_to_mqtt3_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ static int s_aws_mqtt_client_connection_5_set_will(
struct aws_mqtt_client_connection_5_impl *adapter = impl;

/* check qos */
if (qos < 0 || qos > AWS_MQTT_QOS_EXACTLY_ONCE) {
if (qos > AWS_MQTT_QOS_EXACTLY_ONCE) {
AWS_LOGF_ERROR(
AWS_LS_MQTT5_TO_MQTT3_ADAPTER, "id=%p: mqtt3-to-5-adapter, invalid qos for will", (void *)adapter);
return aws_raise_error(AWS_ERROR_MQTT_INVALID_QOS);
Expand Down Expand Up @@ -1926,7 +1926,7 @@ static uint16_t s_aws_mqtt_client_connection_5_publish(
AWS_LOGF_DEBUG(AWS_LS_MQTT5_TO_MQTT3_ADAPTER, "id=%p: mqtt3-to-5-adapter, invoking publish API", (void *)adapter);

/* check qos */
if (qos < 0 || qos > AWS_MQTT_QOS_EXACTLY_ONCE) {
if (qos > AWS_MQTT_QOS_EXACTLY_ONCE) {
AWS_LOGF_ERROR(
AWS_LS_MQTT5_TO_MQTT3_ADAPTER, "id=%p: mqtt3-to-5-adapter, invalid qos for publish", (void *)adapter);
aws_raise_error(AWS_ERROR_MQTT_INVALID_QOS);
Expand Down Expand Up @@ -2157,7 +2157,7 @@ static int s_validate_adapter_subscribe_options(
struct aws_mqtt_topic_subscription *subscription = subscriptions + i;

/* check qos */
if (subscription->qos < 0 || subscription->qos > AWS_MQTT_QOS_EXACTLY_ONCE) {
if (subscription->qos > AWS_MQTT_QOS_EXACTLY_ONCE) {
AWS_LOGF_ERROR(
AWS_LS_MQTT5_TO_MQTT3_ADAPTER, "id=%p: mqtt3-to-5-adapter, invalid qos for subscribe", (void *)adapter);
return aws_raise_error(AWS_ERROR_MQTT_INVALID_QOS);
Expand Down

0 comments on commit 31f29a9

Please sign in to comment.