1.deal with pubrel, ignore the ret of msg remove, 2.delete the same m… #1629
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.
in function handle__pubrel(), ingore the return value of message__remove() . when deal with the pubrel, received unexpected rel is apparently normal behaviour, if returned the rc, the loop may exit.
in function message__queue(), add the check for same mid. if found the same mid, delete it. in some test scenarios, the server may reset, but client not reset , it may keep the older message, and the the next time connect to the server, it will received the same mid message.and then when get message from the queue, it will get unexpected message.
If you are contributing a bugfix, is your work based off the fixes branch?
Have you added an explanation of what your changes do and why you'd like us to include them?
Have you successfully run
make test
with your changes locally?