mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 13:12:32 +00:00
* Saves file priorities along with fast-resume data.
* Cleaned up the shutdown code, moved some unnessesary stuff out of the main loop. * Made a TrackerBase and an empty TrackerUdp class. The proper Tracker* class is selected based on the url. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@492 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+9
-11
@@ -69,7 +69,7 @@ Manager::initialize() {
|
||||
// opened or closed.
|
||||
m_downloadList.slot_map_insert().insert("0_initialize_bencode", sigc::mem_fun(*this, &Manager::initialize_bencode));
|
||||
m_downloadList.slot_map_insert().insert("1_connect_network_log", sigc::bind(sigc::ptr_fun(&connect_signal_network_log), sigc::mem_fun(m_logComplete, &Log::push_front)));
|
||||
m_downloadList.slot_map_insert().insert("4_store_save", sigc::mem_fun(m_downloadStore, &DownloadStore::save));
|
||||
//m_downloadList.slot_map_insert().insert("4_store_save", sigc::mem_fun(m_downloadStore, &DownloadStore::save));
|
||||
|
||||
m_downloadList.slot_map_erase().insert("1_hash_queue_remove", sigc::mem_fun(m_hashQueue, &HashQueue::remove));
|
||||
m_downloadList.slot_map_erase().insert("1_store_remove", sigc::mem_fun(m_downloadStore, &DownloadStore::remove));
|
||||
@@ -149,7 +149,7 @@ Manager::start(Download* d) {
|
||||
if (d->get_download().is_hash_checked())
|
||||
m_downloadList.start(d);
|
||||
else
|
||||
// This can cause infinit loops.
|
||||
// This can cause infinit loops?
|
||||
m_hashQueue.insert(d, sigc::bind(sigc::mem_fun(m_downloadList, &DownloadList::start), d));
|
||||
|
||||
} catch (torrent::local_error& e) {
|
||||
@@ -226,15 +226,13 @@ void
|
||||
Manager::initialize_bencode(Download* d) {
|
||||
torrent::Bencode& bencode = d->get_bencode();
|
||||
|
||||
// TODO: Check that stuff are the right type, like state etc.
|
||||
if (bencode.has_key("rtorrent") &&
|
||||
bencode["rtorrent"].is_map() &&
|
||||
bencode["rtorrent"].has_key("state") &&
|
||||
bencode["rtorrent"]["state"].is_string())
|
||||
return;
|
||||
|
||||
bencode.insert_key("rtorrent", torrent::Bencode(torrent::Bencode::TYPE_MAP));
|
||||
bencode["rtorrent"].insert_key("state", "started");
|
||||
if (!bencode.has_key("rtorrent") ||
|
||||
!bencode["rtorrent"].is_map())
|
||||
bencode.insert_key("rtorrent", torrent::Bencode(torrent::Bencode::TYPE_MAP));
|
||||
|
||||
if (!bencode["rtorrent"].has_key("state") ||
|
||||
!bencode["rtorrent"]["state"].is_string())
|
||||
bencode["rtorrent"].insert_key("state", "started");
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user