Address review feedback: explicit mark_safe whitelist and rpc trust flow

This commit is contained in:
Xirvik
2026-03-03 04:32:54 +00:00
committed by Jari Sundell
parent ba239bc8c5
commit d935e0ffe9
17 changed files with 807 additions and 560 deletions
+8 -13
View File
@@ -305,20 +305,15 @@ SCgiTask::receive_call(const char* buffer, uint32_t length) {
}
torrent::main_thread::thread()->callback_interrupt_polling(this, [buffer, length, result_callback, trusted, rpc_type]() {
rpc::RpcManager::set_trusted(trusted);
auto callback = [result_callback](const char* b, uint32_t l) {
result_callback(b, l);
return true;
};
try {
rpc.process(rpc_type, buffer, length,
[result_callback](const char* b, uint32_t l) {
result_callback(b, l);
return true;
});
} catch (...) {
rpc::RpcManager::set_trusted(true);
throw;
}
rpc::RpcManager::set_trusted(true);
if (trusted)
rpc.process(rpc_type, buffer, length, callback);
else
rpc.process_untrusted(rpc_type, buffer, length, callback);
});
}