@@ -10547,7 +10547,8 @@ class endpoint : public std::enable_shared_from_this<endpoint<Mutex, LockGuard,
1054710547 async_handler_t func
1054810548 ) {
1054910549 auto do_async_send_publish =
10550- [&](auto msg, auto && serialize_publish, auto && receive_maximum_proc) {
10550+ [&, func = force_move (func)]
10551+ (auto msg, auto && serialize_publish, auto && receive_maximum_proc) mutable {
1055110552 auto msg_lk = apply_topic_alias (msg, life_keeper);
1055210553 if (maximum_packet_size_send_ < size<PacketIdBytes>(std::get<0 >(msg_lk))) {
1055310554 if (packet_id != 0 ) {
@@ -10565,7 +10566,13 @@ class endpoint : public std::enable_shared_from_this<endpoint<Mutex, LockGuard,
1056510566 msg,
1056610567 life_keeper,
1056710568 std::forward<decltype (serialize_publish)>(serialize_publish),
10568- std::forward<decltype (receive_maximum_proc)>(receive_maximum_proc)
10569+ [
10570+ &func,
10571+ receive_maximum_proc = std::forward<decltype (receive_maximum_proc)>(receive_maximum_proc)
10572+ ]
10573+ (auto && msg) mutable {
10574+ return receive_maximum_proc (force_move (msg), func);
10575+ }
1056910576 )
1057010577 ) {
1057110578 do_async_write (
@@ -10587,7 +10594,7 @@ class endpoint : public std::enable_shared_from_this<endpoint<Mutex, LockGuard,
1058710594 pubopts
1058810595 ),
1058910596 &endpoint::on_serialize_publish_message,
10590- [] (auto &&) { return true ; }
10597+ [] (auto &&, async_handler_t & ) { return true ; }
1059110598 );
1059210599 break ;
1059310600 case protocol_version::v5:
@@ -10600,7 +10607,7 @@ class endpoint : public std::enable_shared_from_this<endpoint<Mutex, LockGuard,
1060010607 force_move (props)
1060110608 ),
1060210609 &endpoint::on_serialize_v5_publish_message,
10603- [this , func = force_move (func) ] (v5::basic_publish_message<PacketIdBytes>&& msg) mutable {
10610+ [this ] (v5::basic_publish_message<PacketIdBytes>&& msg, async_handler_t & func ) mutable {
1060410611 if (publish_send_count_.load () == publish_send_max_) {
1060510612 {
1060610613 LockGuard<Mutex> lck (publish_send_queue_mtx_);
0 commit comments