eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.93k stars 2.37k forks source link

Bridge is publishing to notification topic without registering/storing MID #2307

Open canique opened 3 years ago

canique commented 3 years ago

In bridge__on_connect() in bridge.c: send__real_publish() is called with a newly generated MID. The MID is not registered properly within the mosquitto framework. As a result, when receiving the PUBACK mosquitto does not know which message this MID belongs to. But with every PUBACK the send quota is incremented. So that's the next problem: When publishing to the notification topic, the quota was not decremented in the first place. But when getting the response it's incremented.

You end up with a higher quota than you should have.

Possible fix:

This bug is related to https://github.com/eclipse/mosquitto/issues/2301 / 1st bug

ralight commented 3 years ago

Thanks, well spotted!