Adding hash check queue.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@278 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-02-15 15:37:06 +00:00
parent ce4c09c143
commit f348196f2e
9 changed files with 160 additions and 22 deletions
+17 -4
View File
@@ -19,6 +19,21 @@ Manager::insert(const std::string& uri) {
create_http(uri);
}
void
Manager::start(Download* d) {
if (d->get_download().is_active())
return;
if (d->get_download().is_open()) {
d->start();
} else {
d->open();
m_hashQueue.insert(d, sigc::mem_fun(*d, &Download::start));
}
}
void
Manager::create_file(const std::string& uri) {
DownloadList::iterator itr = m_downloadList.end();
@@ -28,8 +43,7 @@ Manager::create_file(const std::string& uri) {
itr = m_downloadList.insert(&f);
itr->open();
itr->hash_check();
start(&*itr);
} catch (torrent::local_error& e) {
// What to do? Keep in list for now.
@@ -51,8 +65,7 @@ Manager::receive_http_done(torrent::Http* http) {
try {
itr = m_downloadList.insert(http->get_stream());
itr->open();
itr->hash_check();
start(&*itr);
} catch (torrent::local_error& e) {
// What to do? Keep in list for now.