mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
parent
68b89e9fcf
commit
4e2f3e4648
|
@ -37,7 +37,6 @@ namespace llarp::quic
|
|||
// - key_update_timer
|
||||
|
||||
Path path{local_addr, remote};
|
||||
path.remote;
|
||||
log::debug(logcat, "Connecting to {}", remote);
|
||||
|
||||
auto conn = std::make_shared<Connection>(*this, ConnectionID::random(), path, tunnel_port);
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace llarp::quic
|
|||
void* user_data)
|
||||
{
|
||||
std::basic_string_view data{rawdata, rawdatalen};
|
||||
log::debug(logcat, "Receiving crypto data @ level {} {}", crypto_level, buffer_printer{data});
|
||||
log::trace(logcat, "Receiving crypto data @ level {} {}", crypto_level, buffer_printer{data});
|
||||
|
||||
auto& conn = *static_cast<Connection*>(user_data);
|
||||
switch (crypto_level)
|
||||
|
@ -124,7 +124,6 @@ namespace llarp::quic
|
|||
return rv;
|
||||
}
|
||||
|
||||
// if i am the server
|
||||
if (ngtcp2_conn_is_server(conn))
|
||||
{
|
||||
if (auto rv = conn.send_magic(NGTCP2_CRYPTO_LEVEL_INITIAL); rv != 0)
|
||||
|
@ -144,7 +143,6 @@ namespace llarp::quic
|
|||
|
||||
case NGTCP2_CRYPTO_LEVEL_HANDSHAKE:
|
||||
log::debug(logcat, "Entering case NGTCP2_CRYPTO_LEVEL_HANDSHAKE");
|
||||
// if i am the client
|
||||
if (!ngtcp2_conn_is_server(conn))
|
||||
{
|
||||
if (auto rv = conn.recv_transport_params(data); rv != 0)
|
||||
|
|
|
@ -64,13 +64,13 @@ namespace llarp::quic
|
|||
// debug
|
||||
log::debug(logcat, "[{},ecn={}]: received {} bytes", pkt.path, pkt.info.ecn, data.size());
|
||||
|
||||
handle_packet(std::move(pkt));
|
||||
handle_packet(pkt);
|
||||
|
||||
log::trace(logcat, "Done handling packet");
|
||||
}
|
||||
|
||||
void
|
||||
Endpoint::handle_packet(Packet p)
|
||||
Endpoint::handle_packet(const Packet& p)
|
||||
{
|
||||
log::trace(logcat, "Handling incoming quic packet: {}", buffer_printer{p.data});
|
||||
// debug
|
||||
|
@ -99,10 +99,6 @@ namespace llarp::quic
|
|||
else
|
||||
log::trace(logcat, "CID is primary CID");
|
||||
|
||||
log::debug(logcat, "TESTING: LETS SEE IF THIS WORKS");
|
||||
|
||||
p.path = Path{p.path.local, connptr->path.remote};
|
||||
|
||||
handle_conn_packet(*connptr, p);
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace llarp::quic
|
|||
|
||||
// Called to handle an incoming packet
|
||||
void
|
||||
handle_packet(Packet p);
|
||||
handle_packet(const Packet& p);
|
||||
|
||||
// Internal method: handles initial common packet decoding, returns the connection ID or nullopt
|
||||
// if decoding failed.
|
||||
|
|
Loading…
Reference in a new issue