Clear application map connection entry earlier

pull/2232/head
dr7ana 4 months ago
parent 722b03baaa
commit 861d573e6a

@ -26,8 +26,3 @@ namespace llarp::link
bool is_relay = true); bool is_relay = true);
}; };
} // namespace llarp::link } // namespace llarp::link
/*
TODO:
- make control_stream a weak pointer?
*/

@ -285,7 +285,10 @@ namespace llarp
auto defer_to_incoming = other < router().local_rid(); auto defer_to_incoming = other < router().local_rid();
if (defer_to_incoming) if (defer_to_incoming)
{
itr->second->conn->set_close_quietly(); itr->second->conn->set_close_quietly();
itr->second = nullptr;
}
log::critical( log::critical(
logcat, logcat,
@ -351,7 +354,7 @@ namespace llarp
if (auto it = ep.service_conns.find(rid); it != ep.service_conns.end()) if (auto it = ep.service_conns.find(rid); it != ep.service_conns.end())
{ {
log::critical(logcat, "Configuring inbound connection from relay RID:{}", rid); log::critical(logcat, "Configuring inbound connection from relay RID:{}", rid);
it->second = std::make_shared<link::Connection>(ci.shared_from_this(), make_control(ci, rid)); it->second = std::make_shared<link::Connection>(ci.shared_from_this(), make_control(ci, rid));
} }
else if (auto it = ep.client_conns.find(rid); it != ep.client_conns.end()) else if (auto it = ep.client_conns.find(rid); it != ep.client_conns.end())
@ -464,10 +467,13 @@ namespace llarp
if (auto conn = ep.get_conn(remote); conn) if (auto conn = ep.get_conn(remote); conn)
{ {
log::critical(logcat, "Dispatching {} request to remote:{}", endpoint, remote);
conn->control_stream->command(std::move(endpoint), std::move(body), std::move(func)); conn->control_stream->command(std::move(endpoint), std::move(body), std::move(func));
return true; return true;
} }
log::critical(logcat, "Queueing message to ");
_router.loop()->call([this, _router.loop()->call([this,
remote, remote,
endpoint = std::move(endpoint), endpoint = std::move(endpoint),

@ -157,7 +157,7 @@ namespace llarp
friend struct link::Endpoint; friend struct link::Endpoint;
std::atomic<bool> is_stopping; std::atomic<bool> is_stopping{false};
// sessions to persist -> timestamp to end persist at // sessions to persist -> timestamp to end persist at
std::unordered_map<RouterID, llarp_time_t> persisting_conns; std::unordered_map<RouterID, llarp_time_t> persisting_conns;

Loading…
Cancel
Save