* 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
+7 -7
View File
@@ -102,7 +102,7 @@ apply_stop_on_ratio(const torrent::Object& rawArgs) {
if ((totalUpload >= minUpload && totalUpload * 100 >= totalDone * minRatio) ||
(maxRatio > 0 && totalUpload * 100 > totalDone * maxRatio)) {
downloadList->stop_try(*itr);
(*itr)->set("ignore_commands", (int64_t)1);
(*itr)->set("set_ignore_commands", (int64_t)1);
}
++itr;
@@ -114,11 +114,11 @@ apply_stop_on_ratio(const torrent::Object& rawArgs) {
torrent::Object
apply_start_tied() {
for (core::DownloadList::iterator itr = control->core()->download_list()->begin(); itr != control->core()->download_list()->end(); ++itr) {
if ((*itr)->get_value("state") == 1)
if ((*itr)->get_value("get_state") == 1)
continue;
rak::file_stat fs;
const std::string& tiedToFile = (*itr)->get_string("tied_to_file");
const std::string& tiedToFile = (*itr)->get_string("get_tied_to_file");
if (!tiedToFile.empty() && fs.update(rak::path_expand(tiedToFile)))
control->core()->download_list()->start_try(*itr);
@@ -130,11 +130,11 @@ apply_start_tied() {
torrent::Object
apply_stop_untied() {
for (core::DownloadList::iterator itr = control->core()->download_list()->begin(); itr != control->core()->download_list()->end(); ++itr) {
if ((*itr)->get_value("state") == 0)
if ((*itr)->get_value("get_state") == 0)
continue;
rak::file_stat fs;
const std::string& tiedToFile = (*itr)->get_string("tied_to_file");
const std::string& tiedToFile = (*itr)->get_string("get_tied_to_file");
if (!tiedToFile.empty() && !fs.update(rak::path_expand(tiedToFile)))
control->core()->download_list()->stop_try(*itr);
@@ -147,7 +147,7 @@ torrent::Object
apply_close_untied() {
for (core::DownloadList::iterator itr = control->core()->download_list()->begin(); itr != control->core()->download_list()->end(); ++itr) {
rak::file_stat fs;
const std::string& tiedToFile = (*itr)->get_string("tied_to_file");
const std::string& tiedToFile = (*itr)->get_string("get_tied_to_file");
if (!tiedToFile.empty() && !fs.update(rak::path_expand(tiedToFile)) && control->core()->download_list()->stop_try(*itr))
control->core()->download_list()->close(*itr);
@@ -160,7 +160,7 @@ torrent::Object
apply_remove_untied() {
for (core::DownloadList::iterator itr = control->core()->download_list()->begin(); itr != control->core()->download_list()->end(); ) {
rak::file_stat fs;
const std::string& tiedToFile = (*itr)->get_string("tied_to_file");
const std::string& tiedToFile = (*itr)->get_string("get_tied_to_file");
if (!tiedToFile.empty() && !fs.update(rak::path_expand(tiedToFile)) && control->core()->download_list()->stop_try(*itr))
itr = control->core()->download_list()->erase(itr);