Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
debian_pipeline('Debian sid/debug', docker_base + 'debian-sid', build_type='Debug'),
debian_pipeline('Debian sid/debug [arm64]', docker_base + 'debian-sid', build_type='Debug', arch='arm64', jobs=4),

clang(17),
full_llvm(17),
clang(19),
clang(18),
full_llvm(19),
clang(20),
full_llvm(20),

debian_pipeline('Debian testing', docker_base + 'debian-forky'),
debian_pipeline('Debian testing [i386]', docker_base + 'debian-forky/i386'),
Expand Down
21 changes: 14 additions & 7 deletions contrib/libsession-router_jank_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <filesystem>
#include <future>
#include <iostream>
#include <regex>

extern "C"
{
Expand All @@ -18,7 +19,7 @@ int main(int argc, char** argv)
{
if (argc <= 1)
{
std::cerr << "USAGE: " << argv[0] << " {PUBKEY.sesh | PUBKEY.snode | ONS.loki}\n";
std::cerr << "USAGE: " << argv[0] << " {PUBKEY.sesh | PUBKEY.snode | ONS.loki}[:REMOTEPORT]\n";
return 1;
}

Expand All @@ -32,6 +33,12 @@ int main(int argc, char** argv)

std::string target{argv[1]};

int port = 12345; // Default, but updated if target ends with :PORT
if (std::smatch m; std::regex_match(target, m, std::regex{"(.*):(\\d+)$"})) {
port = std::stoi(m[2]);
target = m[1];
}

auto srouter = std::make_unique<session::router::SessionRouter>(std::filesystem::path{"jank.ini"});

std::promise<void> prom;
Expand Down Expand Up @@ -83,12 +90,12 @@ int main(int argc, char** argv)

srouter->establish_udp(
target,
12345,
[&prom, &start](auto udp_info) {
port,
[&prom, &start, &port](auto udp_info) {
std::cout
<< "\n\x1b[32;1mSession established ("
<< std::chrono::round<std::chrono::milliseconds>(std::chrono::steady_clock::now() - start).count()
<< "ms); UDP bound to port [::1]:" << udp_info.local_port << "\x1b[0m\n\n"
<< "ms); remote UDP port " << port << " bound to local port [::1]:" << udp_info.local_port << "\x1b[0m\n\n"
<< std::flush;
prom.set_value();
},
Expand Down Expand Up @@ -133,7 +140,7 @@ int main(int argc, char** argv)
<< " Ctrl-C -- shut down\x1b[0m\n\n\n";

/*
srouter.map_tcp_remote_port(std::string{argv[1]}, 12345,
srouter.map_tcp_remote_port(std::string{argv[1]}, port,
[&](auto tunnel_info) {
std::cout << "\n\nTCP bound to port " << tunnel_info.local_port << "\n\n";
},
Expand All @@ -151,12 +158,12 @@ int main(int argc, char** argv)
{
case SIGHUP:
std::cout << "\n\n\n\x1b[33;1mHangup signal received; closing UDP tunnel\x1b[0m\n\n\n";
srouter->close_udp(target, 12345);
srouter->close_udp(target, port);
break;
case SIGUSR1:
{
std::cout << "\n\n\n\x1b[32;1mSIGUSR1 received: (re-)opening UDP tunnel\x1b[0m\n";
auto ti = srouter->establish_udp(target, 12345);
auto ti = srouter->establish_udp(target, port);
std::cout << "\n\x1b[32;1mUDP bound to port " << ti.local_port << "\x1b[0m\n\n";
break;
}
Expand Down
2 changes: 1 addition & 1 deletion external/oxen-libquic