Skip to content

Commit

Permalink
Merge pull request #818 from redboltz/auto_adjust_server_side_topic_a…
Browse files Browse the repository at this point in the history
…lias_send_max

Added auto adjusitng topic alias send max for broker.
  • Loading branch information
redboltz authored Jul 17, 2021
2 parents a6511b8 + 42d512b commit 6b6385b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/mqtt/endpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6841,6 +6841,12 @@ class endpoint : public std::enable_shared_from_this<endpoint<Mutex, LockGuard,
}
break;
case protocol_version::v5:
if (auto ta_opt = get_topic_alias_maximum_from_props(props_)) {
if (ta_opt.value() > 0) {
LockGuard<Mutex> lck (ep_.topic_alias_send_mtx_);
ep_.topic_alias_send_.emplace(ta_opt.value());
}
}
if (ep_.on_v5_connect(
force_move(client_id_),
force_move(user_name_),
Expand Down Expand Up @@ -6992,6 +6998,7 @@ class endpoint : public std::enable_shared_from_this<endpoint<Mutex, LockGuard,
case protocol_version::v5:
if (auto ta_opt = get_topic_alias_maximum_from_props(props_)) {
if (ta_opt.value() > 0) {
LockGuard<Mutex> lck (ep_.topic_alias_send_mtx_);
ep_.topic_alias_send_.emplace(ta_opt.value());
}
}
Expand Down

0 comments on commit 6b6385b

Please sign in to comment.