Compare commits

...

9 Commits

Author SHA1 Message Date
rakshasa bf1265d954 Stuff. 2026-08-09 10:44:29 +02:00
rakshasa 6c3c77a2b7 Stuff. 2026-08-07 11:58:33 +02:00
rakshasa 120fcb0273 Merge branch 'master' into feature/ipc-worker 2026-08-06 11:03:44 +02:00
rakshasa dd3ddf7c39 Tagged release 0.16.20. 2026-08-06 10:12:49 +02:00
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
10 changed files with 27 additions and 23 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ jobs:
# 2. Check for multiple consecutive blank lines
# This regex looks for 2 or more empty lines anywhere in the message
if echo "$CLEAN_MSG" | grep -pz '(\r?\n){3,}'; then
if echo "$CLEAN_MSG" | grep -Pz '(\r?\n){3,}'; then
echo "❌ Error: Commit message contains multiple consecutive line breaks."
echo " Commit: '$SUBJECT'"
FAILED=1
+3 -3
View File
@@ -1,6 +1,6 @@
m4_pattern_allow([PKG_CHECK_EXISTS])
AC_INIT([rtorrent],[0.16.19],[sundell.software@gmail.com])
AC_INIT([rtorrent],[0.16.20],[sundell.software@gmail.com])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([scripts])
@@ -14,7 +14,7 @@ AX_CXX_COMPILE_STDCXX(20, noext, mandatory)
PKG_PROG_PKG_CONFIG
AC_DEFINE([API_VERSION], [24], [api version])
AC_DEFINE([API_VERSION], [25], [api version])
RAK_CHECK_CFLAGS
RAK_CHECK_CXXFLAGS
@@ -47,7 +47,7 @@ fi
PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"])
PKG_CHECK_MODULES([ZLIB], [zlib])
PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.19])
PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.20])
AC_LANG_PUSH(C++)
TORRENT_WITH_XMLRPC_C
+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
+9 -8
View File
@@ -112,8 +112,9 @@ 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([argc, argv]() {
parse_config_file(argc, argv, [](auto& path) { parse_config_file_comments("worker", path); });
});
// Block SIGCHLD until all threads are created, then unblock on main-thread, to avoid SIGCHLD
// interrupting other threads.
@@ -136,12 +137,10 @@ main(int argc, char** argv) {
// # do:log.open_file=system,/usr/rakshasa/system.log
// # do:log.add_output=system,system
//
parse_config_file(argc, argv, [](auto& path) {
if (path.empty())
return;
parse_config_file_comments(path);
});
// # do-worker:log.open_file=system,/usr/rakshasa/system-worker.log
// # do-worker:log.add_output=system,system
//
parse_config_file(argc, argv, [](auto& path) { parse_config_file_comments("", path); });
control = new Control;
@@ -164,6 +163,8 @@ main(int argc, char** argv) {
torrent::initialize();
torrent::main_thread::set_client_callback(&client_perform);
torrent::runtime::initialize_worker_process();
scgi::ThreadScgi::create_thread();
session::ThreadSession::create_thread();
+1 -1
View File
@@ -108,6 +108,6 @@ OptionParser::call_int_pair(slot_int_pair slot, const std::string& arg) {
if (a < 0 || b < 0)
throw std::runtime_error("Invalid argument, \"" + arg + "\" should be positive numbers");
slot(a, b);
}
+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);
+7 -3
View File
@@ -108,18 +108,22 @@ config_comment_log(const std::string& command, const std::string& raw_args) {
throw torrent::input_error("Unknown log command: " + command);
}
// Call special commands in the format "# do:command=args" in the config file.
// Call special commands in the format "# do:command=args" or "# do-<category>:command=args" in the config file.
void
parse_config_file_comments(const std::string& path) {
parse_config_file_comments(const std::string& category, const std::string& path) {
if (path.empty())
return;
std::fstream file(path, std::ios::in);
if (!file.is_open())
return;
std::string line;
std::string prefix = category.empty() ? "# do:" : "# do-" + category + ":";
while (std::getline(file, line)) {
if (line.size() <= 5 || line.compare(0, 5, "# do:") != 0)
if (line.size() <= prefix.size() || line.compare(0, prefix.size(), prefix) != 0)
continue;
auto equal_pos = line.find('=');
+1 -1
View File
@@ -6,7 +6,7 @@
int parse_main_options(int argc, char** argv);
void parse_config_file(int argc, char** argv, std::function<void (const std::string&)> parse_fn);
void parse_config_file_comments(const std::string& path);
void parse_config_file_comments(const std::string& category, const std::string& path);
void load_session_torrents(const std::string& path);
void load_arg_torrents(char** first, char** last);
+2
View File
@@ -18,6 +18,8 @@ public:
void wait_for(uint32_t max_remaining);
// TODO: Add a signal handler to tell the worker thread to wake up. Use a counter to batch wakeups.
private:
WaitpidQueue(const WaitpidQueue&) = delete;
WaitpidQueue& operator=(const WaitpidQueue&) = delete;