* Added 'get_d_ratio', 'view_list', 'get_d_tracker_focus',

'get_d_tracker_size', etc.

* Added tracker commands.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@945 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-07-29 16:59:34 +00:00
parent 1232cd44cb
commit ac92b56f37
19 changed files with 527 additions and 81 deletions
+17 -5
View File
@@ -137,12 +137,23 @@ apply_enable_trackers(int64_t arg) {
torrent::File*
xmlrpc_find_file(core::Download* download, uint32_t index) {
torrent::FileList* fileList = download->download()->file_list();
if (index >= fileList->size_files())
if (index >= download->file_list()->size_files())
return NULL;
return (*fileList)[index];
return (*download->file_list())[index];
}
// Ergh... time to update the Tracker API to allow proper ptrs.
torrent::Tracker*
xmlrpc_find_tracker(core::Download* download, uint32_t index) {
if (index >= download->tracker_list()->size())
return NULL;
// HACK ALERT!!!!
static torrent::Tracker hack;
hack = download->tracker_list()->get(index);
return &hack;
}
void
@@ -150,6 +161,7 @@ initialize_xmlrpc() {
rpc::xmlrpc.initialize();
rpc::xmlrpc.set_slot_find_download(rak::mem_fn(control->core()->download_list(), &core::DownloadList::find_hex_ptr));
rpc::xmlrpc.set_slot_find_file(rak::ptr_fn(&xmlrpc_find_file));
rpc::xmlrpc.set_slot_find_tracker(rak::ptr_fn(&xmlrpc_find_tracker));
unsigned int count = 0;
@@ -161,6 +173,7 @@ initialize_xmlrpc() {
case rpc::CommandMap::target_generic: rpc::xmlrpc.insert_command(itr->first, itr->second.m_parm, itr->second.m_doc, rpc::XmlRpc::call_generic); break;
case rpc::CommandMap::target_download: rpc::xmlrpc.insert_command(itr->first, itr->second.m_parm, itr->second.m_doc, rpc::XmlRpc::call_download); break;
case rpc::CommandMap::target_file: rpc::xmlrpc.insert_command(itr->first, itr->second.m_parm, itr->second.m_doc, rpc::XmlRpc::call_file); break;
case rpc::CommandMap::target_tracker: rpc::xmlrpc.insert_command(itr->first, itr->second.m_parm, itr->second.m_doc, rpc::XmlRpc::call_tracker); break;
default: throw torrent::internal_error("XMLRPC: Bad entry.");
}
@@ -252,7 +265,6 @@ apply_xmlrpc_dialect(const std::string& arg) {
void
initialize_command_network() {
// core::DownloadList* downloadList = control->core()->download_list();
torrent::ConnectionManager* cm = torrent::connection_manager();
core::CurlStack* httpStack = control->core()->get_poll_manager()->get_http_stack();