* Made rpc::CommandSlot into a template class and removed

"command_*_slot.{cc,h}".

* Added 'if' command. 


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@971 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-09-02 15:07:37 +00:00
parent ac2f5a8882
commit 1cc1374c7a
23 changed files with 467 additions and 1701 deletions
+4 -4
View File
@@ -147,8 +147,8 @@ CommandMap::call_command(key_type key, const mapped_type& arg, target_type targe
if (itr == base_type::end())
throw torrent::input_error("Command \"" + std::string(key) + "\" does not exist.");
if ((itr->second.m_target != target.first && itr->second.m_target != target_generic) ||
(itr->second.m_target != target_generic && target.second == NULL))
if ((itr->second.m_target != target.first && itr->second.m_target > target_any) ||
(target.second == NULL && itr->second.m_target != target_generic && !(itr->second.m_target == target_any && target.first == target_generic)))
throw torrent::input_error("Command type mis-match.");
// This _should_ be optimized int just two calls.
@@ -166,8 +166,8 @@ CommandMap::call_command(key_type key, const mapped_type& arg, target_type targe
const CommandMap::mapped_type
CommandMap::call_command(const_iterator itr, const mapped_type& arg, target_type target) {
if ((itr->second.m_target != target.first && itr->second.m_target != target_generic) ||
(itr->second.m_target != target_generic && target.second == NULL))
if ((itr->second.m_target != target.first && itr->second.m_target > target_any) ||
(target.second == NULL && itr->second.m_target != target_generic && !(itr->second.m_target == target_any && target.first == target_generic)))
throw torrent::input_error("Command type mis-match.");
// This _should_ be optimized int just two calls.