Skip to content
Snippets Groups Projects
Commit 1addf952 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

onPeerResponse: move request

Change-Id: I93782be5cd93c824d14e7c9871be47ed6527d836
parent 8d787734
Branches
No related tags found
No related merge requests found
...@@ -500,7 +500,7 @@ public: ...@@ -500,7 +500,7 @@ public:
const std::string& name = ""); const std::string& name = "");
void addNewMultiplexedSocket(const std::weak_ptr<DeviceInfo>& dinfo, const DeviceId& deviceId, const dht::Value::Id& vid, const std::shared_ptr<ConnectionInfo>& info); void addNewMultiplexedSocket(const std::weak_ptr<DeviceInfo>& dinfo, const DeviceId& deviceId, const dht::Value::Id& vid, const std::shared_ptr<ConnectionInfo>& info);
void onPeerResponse(const PeerConnectionRequest& req); void onPeerResponse(PeerConnectionRequest&& req);
void onDhtConnected(const dht::crypto::PublicKey& devicePk); void onDhtConnected(const dht::crypto::PublicKey& devicePk);
...@@ -1078,7 +1078,7 @@ ConnectionManager::Impl::sendChannelRequest(const std::weak_ptr<DeviceInfo>& din ...@@ -1078,7 +1078,7 @@ ConnectionManager::Impl::sendChannelRequest(const std::weak_ptr<DeviceInfo>& din
} }
void void
ConnectionManager::Impl::onPeerResponse(const PeerConnectionRequest& req) ConnectionManager::Impl::onPeerResponse(PeerConnectionRequest&& req)
{ {
auto device = req.owner->getLongId(); auto device = req.owner->getLongId();
if (auto info = infos_.getInfo(device, req.id)) { if (auto info = infos_.getInfo(device, req.id)) {
...@@ -1123,7 +1123,7 @@ ConnectionManager::Impl::onDhtConnected(const dht::crypto::PublicKey& devicePk) ...@@ -1123,7 +1123,7 @@ ConnectionManager::Impl::onDhtConnected(const dht::crypto::PublicKey& devicePk)
shared->config_->logger->debug("[device {}] Received request", req.owner->getLongId()); shared->config_->logger->debug("[device {}] Received request", req.owner->getLongId());
} }
if (req.isAnswer) { if (req.isAnswer) {
shared->onPeerResponse(req); shared->onPeerResponse(std::move(req));
} else { } else {
// Async certificate checking // Async certificate checking
shared->findCertificate( shared->findCertificate(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment