libquic bump

pull/2204/head
dr7ana 8 months ago
parent d0c3837384
commit ae319091d6

@ -1 +1 @@
Subproject commit ba1958311a4ff672af6d7d947c46c13ac177a711
Subproject commit 26a269e6bab6f7a03503b8aae72d6a153f9ac345

@ -29,7 +29,7 @@ namespace llarp
try
{
btdp.append("a", "");
btdp.append("a", "m");
{
auto subdict = btdp.append_dict("m");
for (auto& m : msgs)
@ -50,7 +50,7 @@ namespace llarp
DHTImmediateMessage::decode_key(const llarp_buffer_t& key, llarp_buffer_t* buf)
{
if (key.startswith("m"))
return llarp::dht::DecodeMessageList(dht::Key_t(session->GetPubKey()), buf, msgs);
return llarp::dht::DecodeMessageList(dht::Key_t(conn->remote_rc.pubkey), buf, msgs);
if (key.startswith("v"))
{
if (!bencode_read_integer(buf, &version))
@ -65,7 +65,7 @@ namespace llarp
DHTImmediateMessage::handle_message(Router* router) const
{
DHTImmediateMessage reply;
reply.session = session;
reply.conn = conn;
bool result = true;
auto dht = router->dht();
for (const auto& msg : msgs)
@ -76,7 +76,7 @@ namespace llarp
{
if (result)
{
result = router->SendToOrQueue(session->GetPubKey(), reply);
result = router->SendToOrQueue(conn->remote_rc.pubkey, reply);
}
}
return true;

@ -72,4 +72,9 @@ namespace llarp
}
};
struct AbstractDataMessage : public AbstractLinkMessage
{
using AbstractLinkMessage::AbstractLinkMessage;
};
} // namespace llarp

@ -9,7 +9,11 @@
namespace llarp
{
struct RelayUpstreamMessage final : public AbstractLinkMessage
/*
Data messages to be sent via quic datagrams
*/
struct RelayUpstreamMessage final : public AbstractDataMessage
{
Encrypted<MAX_LINK_MSG_SIZE - 128> enc;
TunnelNonce nonce;
@ -38,7 +42,7 @@ namespace llarp
}
};
struct RelayDownstreamMessage final : public AbstractLinkMessage
struct RelayDownstreamMessage final : public AbstractDataMessage
{
Encrypted<MAX_LINK_MSG_SIZE - 128> enc;
TunnelNonce nonce;

@ -488,7 +488,7 @@ namespace llarp::path
{
for (const auto& msg : msgs)
{
if (r->SendToOrQueue(Upstream(), msg))
if (r->send_data_message(Upstream(), msg))
{
m_TXRate += msg.enc.size();
}

@ -206,7 +206,7 @@ namespace llarp::path
info.downstream,
" to ",
info.upstream);
r->SendToOrQueue(info.upstream, msg);
r->send_data_message(info.upstream, msg);
}
}
r->TriggerPump();
@ -224,7 +224,7 @@ namespace llarp::path
info.upstream,
" to ",
info.downstream);
r->SendToOrQueue(info.downstream, msg);
r->send_data_message(info.downstream, msg);
}
r->TriggerPump();
}
@ -299,8 +299,7 @@ namespace llarp::path
}
return SendRoutingMessage(grant, r);
}
// TODO: exponential backoff
// TODO: rejected policies
// TODO: exponential backoff, rejected policies ?
llarp::routing::RejectExitMessage reject;
reject.sequence_number = NextSeqNo();
reject.tx_id = msg.tx_id;

@ -279,6 +279,18 @@ namespace llarp
return _outboundMessageHandler.QueueMessage(remote, msg, handler);
}
bool
Router::send_data_message(const RouterID &remote, const AbstractDataMessage &msg)
{
return _link_manager.send_data_message(remote, msg.bt_encode());
}
bool
Router::send_control_message(const RouterID &remote, const AbstractLinkMessage &msg)
{
}
void
Router::try_connect(fs::path rcfile)
{

@ -213,7 +213,6 @@ namespace llarp
/** TOFIX: this
- refactor path types (path_context, pathset) to use unified ID type, not PathID_t
- refactor all callers to use new implementation of remove_path
*/
OutboundMessageHandler&
outboundMessageHandler()
@ -516,6 +515,12 @@ namespace llarp
SendToOrQueue(
const RouterID& remote, const AbstractLinkMessage& msg, SendStatusHandler handler);
bool
send_data_message(const RouterID& remote, const AbstractDataMessage& msg);
bool
send_control_message(const RouterID& remote, const AbstractLinkMessage& msg);
bool IsBootstrapNode(RouterID) const;
/// check if newRc matches oldRC and update local rc for this remote contact

@ -44,7 +44,7 @@ namespace llarp
~ProtocolMessage();
ProtocolType proto = ProtocolType::TrafficV4;
llarp_time_t queued = 0s;
std::vector<byte_t> payload;
std::vector<byte_t> payload; // encrypted AbstractLinkMessage
Introduction introReply;
ServiceInfo sender;
Endpoint* handler = nullptr;

Loading…
Cancel
Save