mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 03:32:29 +00:00
Fixed uninitialized rpc slots when SCGI is not used.
This commit is contained in:
@@ -27,7 +27,7 @@ CommandMap::insert(const key_type& key, int flags, const char* parm, const char*
|
||||
throw torrent::internal_error("CommandMap::insert(...) tried to insert an already existing key.");
|
||||
|
||||
// TODO: This is not honoring the public_xmlrpc flags!!!
|
||||
if (rpc::rpc.is_initialized() && (flags & flag_public_rpc))
|
||||
if (rpc::rpc.is_handlers_initialized() && (flags & flag_public_rpc))
|
||||
rpc::rpc.insert_command(key.c_str(), parm, doc);
|
||||
|
||||
return base_type::insert(itr, value_type(key, command_map_data_type(flags, parm, doc)));
|
||||
@@ -55,10 +55,10 @@ CommandMap::create_redirect(const key_type& key_new, const key_type& key_dest, i
|
||||
|
||||
if (dest_itr == base_type::end())
|
||||
throw torrent::input_error("Tried to redirect to a key that doesn't exist: '" + std::string(key_dest) + "'.");
|
||||
|
||||
|
||||
if (new_itr != base_type::end())
|
||||
throw torrent::input_error("Tried to create a redirect key that already exists: '" + std::string(key_new) + "'.");
|
||||
|
||||
|
||||
if (dest_itr->second.m_flags & flag_is_redirect)
|
||||
throw torrent::input_error("Tried to redirect to a key that is not marked 'flag_is_redirect': '" +
|
||||
std::string(key_dest) + "'.");
|
||||
@@ -68,7 +68,7 @@ CommandMap::create_redirect(const key_type& key_new, const key_type& key_dest, i
|
||||
flags |= dest_itr->second.m_flags & ~(flag_has_redirects | flag_public_rpc);
|
||||
|
||||
// TODO: This is not honoring the public_xmlrpc flags!!!
|
||||
if (rpc::rpc.is_initialized() && (flags & flag_public_rpc))
|
||||
if (rpc::rpc.is_handlers_initialized() && (flags & flag_public_rpc))
|
||||
rpc::rpc.insert_command(key_new.c_str(), dest_itr->second.m_parm, dest_itr->second.m_doc);
|
||||
|
||||
iterator itr = base_type::insert(base_type::end(),
|
||||
|
||||
Reference in New Issue
Block a user