From 7da115ad0a838db40e69d8dfb72c17d1eb29ffbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Tue, 22 Oct 2024 01:43:26 -0400 Subject: [PATCH] ConnectionManager: register pending ids on request And remove unneeded check added in previous commit Change-Id: I1b1f946fde02a09c9695b1f092c041fbd9278e06 --- src/connectionmanager.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp index d65d072..86ec0b9 100644 --- a/src/connectionmanager.cpp +++ b/src/connectionmanager.cpp @@ -923,11 +923,6 @@ ConnectionManager::Impl::connectDevice(const std::shared_ptrmtx_); 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& 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",