Compare commits

..

5 Commits

Author SHA1 Message Date
rakshasa c36956813d Merge branch 'master' into feature/ipc-worker 2026-08-04 18:00:04 +02:00
rakshasa 05563b4c9b Stuff. 2026-07-28 10:56:25 +02:00
rakshasa a544f8ad68 Merge branch 'master' into feature/ipc-worker 2026-07-28 10:33:57 +02:00
rakshasa b35413ea71 Merge branch 'master' into feature/ipc-worker 2026-07-26 13:03:33 +02:00
rakshasa f9f19fb041 Stuff. 2026-07-26 09:14:39 +02:00
6 changed files with 10 additions and 21 deletions
+2 -10
View File
@@ -243,8 +243,6 @@ initialize_command_local() {
CMD_ANY ("system.sockets.max_size", [](auto, auto) { return torrent::runtime::socket_manager()->max_size(); });
CMD_ANY_VALUE_V ("system.sockets.max_size.set", [](auto, auto& value) { return torrent::runtime::socket_manager()->set_max_size_and_adjust(value); });
CMD_ANY_V ("system.sockets.adjust_alloc", [](auto, auto) { torrent::runtime::socket_manager()->adjust_allocation(); });
CMD_ANY ("system.sockets.reserved_alloc", [](auto, auto) { return torrent::runtime::socket_manager()->reserved_allocation(); });
CMD_ANY ("system.sockets.available_alloc", [](auto, auto) { return torrent::runtime::socket_manager()->available_allocation(); });
for (uint32_t i = 0; i < torrent::runtime::SocketManager::category_count; ++i) {
auto category = static_cast<torrent::runtime::socket_manager_category_t>(i);
@@ -253,10 +251,8 @@ initialize_command_local() {
CMD_ANY (category_name + ".size", [category](auto, auto) { return torrent::runtime::socket_manager()->category_managed_size(category); });
CMD_ANY (category_name + ".max_size", [category](auto, auto) { return torrent::runtime::socket_manager()->category_max_size(category); });
if (i == 0) {
CMD_ANY (category_name + ".min_alloc", [](auto, auto) { return torrent::runtime::socket_manager()->generic_min_allocation(); });
if (i == 0)
continue;
}
CMD_ANY (category_name + ".min_alloc", [category](auto, auto) { return torrent::runtime::socket_manager()->category_min_allocation(category); });
CMD_ANY (category_name + ".max_alloc", [category](auto, auto) { return torrent::runtime::socket_manager()->category_max_allocation(category); });
@@ -352,8 +348,6 @@ initialize_command_local() {
rpc::rpc.mark_safe("system.sockets.size");
rpc::rpc.mark_safe("system.sockets.max_size");
rpc::rpc.mark_safe("system.sockets.reserved_alloc");
rpc::rpc.mark_safe("system.sockets.available_alloc");
for (uint32_t i = 0; i < torrent::runtime::SocketManager::category_count; ++i) {
auto category_name = "system.sockets." + torrent::option_to_str_or_throw(torrent::OPTION_SOCKET_CATEGORY, i);
@@ -361,10 +355,8 @@ initialize_command_local() {
rpc::rpc.mark_safe(category_name + ".size");
rpc::rpc.mark_safe(category_name + ".max_size");
if (i == 0) {
rpc::rpc.mark_safe(category_name + ".min_alloc");
if (i == 0)
continue;
}
rpc::rpc.mark_safe(category_name + ".min_alloc");
rpc::rpc.mark_safe(category_name + ".max_alloc");
+1 -2
View File
@@ -11,8 +11,7 @@ namespace input {
void
InputEvent::insert() {
torrent::this_thread::poll()->open(this);
torrent::this_thread::poll()->insert_read(this);
torrent::this_thread::poll()->open_and_insert_read(this);
}
void
+4 -4
View File
@@ -112,8 +112,7 @@ main(int argc, char** argv) {
torrent::log_initialize();
// TODO: Create a fake thread object for initializing other processes and enabling logging.
torrent::initialize_main_thread();
torrent::runtime::initialize_worker_process_and_main_thread();
// Block SIGCHLD until all threads are created, then unblock on main-thread, to avoid SIGCHLD
// interrupting other threads.
@@ -392,12 +391,13 @@ main(int argc, char** argv) {
CMD_REDIRECT("bind", "network.bind_address.set");
CMD_REDIRECT("ip", "network.local_address.set");
CMD_REDIRECT("port_range", "network.port_range.set");
// TODO: Check if dht is on by default.
CMD_REDIRECT("dht", "dht.mode.set");
CMD_REDIRECT("port_random", "network.listen.port.random.set");
CMD_REDIRECT("proxy_address", "network.proxy.http.set");
CMD_REDIRECT("port_random", "network.port_random.set");
CMD_REDIRECT("proxy_address", "network.proxy_address.set");
CMD_REDIRECT("key_layout", "keys.layout.set");
+1 -2
View File
@@ -109,8 +109,7 @@ void
SCgi::activate() {
assert(torrent::this_thread::thread() == scgi_thread::thread());
torrent::this_thread::poll()->open(this);
torrent::this_thread::poll()->insert_read(this);
torrent::this_thread::poll()->open_and_insert_read(this);
}
// TODO: This should close the fd to avoid reuse.
+1 -2
View File
@@ -47,8 +47,7 @@ SCgiTask::open(SCgi* parent, int fd) {
// m_trusted=false into the next reuse, given that the
// UNTRUSTED_CONNECTION=0 parse branch is a no-op.
torrent::this_thread::poll()->open(this);
torrent::this_thread::poll()->insert_read(this);
torrent::this_thread::poll()->open_and_insert_read(this);
auto lock = std::lock_guard<std::mutex>(m_result_mutex);
+1 -1
View File
@@ -45,8 +45,8 @@ TestCommandLocal::test_socket_category_commands() {
CPPUNIT_ASSERT(rpc::commands.has(name + ".size"));
CPPUNIT_ASSERT(rpc::commands.has(name + ".max_size"));
CPPUNIT_ASSERT(rpc::commands.has(name + ".min_alloc"));
CPPUNIT_ASSERT_EQUAL(has_allocation, rpc::commands.has(name + ".min_alloc"));
CPPUNIT_ASSERT_EQUAL(has_allocation, rpc::commands.has(name + ".max_alloc"));
CPPUNIT_ASSERT_EQUAL(has_allocation, rpc::commands.has(name + ".min_alloc.set"));
CPPUNIT_ASSERT_EQUAL(has_allocation, rpc::commands.has(name + ".max_alloc.set"));