Skip to content

Commit

Permalink
Fix bridge not respecting receive-maximum when reconnecting with MQTT…
Browse files Browse the repository at this point in the history
… v5.
  • Loading branch information
ralight committed Nov 9, 2021
1 parent 6e6866f commit 94d6130
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.0.14 - 2021-xx-xx
===================

Broker:
- Fix bridge not respecting receive-maximum when reconnecting with MQTT v5.

2.0.13 - 2021-10-27
===================

Expand Down
10 changes: 7 additions & 3 deletions src/handle_connack.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ int handle__connack(struct mosquitto *context)
uint32_t maximum_packet_size;
uint8_t retain_available;
uint16_t server_keepalive;
uint16_t inflight_maximum;
uint8_t max_qos = 255;

if(context == NULL){
Expand Down Expand Up @@ -83,9 +84,12 @@ int handle__connack(struct mosquitto *context)
}

/* receive-maximum */
mosquitto_property_read_int16(properties, MQTT_PROP_RECEIVE_MAXIMUM,
&context->msgs_out.inflight_maximum, false);
context->msgs_out.inflight_quota = context->msgs_out.inflight_maximum;
inflight_maximum = context->msgs_out.inflight_maximum;
mosquitto_property_read_int16(properties, MQTT_PROP_RECEIVE_MAXIMUM, &inflight_maximum, false);
if(context->msgs_out.inflight_maximum != inflight_maximum){
context->msgs_out.inflight_maximum = inflight_maximum;
db__message_reconnect_reset(context);
}

/* retain-available */
if(mosquitto_property_read_byte(properties, MQTT_PROP_RETAIN_AVAILABLE,
Expand Down

0 comments on commit 94d6130

Please sign in to comment.