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

ConnectionManager: fail if max channel count is reached

Change-Id: I71d88e0efbf78009ba003b03d107c0f897dbc485
parent b941e92a
No related branches found
No related tags found
No related merge requests found
...@@ -1041,6 +1041,13 @@ ConnectionManager::Impl::sendChannelRequest(const std::weak_ptr<DeviceInfo>& din ...@@ -1041,6 +1041,13 @@ ConnectionManager::Impl::sendChannelRequest(const std::weak_ptr<DeviceInfo>& din
const dht::Value::Id& vid) const dht::Value::Id& vid)
{ {
auto channelSock = sock->addChannel(name); auto channelSock = sock->addChannel(name);
if (!channelSock) {
if (config_->logger)
config_->logger->error("sendChannelRequest failed - cannot create channel");
if (auto info = dinfo.lock())
info->executePendingOperations(vid, nullptr);
return;
}
channelSock->onShutdown([dinfo, name, vid] { channelSock->onShutdown([dinfo, name, vid] {
if (auto info = dinfo.lock()) if (auto info = dinfo.lock())
info->executePendingOperations(vid, nullptr); info->executePendingOperations(vid, nullptr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment