Skip to content

Commit

Permalink
Merge pull request #987 from redboltz/fix_v5_pubrec_error_send_more
Browse files Browse the repository at this point in the history
Fixed qos2_publish_handled_ insertion timing.
  • Loading branch information
redboltz authored Oct 4, 2023
2 parents ec7bc54 + d09d49b commit 5e90794
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/mqtt/endpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7956,7 +7956,11 @@ class endpoint : public std::enable_shared_from_this<endpoint<Mutex, LockGuard,
if (
[&] {
LockGuard<Mutex> lck(ep_.qos2_publish_handled_mtx_);
return ep_.qos2_publish_handled_.find(*packet_id_) == ep_.qos2_publish_handled_.end();
auto first_publish = ep_.qos2_publish_handled_.find(*packet_id_) == ep_.qos2_publish_handled_.end();
if (first_publish) {
ep_.qos2_publish_handled_.emplace(*packet_id_);
}
return first_publish;
} ()
) {
if (handler_call()) {
Expand All @@ -7969,10 +7973,6 @@ class endpoint : public std::enable_shared_from_this<endpoint<Mutex, LockGuard,
)
)
);
{
LockGuard<Mutex> lck(ep_.qos2_publish_handled_mtx_);
ep_.qos2_publish_handled_.emplace(*packet_id_);
}
ep_.auto_pub_response(
[this] {
if (ep_.connected_) {
Expand Down

0 comments on commit 5e90794

Please sign in to comment.