* Renamed TrackerInfo to DownloadInfo, moved it to DownloadMain and

cleaned up DownloadWrapper etc.

* Resume total upload from the client rather than
torrent::Download::hash_resume_load(...).

* Show client names and versions. (incomplete)


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@646 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-03-01 20:48:54 +00:00
parent c77ecb034f
commit b00d083ac2
11 changed files with 393 additions and 62 deletions
+6 -7
View File
@@ -42,6 +42,7 @@
#include <rak/path.h>
#include <torrent/bencode.h>
#include <torrent/exceptions.h>
#include <torrent/rate.h>
#include "utils/variable_generic.h"
@@ -189,14 +190,12 @@ DownloadFactory::receive_success() {
if (control->variables()->get_string("use_udp_trackers") == "no")
(*itr)->enable_udp_trackers(false);
// Move some of this to "rtorrent".
if (root.has_key("libtorrent resume")) {
torrent::Bencode& libtorrent = root.get_key("libtorrent resume");
if (control->variables()->get_string("upload_total_clear") == "yes")
libtorrent.erase_key("total_uploaded");
}
if (control->variables()->get_string("upload_total_clear") == "yes")
rtorrent.erase_key("total_uploaded");
else if (rtorrent.has_key("total_uploaded") && rtorrent.get_key("total_uploaded").is_value())
(*itr)->get_download().up_rate()->set_total(rtorrent.get_key("total_uploaded").as_value());
if (m_session) {
if (!rtorrent.has_key("directory") ||
!rtorrent.get_key("directory").is_string())
+4
View File
@@ -46,6 +46,7 @@
#include <torrent/bencode.h>
#include <torrent/exceptions.h>
#include <torrent/torrent.h>
#include <torrent/rate.h>
#include "download.h"
#include "download_store.h"
@@ -98,6 +99,9 @@ DownloadStore::save(Download* d) {
if (!f.is_open())
return;
// Move this somewhere else.
d->get_bencode().get_key("rtorrent").insert_key("total_uploaded", d->get_download().up_rate()->total());
f << d->get_bencode();
if (!f.good())