Skip to content

Commit

Permalink
proxy client: use [[maybe_unused]]
Browse files Browse the repository at this point in the history
  • Loading branch information
aberaud committed Aug 30, 2023
1 parent 0f7dd32 commit 46cdab5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/dht_proxy_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,10 @@ DhtProxyClient::onProxyInfos(const Json::Value& proxyInfos, const sa_family_t fa
addresses.emplace_back(publicAddressV4_);
if (publicAddressV6_)
addresses.emplace_back(publicAddressV6_);
publicAddressChangedCb_(std::move(addresses));
std::lock_guard<std::mutex> lock(lockCallbacks_);
callbacks_.emplace_back([cb=publicAddressChangedCb_, addresses = std::move(addresses)](){
cb(std::move(addresses));
});
}

if (!ipChanged && stats4_.good_nodes + stats6_.good_nodes)
Expand Down Expand Up @@ -1202,7 +1205,7 @@ DhtProxyClient::restartListeners(const asio::error_code &ec)
}

void
DhtProxyClient::pushNotificationReceived(const std::map<std::string, std::string>& notification)
DhtProxyClient::pushNotificationReceived([[maybe_unused]] const std::map<std::string, std::string>& notification)
{
#ifdef OPENDHT_PUSH_NOTIFICATIONS
{
Expand Down Expand Up @@ -1301,13 +1304,11 @@ DhtProxyClient::pushNotificationReceived(const std::map<std::string, std::string
}
if (launchLoop)
loopSignal_();
#else
(void) notification;
#endif
}

void
DhtProxyClient::resubscribe(const InfoHash& key, const size_t token, Listener& listener)
DhtProxyClient::resubscribe([[maybe_unused]] const InfoHash& key, [[maybe_unused]] const size_t token, [[maybe_unused]] Listener& listener)
{
#ifdef OPENDHT_PUSH_NOTIFICATIONS
if (deviceKey_.empty())
Expand All @@ -1331,9 +1332,6 @@ DhtProxyClient::resubscribe(const InfoHash& key, const size_t token, Listener& l
std::placeholders::_1, key, token, opstate));
auto vcb = listener.cb;
sendListen(header, vcb, opstate, listener, ListenMethod::RESUBSCRIBE);
#else
(void) key;
(void) listener;
#endif
}

Expand Down

0 comments on commit 46cdab5

Please sign in to comment.