-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mqtt311 decoder #311
Mqtt311 decoder #311
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #311 +/- ##
==========================================
+ Coverage 81.10% 81.69% +0.59%
==========================================
Files 18 19 +1
Lines 7842 7923 +81
==========================================
+ Hits 6360 6473 +113
+ Misses 1482 1450 -32
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (handler != NULL) { | ||
return handler(packet_cursor, decoder->config.handler_user_data); | ||
} else { | ||
return aws_raise_error(AWS_ERROR_MQTT_PROTOCOL_ERROR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial: just FYI, if you wanted to logging from within this file but didn't know what ID to use...
I usually pass a void *logging_id
in the decoder_options, so the decoder can log with the same ID as the the system that owns it
While we could have fixed the original bug without doing such a heavyweight refactor, testing complex, brittle logic embedded in the channel handler's vtable implementation is a lousy approach. Rather than graft more hacks and more complexity into the client impl, we add a new subsystem with a testable API.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.