Skip to content

Commit

Permalink
Fix QoS 0 messages not being delivered if max_queued_messages was set…
Browse files Browse the repository at this point in the history
… to 0.

Closes #1956. Thanks to nduhme.
  • Loading branch information
ralight committed Dec 17, 2020
1 parent d05a49a commit 00c6820
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Expand Up @@ -5,6 +5,8 @@ Broker:
being continued. Closes #1946.
- Fix bridges possibly not completing connections when WITH_ADNS is in use.
Closes #1960.
- Fix QoS 0 messages not being delivered if max_queued_messages was set to 0.
Closes #1956.

Clients:
- Fix mosquitto_sub being unable to terminate with Ctrl-C if a successful
Expand Down
3 changes: 3 additions & 0 deletions src/database.c
Expand Up @@ -50,6 +50,9 @@ bool db__ready_for_flight(struct mosquitto_msg_data *msgs, int qos)
* There is no queueing option, unless the client is offline and
* queue_qos0_messages is enabled.
*/
if(db.config->max_queued_messages == 0 && db.config->max_inflight_bytes == 0){
return true;
}
valid_bytes = msgs->msg_bytes - db.config->max_inflight_bytes < db.config->max_queued_bytes;
valid_count = msgs->msg_count - msgs->inflight_maximum < db.config->max_queued_messages;

Expand Down

0 comments on commit 00c6820

Please sign in to comment.