diff --git a/src/rtc_signaling.cpp b/src/rtc_signaling.cpp index de6f23d1f5..398cf76940 100644 --- a/src/rtc_signaling.cpp +++ b/src/rtc_signaling.cpp @@ -287,7 +287,7 @@ rtc_signaling::connection& rtc_signaling::create_connection(rtc_offer_id const& }); pc->onGatheringStateChange([weak_this = weak_from_this(), weak_pc = make_weak_ptr(pc), offer_id - , handler = std::move(handler)] + , handler_ = std::move(handler)] (rtc::PeerConnection::GatheringState state) { // Warning: this is called from another thread @@ -299,7 +299,7 @@ rtc_signaling::connection& rtc_signaling::create_connection(rtc_offer_id const& { auto& io_context = self->m_io_context; auto description = *pc_->localDescription(); - post(io_context, std::bind(std::move(handler), error_code{}, description)); + post(io_context, std::bind(std::move(handler_), error_code{}, description)); } }); diff --git a/src/tracker_manager.cpp b/src/tracker_manager.cpp index 6af509b245..6a27e39dc2 100644 --- a/src/tracker_manager.cpp +++ b/src/tracker_manager.cpp @@ -309,26 +309,26 @@ namespace libtorrent::aux { { // when we're shutting down, we don't really want to // re-establish the persistent websocket connection just to - // announce "stopped", and advertize 0 offers. It may hang + // announce "stopped", and advertise 0 offers. It may hang // shutdown. post(ios, std::bind(&request_callback::tracker_request_error, cb, std::move(req) , errors::torrent_aborted, operation_t::connect , "", seconds32(0))); } cb->generate_rtc_offers(req.num_want - , [this, &ios, req = std::move(req), c](error_code const& ec + , [this, &ios, request = std::move(req), c](error_code const& ec , std::vector offers) mutable { - if (!ec) req.offers = std::move(offers); + if (!ec) request.offers = std::move(offers); - auto it = m_websocket_conns.find(req.url); + auto it = m_websocket_conns.find(request.url); if (it != m_websocket_conns.end() && it->second->is_started()) { - it->second->queue_request(std::move(req), c); + it->second->queue_request(std::move(request), c); } else { auto con = std::make_shared( - ios, *this, std::move(req), c); + ios, *this, std::move(request), c); con->start(); - m_websocket_conns[req.url] = con; + m_websocket_conns[request.url] = con; } }); return; diff --git a/src/websocket_tracker_connection.cpp b/src/websocket_tracker_connection.cpp index 9fc4edc68d..321ae58597 100644 --- a/src/websocket_tracker_connection.cpp +++ b/src/websocket_tracker_connection.cpp @@ -155,13 +155,13 @@ void websocket_tracker_connection::send_pending() auto [msg, callback] = std::move(m_pending.front()); m_pending.pop(); - std::visit([this, callback = callback](auto const& m) + std::visit([this, cb = callback](auto const& m) { // Update requester and store callback - if (callback.lock()) + if (cb.lock()) { - m_requester = callback; - m_callbacks[m.info_hash] = std::move(callback); + m_requester = cb; + m_callbacks[m.info_hash] = std::move(cb); } do_send(m);