Fix MQTT v5 overlapping subscription behaviour.

Clients now receive message from all matching subscriptions rather than
the first one encountered, which ensures the maximum QoS requirement is
met.
pull/1304/head
Roger A. Light 6 years ago
parent de695af8c0
commit 142d07f45a

@ -25,6 +25,9 @@ Broker:
- Fix incorrect shared subscription topic '$shared'.
- Fix zero length client ids being rejected for MQTT v5 clients with clean
start set to true.
- Fix MQTT v5 overlapping subscription behaviour. Clients now receive message
from all matching subscriptions rather than the first one encountered, which
ensures the maximum QoS requirement is met.
Client library:
- Fix typo causing build error on Windows when building without TLS support.

@ -364,7 +364,8 @@ int db__message_insert(struct mosquitto_db *db, struct mosquitto *context, uint1
* multiple times for overlapping subscriptions, although this is only the
* case for SUBSCRIPTION with multiple subs in so is a minor concern.
*/
if(db->config->allow_duplicate_messages == false
if(context->protocol != mosq_p_mqtt5
&& db->config->allow_duplicate_messages == false
&& dir == mosq_md_out && retain == false && stored->dest_ids){
for(i=0; i<stored->dest_id_count; i++){

Loading…
Cancel
Save