mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 04:02:30 +00:00
* Added missing <cstdio> and <string> headers.
* Added 'd.wanted_chunks' command. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1259 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <rak/address_info.h>
|
||||
#include <torrent/throttle.h>
|
||||
#include <torrent/rate.h>
|
||||
|
||||
@@ -388,9 +388,8 @@ DownloadFactory::initialize_rtorrent(Download* download, torrent::Object* rtorre
|
||||
if (rtorrent->has_key_value("total_uploaded"))
|
||||
download->info()->mutable_up_rate()->set_total(rtorrent->get_key_value("total_uploaded"));
|
||||
|
||||
if (rtorrent->has_key_value("chunks_done"))
|
||||
download->download()->set_chunks_done(std::min<uint32_t>(rtorrent->get_key_value("chunks_done"),
|
||||
download->download()->file_list()->size_chunks()));
|
||||
if (rtorrent->has_key_value("chunks_done") && rtorrent->has_key_value("chunks_wanted"))
|
||||
download->download()->set_chunks_done(rtorrent->get_key_value("chunks_done"), rtorrent->get_key_value("chunks_wanted"));
|
||||
|
||||
download->set_throttle_name(rtorrent->has_key_string("throttle_name")
|
||||
? rtorrent->get_key_string("throttle_name")
|
||||
|
||||
@@ -137,7 +137,8 @@ DownloadStore::save(Download* d, int flags) {
|
||||
torrent::Object* rtorrent_base = &d->download()->bencode()->get_key("rtorrent");
|
||||
|
||||
// Move this somewhere else?
|
||||
rtorrent_base->insert_key("chunks_done", d->download()->file_list()->completed_chunks());
|
||||
rtorrent_base->insert_key("chunks_done", d->download()->file_list()->completed_chunks());
|
||||
rtorrent_base->insert_key("chunks_wanted", d->download()->data()->wanted_chunks());
|
||||
rtorrent_base->insert_key("total_uploaded", d->info()->up_rate()->total());
|
||||
|
||||
// Don't save for completed torrents when we've cleared the uncertain_pieces.
|
||||
|
||||
Reference in New Issue
Block a user