mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
cleaning up repo
- removed fprintf debug statements used for xcode debugging that were failing CI - removed unused variables also failing CI - deb stable i386 (and others) broke with logging of variants
This commit is contained in:
parent
1302c94aee
commit
be47ed543a
7 changed files with 6 additions and 1520 deletions
|
@ -413,7 +413,7 @@ if(NOT WITH_BOOTSTRAP)
|
|||
endif()
|
||||
|
||||
set(curl_extra)
|
||||
if(WIN32)li
|
||||
if(WIN32)
|
||||
set(curl_ssl_opts --without-ssl --with-schannel)
|
||||
elseif(APPLE)
|
||||
set(curl_ssl_opts --without-ssl --with-secure-transport)
|
||||
|
|
|
@ -535,6 +535,7 @@ if(WITH_EMBEDDED_LOKINET)
|
|||
OpenSSL::SSL
|
||||
OpenSSL::Crypto
|
||||
expat
|
||||
libunbound
|
||||
libzmq
|
||||
fmt::fmt
|
||||
spdlog::spdlog
|
||||
|
|
|
@ -46,17 +46,8 @@ namespace llarp::quic
|
|||
Address{SockAddr{"::1"sv, huint16_t{0}}, std::nullopt},
|
||||
Address{SockAddr{"::1"sv, huint16_t{pseudo_port}}, std::move(remote)}};
|
||||
|
||||
log::debug(logcat, "Connecting to {} with addr_variant {}", path.remote, *path.remote.endpoint);
|
||||
log::debug(logcat, "pseudo_port = {}, port = {} at {}", pseudo_port, port, __LINE__);
|
||||
|
||||
auto conn = std::make_shared<Connection>(*this, ConnectionID::random(), std::move(path), port);
|
||||
|
||||
log::debug(
|
||||
logcat,
|
||||
"Made connection object with path.remote = {} and addr_variant {} ",
|
||||
conn->path.remote,
|
||||
*conn->path.remote.endpoint);
|
||||
|
||||
conn->io_ready();
|
||||
conns.emplace(conn->base_cid, std::move(conn));
|
||||
}
|
||||
|
|
|
@ -438,12 +438,6 @@ namespace llarp::quic
|
|||
|
||||
if (!send_data.empty())
|
||||
{
|
||||
log::debug(
|
||||
logcat,
|
||||
"Sending packet to {} at port {} on {}",
|
||||
*path.remote.endpoint,
|
||||
path.remote.port(),
|
||||
__LINE__);
|
||||
rv = endpoint.send_packet(path.remote, send_data, send_pkt_info.ecn);
|
||||
}
|
||||
return rv;
|
||||
|
@ -673,7 +667,6 @@ namespace llarp::quic
|
|||
if (sent.blocked())
|
||||
{
|
||||
log::debug(logcat, "Packet send blocked, scheduling retransmit");
|
||||
log::debug(logcat, "Updating pkt tx time at {}", __LINE__);
|
||||
ngtcp2_conn_update_pkt_tx_time(conn.get(), ts);
|
||||
schedule_retransmit();
|
||||
return 0;
|
||||
|
@ -684,7 +677,6 @@ namespace llarp::quic
|
|||
{
|
||||
log::warning(logcat, "I/O error while trying to send packet: {}", sent.str());
|
||||
// FIXME: disconnect?
|
||||
log::debug(logcat, "Updating pkt tx time at {}", __LINE__);
|
||||
ngtcp2_conn_update_pkt_tx_time(conn.get(), ts);
|
||||
return 0;
|
||||
}
|
||||
|
@ -699,14 +691,11 @@ namespace llarp::quic
|
|||
{
|
||||
try
|
||||
{
|
||||
// debug
|
||||
fprintf(stderr, "Appending streamID %lld to stream list\n", stream_id.id);
|
||||
strs.push_back(stream_ptr.get());
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
log::warning(logcat, "Exception caught: {}", e.what());
|
||||
fprintf(stderr, "Exception caught: %s\n", e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -749,10 +738,6 @@ namespace llarp::quic
|
|||
}
|
||||
#endif
|
||||
|
||||
// debug
|
||||
fprintf(
|
||||
stderr, "Calling add_stream_data for vector<ngtcp2_vec> of size %zu\n", vecs.size());
|
||||
|
||||
if (stream.is_closing && !stream.sent_fin)
|
||||
{
|
||||
log::debug(logcat, "Sending FIN");
|
||||
|
@ -844,7 +829,6 @@ namespace llarp::quic
|
|||
"Current unacked bytes in flight: {}, Congestion window: {}",
|
||||
cstat.bytes_in_flight,
|
||||
cstat.cwnd);
|
||||
log::debug(logcat, "Updating pkt tx time at {}", __LINE__);
|
||||
ngtcp2_conn_update_pkt_tx_time(conn.get(), ts);
|
||||
it = strs.erase(it);
|
||||
continue;
|
||||
|
@ -854,8 +838,7 @@ namespace llarp::quic
|
|||
if (!send_packet(nwrite))
|
||||
return;
|
||||
|
||||
log::debug(logcat, "Updating pkt tx time at {}", __LINE__);
|
||||
ngtcp2_conn_update_pkt_tx_time(conn.get(), ts); // so far always useful
|
||||
ngtcp2_conn_update_pkt_tx_time(conn.get(), ts);
|
||||
//++stream_packets;
|
||||
// std::advance(it, 1);
|
||||
it = strs.erase(it);
|
||||
|
@ -863,7 +846,6 @@ namespace llarp::quic
|
|||
if (++stream_packets == max_stream_packets)
|
||||
{
|
||||
log::debug(logcat, "Max stream packets ({}) reached", max_stream_packets);
|
||||
log::debug(logcat, "Updating pkt tx time at {}", __LINE__);
|
||||
ngtcp2_conn_update_pkt_tx_time(conn.get(), ts);
|
||||
return;
|
||||
}
|
||||
|
@ -875,7 +857,6 @@ namespace llarp::quic
|
|||
for (;;)
|
||||
{
|
||||
log::debug(logcat, "Calling add_stream_data for empty stream");
|
||||
fprintf(stderr, "Calling add_stream_data for empty stream\n");
|
||||
|
||||
auto nwrite = ngtcp2_conn_writev_stream(
|
||||
conn.get(),
|
||||
|
@ -891,8 +872,6 @@ namespace llarp::quic
|
|||
(!ts) ? get_timestamp() : ts);
|
||||
|
||||
log::debug(logcat, "add_stream_data for non-stream returned [{},{}]", nwrite, ndatalen);
|
||||
// debug
|
||||
fprintf(stderr, "add_stream_data for non-stream returned [%ld,%ld]\n", nwrite, ndatalen);
|
||||
assert(ndatalen <= 0);
|
||||
|
||||
if (nwrite == 0)
|
||||
|
@ -916,7 +895,6 @@ namespace llarp::quic
|
|||
if (nwrite == -240) // NGTCP2_ERR_WRITE_MORE
|
||||
{
|
||||
log::debug(logcat, "Writing non-stream data frames, and have space left");
|
||||
log::debug(logcat, "Updating pkt tx time at {}", __LINE__);
|
||||
ngtcp2_conn_update_pkt_tx_time(conn.get(), ts);
|
||||
continue;
|
||||
}
|
||||
|
@ -938,7 +916,6 @@ namespace llarp::quic
|
|||
log::debug(logcat, "Sending data packet with non-stream data frames");
|
||||
if (auto rv = send_packet(nwrite); rv != 0)
|
||||
return;
|
||||
log::debug(logcat, "Updating pkt tx time at {}", __LINE__);
|
||||
ngtcp2_conn_update_pkt_tx_time(conn.get(), ts);
|
||||
}
|
||||
|
||||
|
@ -956,7 +933,6 @@ namespace llarp::quic
|
|||
expiry - get_time().time_since_epoch());
|
||||
|
||||
log::debug(logcat, "ngtcp2_conn_get_expiry: {} from now", ngtcp2_expiry_delta);
|
||||
fprintf(stderr, "ngtcp2_conn_get_expiry: %ld from now\n", ngtcp2_expiry_delta.count());
|
||||
|
||||
if (exp == std::numeric_limits<decltype(exp)>::max())
|
||||
{
|
||||
|
@ -967,7 +943,6 @@ namespace llarp::quic
|
|||
|
||||
auto expires_in = std::max(0ms, ngtcp2_expiry_delta);
|
||||
log::debug(logcat, "Next retransmit in {}ms", expires_in.count());
|
||||
fprintf(stderr, "Next retransmit in %ldms\n", expires_in.count());
|
||||
retransmit_timer->stop();
|
||||
retransmit_timer->start(expires_in, 0ms);
|
||||
}
|
||||
|
@ -1145,7 +1120,6 @@ namespace llarp::quic
|
|||
{
|
||||
if (not endpoint.null_crypto.install_tx_key(conn.get()))
|
||||
{
|
||||
log::debug(logcat, "Call to install_tx_key unsuccessful at {}", __LINE__);
|
||||
return CALLBACK_FAIL;
|
||||
}
|
||||
}
|
||||
|
@ -1372,14 +1346,9 @@ namespace llarp::quic
|
|||
|
||||
const bool is_server = ngtcp2_conn_is_server(conn.get());
|
||||
|
||||
// debug
|
||||
log::debug(logcat, "Transport param port = {} at line {}", tunnel_port, __LINE__);
|
||||
|
||||
if (is_server)
|
||||
{
|
||||
tunnel_port = port;
|
||||
// debug
|
||||
log::debug(logcat, "Transport param tunnel_port = {} at line {}", tunnel_port, __LINE__);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -68,8 +68,6 @@ namespace llarp::quic
|
|||
ngtcp2_pkt_info{.ecn = ecn}};
|
||||
|
||||
log::trace(logcat, "[{},ecn={}]: received {} bytes", pkt.path, pkt.info.ecn, data.size());
|
||||
// debug
|
||||
log::debug(logcat, "[{},ecn={}]: received {} bytes", pkt.path, pkt.info.ecn, data.size());
|
||||
|
||||
handle_packet(pkt);
|
||||
|
||||
|
@ -79,8 +77,6 @@ namespace llarp::quic
|
|||
void
|
||||
Endpoint::handle_packet(const Packet& p)
|
||||
{
|
||||
// debug
|
||||
log::debug(logcat, "Handling incoming quic packet: {}", buffer_printer{p.data});
|
||||
auto maybe_dcid = handle_packet_init(p);
|
||||
if (!maybe_dcid)
|
||||
{
|
||||
|
@ -219,12 +215,11 @@ namespace llarp::quic
|
|||
llarp_buffer_t{outgoing.data(), outgoing.size()},
|
||||
service::ProtocolType::QUIC))
|
||||
{
|
||||
// debug
|
||||
log::debug(logcat, "[{}]: sent {}", to, buffer_printer{outgoing});
|
||||
log::trace(logcat, "[{}]: sent {}", to, buffer_printer{outgoing});
|
||||
}
|
||||
else
|
||||
{
|
||||
log::debug(
|
||||
log::trace(
|
||||
logcat, "Failed to send to quic endpoint {}; was sending {}B", to, outgoing.size());
|
||||
}
|
||||
return {};
|
||||
|
@ -256,9 +251,6 @@ namespace llarp::quic
|
|||
if (nwrote <= 0)
|
||||
return;
|
||||
|
||||
log::debug(
|
||||
logcat, "Sending packet to {} at port {} on {}", *source.endpoint, source.port(), __LINE__);
|
||||
|
||||
send_packet(source, bstring_view{buf.data(), static_cast<size_t>(nwrote)}, 0);
|
||||
}
|
||||
|
||||
|
@ -351,7 +343,6 @@ namespace llarp::quic
|
|||
Endpoint::check_timeouts()
|
||||
{
|
||||
auto now = get_time();
|
||||
uint64_t now_ts = get_timestamp(now);
|
||||
|
||||
// Destroy any connections that are finished draining
|
||||
bool cleanup = false;
|
||||
|
|
|
@ -509,8 +509,7 @@ namespace llarp::quic
|
|||
"Unable to open an outgoing quic connection: too many existing connections"};
|
||||
(next_pseudo_port_ = pport)++;
|
||||
|
||||
// debug
|
||||
log::debug(logcat, "Bound TCP tunnel {} for quic client :{}", saddr, pport);
|
||||
log::trace(logcat, "Bound TCP tunnel {} for quic client :{}", saddr, pport);
|
||||
|
||||
// We are emplacing into client_tunnels_ here: beyond this point we must not throw until we
|
||||
// return (or if we do, make sure we remove this row from client_tunnels_ first).
|
||||
|
@ -697,9 +696,6 @@ namespace llarp::quic
|
|||
auto ecn = static_cast<uint8_t>(buf.base[3]);
|
||||
bstring_view data{reinterpret_cast<const std::byte*>(&buf.base[4]), buf.sz - 4};
|
||||
|
||||
// auto addr_data = var::visit([](auto& addr) { return addr.as_array(); }, remote);
|
||||
// huint128_t ip{};
|
||||
// std::copy_n(addr_data.begin(), sizeof(ip.h), &ip.h);
|
||||
huint16_t remote_port{pseudo_port};
|
||||
|
||||
quic::Endpoint* ep = nullptr;
|
||||
|
@ -755,18 +751,7 @@ namespace llarp::quic
|
|||
pseudo_port,
|
||||
__LINE__);
|
||||
|
||||
// to try: set port to 0
|
||||
// remote_port = huint16_t{0};
|
||||
// pseudo_port = 0;
|
||||
|
||||
auto remote_addr = Address{SockAddr{"::1"sv, remote_port}, std::move(remote)};
|
||||
log::debug(
|
||||
logcat,
|
||||
"Receiving packet from {} with port = {}, remote = {} at line {}",
|
||||
remote_addr,
|
||||
remote_addr.port(),
|
||||
*remote_addr.endpoint,
|
||||
__LINE__);
|
||||
ep->receive_packet(std::move(remote_addr), ecn, data);
|
||||
}
|
||||
} // namespace llarp::quic
|
||||
|
|
Loading…
Reference in a new issue