mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 13:42:30 +00:00
Address review feedback: explicit mark_safe whitelist and rpc trust flow
This commit is contained in:
+8
-13
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user