Fixed broker side qos2 exactly once logic. #874
Merged
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.
endpoint has qos2 duplicated transfer avoiding mechanism.
It is implemented by
qos2_publish_handled_
.endpoint works for both client and broker.
However broker (server) is different from the client.
Client can reconnect usign the same endpoint instance as the previous
connection. But the broker can't.
It is because accepting mechanism. On accept, the server needs to create
the new endpoint.
So the broker had an original qos2 duplicated transfer avoiding
mechanism.
It is implemented by
qos2_publish_processed_
.But the implementation is a little redundant.
So I introduced get and restore functionality for
qos2_publish_handled_
.It was #873 but it had bug.
qos2_publish_processed_
was mixed.This PR completely removed
qos2_publish_processed_
related code fromthe broker and added correct implementation for
qos2_publish_handled_
.