Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

repeated SUBACKs on same topic send new topic ids #5

Open
gazally opened this issue Jul 13, 2016 · 0 comments
Open

repeated SUBACKs on same topic send new topic ids #5

gazally opened this issue Jul 13, 2016 · 0 comments

Comments

@gazally
Copy link

gazally commented Jul 13, 2016

If a client on a noisy network misses a SUBACK packet, it will resend the SUBSCRIBE. Since MQTTSProtocol_handleSubscribes doesn't check if a topic is already registered before registering it, it will send the next SUBACK with a new topic id. But later PUBLISHes on that topic will use the first topic id, which the client doesn't know.

The fix is to use the same check in MQTTProtocol_handleSubscribes that MQTTProtocol_handleRegisters uses to see if a topic is already registered.

gazally added a commit to gazally/rsmb that referenced this issue Jul 13, 2016
If a MQTTS client missed a SUBACK and consequently resent the SUBSCRIBE,
rsmb would send the next SUBACK with a different topic id. But later
PUBLISHes on that topic would use the first topic id which was unknown
to the client.

Fix is to use the same check for a previously registered topic in
MQTTSProtocol_handleSubscribes that MQTTSProtocol_handleRegisters uses.
jlam732 pushed a commit to bluerover/rsmb that referenced this issue Oct 27, 2016
If a MQTTS client missed a SUBACK and consequently resent the SUBSCRIBE,
rsmb would send the next SUBACK with a different topic id. But later
PUBLISHes on that topic would use the first topic id which was unknown
to the client.

Fix is to use the same check for a previously registered topic in
MQTTSProtocol_handleSubscribes that MQTTSProtocol_handleRegisters uses.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant