* Set "stopped" stated to newly added torrents, so they stay stopped

when restarting the client.

* Renamed Bencode::operator[] to Bencode::get_key.

* Added progress percentage for hash checking.

* Correctly update the delegator priority when loading resume data
with file priorities.

* Don't allow file names with '\0' in them.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@597 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-11-16 20:46:13 +00:00
parent e8deac9f79
commit cbbad78b6a
5 changed files with 9 additions and 132 deletions
+6 -6
View File
@@ -176,7 +176,7 @@ Manager::erase(DListItr itr) {
void
Manager::start(Download* d) {
try {
d->get_bencode()["rtorrent"]["state"] = "started";
d->get_bencode().get_key("rtorrent").get_key("state") = "started";
if (d->get_download().is_active())
return;
@@ -199,7 +199,7 @@ Manager::start(Download* d) {
void
Manager::stop(Download* d) {
try {
d->get_bencode()["rtorrent"]["state"] = "stopped";
d->get_bencode().get_key("rtorrent").get_key("state") = "stopped";
m_downloadList.stop(d);
@@ -265,12 +265,12 @@ Manager::initialize_bencode(Download* d) {
torrent::Bencode& bencode = d->get_bencode();
if (!bencode.has_key("rtorrent") ||
!bencode["rtorrent"].is_map())
!bencode.get_key("rtorrent").is_map())
bencode.insert_key("rtorrent", torrent::Bencode(torrent::Bencode::TYPE_MAP));
if (!bencode["rtorrent"].has_key("state") ||
!bencode["rtorrent"]["state"].is_string())
bencode["rtorrent"].insert_key("state", "started");
if (!bencode.get_key("rtorrent").has_key("state") ||
!bencode.get_key("rtorrent").get_key("state").is_string())
bencode.get_key("rtorrent").insert_key("state", "stopped");
}
void