add ACL support, fix wildcard routing and QoS >0 crash#47
Open
durrendal wants to merge 1 commit intopython36:masterfrom
Open
add ACL support, fix wildcard routing and QoS >0 crash#47durrendal wants to merge 1 commit intopython36:masterfrom
durrendal wants to merge 1 commit intopython36:masterfrom
Conversation
This change adds Mosquitto compatible ACL file support (user/topic rules, pattern rules with %u/%c substitution). Replaces broken topic routing with trie-based index. The broker previously only matched the literal "#" and exact topic string, so subscribers on filters like foo/# or foo/+/bar never received messages. The trie resolves matches in O(topic depth) instead of O(subscription count). Replaces assert statements in onPubAck, onPubRec, onPubRel, and onPubComp with graceful checks. The asserts crash the broker under normal QoS > 0 operation when work queue state doesn't match expectations due to timing or msgId reuse.
e3d2a35 to
757615e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds Mosquitto compatible ACL file support (user/topic rules, pattern rules with %u/%c substitution).
Replaces broken topic routing with trie-based index. The broker previously only matched the literal "#" and exact topic string, so subscribers on filters like foo/# or foo/+/bar never received messages. The trie resolves matches in O(topic depth) instead of O(subscription count).
Replaces assert statements in onPubAck, onPubRec, onPubRel, and onPubComp with graceful checks. The asserts crash the broker under normal QoS > 0 operation when work queue state doesn't match expectations due to timing or msgId reuse.
For color/context, I'm working on building a SaltStack like configuration management tool with nmqtt as the MQTT broker/client in that stack. Adding ACL handling and trie topic parsing will allow me to replace Mosquitto in that setup with a custom nmqtt based broker.
Tangentially, I've also ported nmqtt and its build deps to Alpine Linux as part of that same effort.