From a36da15c29a57f56e8cb3a9ea492803c5499ef11 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 23 Sep 2008 03:52:49 +0000 Subject: [PATCH] saves sequential download in fastresume data --- examples/client_test.cpp | 8 +++++++- src/torrent.cpp | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index d4659b487..41d0951bd 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1284,6 +1284,7 @@ int main(int ac, char* av[]) bool paused = h.is_paused(); bool auto_managed = h.is_auto_managed(); + bool sequential_download = h.is_sequential_download(); out << std::setw(13) << std::setiosflags(std::ios::left); if (!s.error.empty()) { @@ -1331,7 +1332,12 @@ int main(int ac, char* av[]) { progress_bar_color = "32"; // green } - out << " progress: " << esc("32") << s.total_done << esc("0") << " Bytes "; + if (sequential_download) + out << "sequential: "; + else + out << " progress: "; + + out << esc("32") << s.total_done << esc("0") << " Bytes "; out.precision(4); out.width(5); out.fill(' '); diff --git a/src/torrent.cpp b/src/torrent.cpp index 1c3a3a02e..55ebf42db 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2522,6 +2522,10 @@ namespace libtorrent int auto_managed_ = rd.dict_find_int_value("auto_managed", -1); if (auto_managed_ != -1) auto_managed(auto_managed_); + + int sequential_ = rd.dict_find_int_value("sequential_download", -1); + if (sequential_ != -1) set_sequential_download(sequential_); + if (rd.dict_find_int_value("paused")) pause(); lazy_entry const* trackers = rd.dict_find_list("trackers"); @@ -2580,6 +2584,8 @@ namespace libtorrent ret["num_seeds"] = seeds; ret["num_downloaders"] = downloaders; + + ret["sequential_download"] = m_sequential_download; const sha1_hash& info_hash = torrent_file().info_hash(); ret["info-hash"] = std::string((char*)info_hash.begin(), (char*)info_hash.end());