kiiiiiick

This commit is contained in:
dr7ana 2023-12-11 09:29:56 -08:00
parent efe5fd3b5b
commit 1827ff63f1
1 changed files with 13 additions and 1 deletions

View File

@ -419,6 +419,7 @@ namespace llarp
// messages to the remote
if (auto itr = pending_conn_msg_queue.find(rid); itr != pending_conn_msg_queue.end())
{
log::critical(logcat, "Clearing pending queue for RID:{}", rid);
auto& que = itr->second;
while (not que.empty())
@ -428,6 +429,7 @@ namespace llarp
if (m.is_control)
{
auto& msg = reinterpret_cast<PendingControlMessage&>(m);
log::critical(logcat, "Dispatching {} request!", msg.endpoint);
ep.conns[rid]->control_stream->command(msg.endpoint, msg.body, msg.func);
}
else
@ -438,7 +440,9 @@ namespace llarp
que.pop_front();
}
return;
}
log::warning(logcat, "No pending queue to clear for RID:{}", rid);
});
};
@ -616,6 +620,14 @@ namespace llarp
const RemoteRC& source, std::string payload, std::function<void(oxen::quic::message m)> func)
{
_router.loop()->call([this, source, payload, f = std::move(func)]() {
if (auto conn = ep.get_conn(source); conn)
{
log::critical(logcat, "Dispatched bootstrap fetch request!");
conn->control_stream->command("bfetch_rcs"s, std::move(payload), std::move(f));
return;
}
log::critical(logcat, "Queuing bootstrap fetch request");
auto pending = PendingControlMessage(std::move(payload), "bfetch_rcs"s, f);
@ -639,9 +651,9 @@ namespace llarp
try
{
oxenc::bt_dict_consumer btdc{m.body()};
quantity = btdc.require<size_t>("quantity");
btdc.required("local");
remote = RemoteRC{btdc.consume_dict_consumer()};
quantity = btdc.require<size_t>("quantity");
}
catch (const std::exception& e)
{