* Moving download variables into command_download.cc.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@902 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-05-18 14:24:57 +00:00
parent 9fe72cb3b5
commit 7d1bb524ba
14 changed files with 243 additions and 175 deletions
+6 -6
View File
@@ -168,7 +168,7 @@ Manager::handshake_log(const sockaddr* sa, int msg, int err, const torrent::Hash
// Hmm... find some better place for all this.
void
Manager::delete_tied(Download* download) {
const std::string& tie = download->get_string("tied_to_file");
const std::string& tie = download->get_string("get_tied_to_file");
// This should be configurable, need to wait for the variable
// thingie to be implemented.
@@ -178,7 +178,7 @@ Manager::delete_tied(Download* download) {
if (::unlink(rak::path_expand(tie).c_str()) == -1)
push_log("Could not unlink tied file: " + std::string(rak::error_number::current().c_str()));
download->set("tied_to_file", std::string());
download->set("set_tied_to_file", std::string());
}
Manager::Manager() :
@@ -482,7 +482,7 @@ Manager::try_create_download_expand(const std::string& uri, bool start, bool pri
if (tied)
for (std::vector<std::string>::iterator itr = paths.begin(); itr != paths.end(); )
if (std::find_if(m_downloadList->begin(), m_downloadList->end(), rak::equal(*itr, rak::bind2nd(std::mem_fun(&Download::get_string), "tied_to_file")))
if (std::find_if(m_downloadList->begin(), m_downloadList->end(), rak::equal(*itr, rak::bind2nd(std::mem_fun(&Download::get_string), "get_tied_to_file")))
!= m_downloadList->end())
itr = paths.erase(itr);
else
@@ -514,7 +514,7 @@ Manager::receive_hashing_changed() {
continue;
bool tryQuick =
(*itr)->get_value("hashing") == Download::variable_hashing_initial &&
(*itr)->get_value("get_hashing") == Download::variable_hashing_initial &&
(*itr)->download()->file_list()->bitfield()->empty();
if (!tryQuick && foundHashing)
@@ -537,7 +537,7 @@ Manager::receive_hashing_changed() {
(*itr)->download()->hash_stop();
if (foundHashing) {
(*itr)->set_value("hashing", Download::variable_hashing_rehash);
(*itr)->set_value("set_hashing", Download::variable_hashing_rehash);
continue;
}
}
@@ -548,7 +548,7 @@ Manager::receive_hashing_changed() {
} catch (torrent::local_error& e) {
if (tryQuick) {
// Make sure we don't repeat the quick hashing.
(*itr)->set_value("hashing", Download::variable_hashing_rehash);
(*itr)->set_value("set_hashing", Download::variable_hashing_rehash);
} else {
(*itr)->set_hash_failed(true);