db__message_insert decrements inflight quota although message was queued #2306
Labels
Component: mosquitto-broker
Status: Completed
Nothing further to be done with this issue, it can be closed by the requestor or committer.
Type: Bug
Milestone
db__message_insert() in database.c calls util__decrement_send_quota with the wrong conditions.
Let's look at an example:
Conditions:
we have a valid socket, we have send msg quota left, we have no bytes quota left, QoS=1
db__ready_for_flight() returns false because no bytes quota left, hence the msg is queued.
Later we have the check (before decrementing the send msg quota)
This will evaluate to true, but the msg was not ready for flight so why reduce the inflight quota?
Correct would be:
The text was updated successfully, but these errors were encountered: