* Cache the current ceiling in rak::partial_queue.

* Added "enable_trackers=yes|no" option that can turn on/off the use
of trackers on all torrents.

* Cleanup of the API, including a new TrackerList class.

* When requesting from seeders, either continue a chunk another seeder
started or try a new one. This means seeders don't end up downloading
non-rare chunks.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@658 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-03-28 21:04:07 +00:00
parent a811f53301
commit 8ea6f78e21
10 changed files with 108 additions and 64 deletions
+8 -7
View File
@@ -45,6 +45,7 @@
#include <torrent/connection_manager.h>
#include <torrent/rate.h>
#include <torrent/tracker.h>
#include <torrent/tracker_list.h>
#include "core/download.h"
@@ -76,7 +77,7 @@ print_hhmmss(char* first, char* last, time_t t) {
char*
print_ddhhmm(char* first, char* last, time_t t) {
if (t / (24 * 3600) < 100)
return print_buffer(first, last, "%2i:%02i:%02i", (int)t / (24 * 3600), ((int)t / 3600) % 24, ((int)t / 60) % 60);
return print_buffer(first, last, "%2id %2i:%02i", (int)t / (24 * 3600), ((int)t / 3600) % 24, ((int)t / 60) % 60);
else
return print_buffer(first, last, "--:--:--");
}
@@ -158,13 +159,13 @@ print_download_status(char* first, char* last, core::Download* d) {
(d->get_download().chunks_hashed() * 100) / d->get_download().chunks_total());
else if (d->get_download().is_tracker_busy() &&
d->get_download().tracker_focus() < d->get_download().size_trackers())
first = print_buffer(first, last, "Tracker[%i:%i]: Connecting to %s",
d->get_download().tracker(d->get_download().tracker_focus()).group(),
d->get_download().tracker_focus(),
d->get_download().tracker(d->get_download().tracker_focus()).url().c_str());
d->get_download().tracker_list().focus() < d->get_download().tracker_list().size()) {
torrent::TrackerList tl = d->get_download().tracker_list();
else if (!d->get_message().empty())
first = print_buffer(first, last, "Tracker[%i:%i]: Connecting to %s",
tl.get(tl.focus()).group(), tl.focus(), tl.get(tl.focus()).url().c_str());
} else if (!d->get_message().empty())
first = print_buffer(first, last, "%s", d->get_message().c_str());
else