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

ConnectionManager: register pending ids on request

And remove unneeded check added in previous commit

Change-Id: I1b1f946fde02a09c9695b1f092c041fbd9278e06
parent 16e03dc8
No related branches found
No related tags found
No related merge requests found
......@@ -923,11 +923,6 @@ ConnectionManager::Impl::connectDevice(const std::shared_ptr<dht::crypto::Certif
std::unique_lock lk(di->mtx_);
if (!di->cert) {
di->cert = cert;
} else if (di->cert->getLongId() != deviceId) {
if (sthis->config_->logger)
sthis->config_->logger->error("[device {}] Certificate mismatch", deviceId);
cb(nullptr, deviceId);
return;
}
dht::Value::Id vid;
......@@ -1281,10 +1276,12 @@ ConnectionManager::Impl::onTlsNegotiationDone(const std::shared_ptr<DeviceInfo>&
std::unique_lock lk2 {dinfo->mtx_};
auto pendingIds = dinfo->requestPendingOps();
auto previousConnections = dinfo->getConnectedInfos();
lk2.unlock();
std::unique_lock lk {info->mutex_};
addNewMultiplexedSocket(dinfo, deviceId, vid, info);
for (const auto& [id, name]: pendingIds)
info->cbIds_.emplace(id);
lk.unlock();
lk2.unlock();
// send beacon to existing connections for this device
if (config_->logger and not previousConnections.empty())
config_->logger->warn("[device {}] Sending beacon to {} existing connections",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment