mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 20:22:31 +00:00
Adding hash check queue.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@278 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+17
-4
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user