Replace the v2 blacklist approach with a per-command flag system.
Commands must opt in to being available for untrusted connections
via flag_untrusted_safe (0x400), checked in call_command() which
catches all execution paths including nested commands.
Infrastructure changes:
- Add flag_untrusted_safe to CommandMap
- Add untrusted_error exception type for proper error codes
- Enforce trust check in both call_command() overloads
- Add catch blocks in xmlrpc_c, xmlrpc_tinyxml2, and jsonrpc handlers
- Port SCGI trust state management from v2 (thread_local, header parsing)
- Add _U macro variants in command_helpers.h for safe command registration
- Add CMD2_VAR_*_U and CMD2_VAR_*_U_GET variants for variables
Inline nlohmann/json for the JSON parsing itself, and handle requests
with the same SCGI interface as XML-RPC.
Based off the work in https://github.com/jesec/rtorrent
* Redirects can now be made efficiently using rpc::CommandMap::create_redirect or "methods.redirect=new_key,dest_key".
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1155 e378c898-3ddf-0310-93e7-cc216c733640
ensure resource usage gets spread out over time.
* Changed element_file_list.cc to use te_command.
* File commands on file list iterators will be called on the File
pointed to.
* Fixed some sigc++ 2.1 compile errors.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@992 e378c898-3ddf-0310-93e7-cc216c733640
* Moved most of src/ui/download.cc to use commands for TextElements.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@967 e378c898-3ddf-0310-93e7-cc216c733640
* Cleaned up duplicate code in 'xmlrpc.cc'.
* Cleaned up 'parse_commands.h'.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@966 e378c898-3ddf-0310-93e7-cc216c733640
* Added framework for commands on peers, but due to deficiencies in
the libtorrent API it won't be enabled yet.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@955 e378c898-3ddf-0310-93e7-cc216c733640
* CommandMap::call_command(...) now uses a single function for all
calls using an integer id to figure out the object type.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@942 e378c898-3ddf-0310-93e7-cc216c733640
xmlrpc command takes the download info-hash and the file index as the
first two parameters.
* Added several file commands.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@937 e378c898-3ddf-0310-93e7-cc216c733640
* Added support for writing Objects to generic char* buffers.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@927 e378c898-3ddf-0310-93e7-cc216c733640