Commit 01a2b611 authored by Adrien Béraud's avatar Adrien Béraud Committed by Sébastien Blin

dring: fix SonarQube issues

Change-Id: I273f3e53c6d702ebe87bb0feeafb39f590eee516
Reviewed-by: Sébastien Blin's avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent d65c2806
......@@ -707,7 +707,7 @@ Manager::init(const std::string &config_file)
#endif
#define PJSIP_TRY(ret) do { \
if (ret != PJ_SUCCESS) \
if ((ret) != PJ_SUCCESS) \
throw std::runtime_error(#ret " failed"); \
} while (0)
......
......@@ -899,7 +899,7 @@ private:
// Helper to install a callback to be called once by the main event loop
template<typename Callback>
static void runOnMainThread(Callback&& cb) {
Manager::instance().scheduler().run([cb = std::move(cb)]() mutable {
Manager::instance().scheduler().run([cb = std::forward<Callback>(cb)]() mutable {
cb();
});
}
......
......@@ -193,12 +193,12 @@ void NameDirectory::lookupName(const std::string& n, LookupCallback cb)
}
restbed::Uri uri(HTTPS_PROTO + serverHost_ + QUERY_NAME + name);
RING_DBG("Name lookup for %s: %s", name.c_str(), uri.to_string().c_str());
auto request = std::make_shared<restbed::Request>(std::move(uri));
request->set_header("Accept", "*/*");
request->set_header("Host", serverHost_);
RING_DBG("Name lookup for %s: %s", name.c_str(), uri.to_string().c_str());
auto ret = restbed::Http::async(request, [this,cb,name](const std::shared_ptr<restbed::Request>&,
const std::shared_ptr<restbed::Response>& reply) {
auto code = reply->get_status_code();
......
......@@ -117,7 +117,7 @@ public:
throw std::runtime_error("Can not call wait outside thread context");
std::unique_lock<std::mutex> lk(mutex_);
cv_.wait(lk, [this, p = std::move(pred)]{ return isStopping() || p(); });
cv_.wait(lk, [this, p = std::forward<Pred>(pred)]{ return isStopping() || p(); });
}
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment