Commit 0a321cf9 authored by Dominik Charousset's avatar Dominik Charousset

Fix issue with multiple connections to same node

parent ad651cd3
...@@ -416,13 +416,17 @@ basp_broker::handle_basp_header(connection_context& ctx, ...@@ -416,13 +416,17 @@ basp_broker::handle_basp_header(connection_context& ctx,
if (!std::includes(ifs.begin(), ifs.end(), if (!std::includes(ifs.begin(), ifs.end(),
remote_ifs.begin(), remote_ifs.end())) { remote_ifs.begin(), remote_ifs.end())) {
auto tostr = [](const std::set<string>& what) -> string { auto tostr = [](const std::set<string>& what) -> string {
if (what.empty()) return "actor"; if (what.empty()) {
return "actor";
}
string tmp; string tmp;
tmp = "typed_actor<"; tmp = "typed_actor<";
auto i = what.begin(); auto i = what.begin();
auto e = what.end(); auto e = what.end();
tmp += *i++; tmp += *i++;
while (i != e) tmp += *i++; while (i != e) {
tmp += *i++;
}
tmp += ">"; tmp += ">";
return tmp; return tmp;
}; };
...@@ -460,13 +464,9 @@ basp_broker::handle_basp_header(connection_context& ctx, ...@@ -460,13 +464,9 @@ basp_broker::handle_basp_header(connection_context& ctx,
return close_connection; return close_connection;
} }
if (!try_set_default_route(nid, ctx.hdl)) { if (!try_set_default_route(nid, ctx.hdl)) {
CAF_LOG_INFO("multiple connections to " CAF_LOG_INFO("multiple connections to " << to_string(nid)
<< to_string(nid)
<< " (re-use old one)"); << " (re-use old one)");
auto proxy = m_namespace.get(nid, remote_aid); auto proxy = m_namespace.get_or_put(nid, remote_aid);
CAF_LOG_INFO_IF(!proxy,
"no proxy for published actor found "
"although an open connection exists");
// discard this peer; there's already an open connection // discard this peer; there's already an open connection
ctx.handshake_data->result->set_value(std::move(proxy)); ctx.handshake_data->result->set_value(std::move(proxy));
ctx.handshake_data = nullptr; ctx.handshake_data = nullptr;
......
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