* Removed Content and moved stuff to DownloadWrapper and FileList.

* Using a char buffer instead of std::string in
Handshake::prepare_key_plus_pad().


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@813 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-12-02 09:16:36 +00:00
parent c992fa60df
commit e4db1cacc2
10 changed files with 20 additions and 19 deletions
+2 -2
View File
@@ -181,7 +181,7 @@ print_download_status(char* first, char* last, core::Download* d) {
if (d->is_hash_checking()) {
first = print_buffer(first, last, "Checking hash [%2i%%]",
(d->download()->chunks_hashed() * 100) / d->download()->chunks_total());
(d->download()->chunks_hashed() * 100) / d->download()->file_list()->size_chunks());
} else if (d->tracker_list()->is_busy() && d->tracker_list()->focus() < d->tracker_list()->size()) {
torrent::TrackerList* tl = d->tracker_list();
@@ -220,7 +220,7 @@ print_download_percentage_done(char* first, char* last, core::Download* d) {
//return print_buffer(first, last, "[--%%]");
return print_buffer(first, last, " ");
else
return print_buffer(first, last, "[%2u%%]", (d->download()->chunks_done() * 100) / d->download()->chunks_total());
return print_buffer(first, last, "[%2u%%]", (d->download()->file_list()->completed_chunks() * 100) / d->download()->file_list()->size_chunks());
}
char*
+4 -4
View File
@@ -73,7 +73,7 @@ WindowDownloadChunksSeen::redraw() {
const uint8_t* seen = m_download->download()->chunks_seen();
if (seen == NULL || m_download->download()->bitfield()->empty()) {
if (seen == NULL || m_download->download()->file_list()->bitfield()->empty()) {
m_canvas->print(2, 2, "Not available.");
return;
}
@@ -88,9 +88,9 @@ WindowDownloadChunksSeen::redraw() {
*m_focus = std::min(*m_focus, max_focus());
const uint8_t* chunk = seen + *m_focus * chunks_per_row();
const uint8_t* last = seen + m_download->download()->chunks_total();
const uint8_t* last = seen + m_download->download()->file_list()->size_chunks();
const torrent::Bitfield* bitfield = m_download->download()->bitfield();
const torrent::Bitfield* bitfield = m_download->download()->file_list()->bitfield();
const torrent::TransferList* transfers = m_download->download()->transfer_list();
std::vector<torrent::BlockList*> transferChunks(transfers->size(), 0);
@@ -138,7 +138,7 @@ WindowDownloadChunksSeen::rows() const {
if (m_canvas->width() < 18)
return 0;
return (m_download->download()->chunks_total() + chunks_per_row() - 1) / chunks_per_row();
return (m_download->download()->file_list()->size_chunks() + chunks_per_row() - 1) / chunks_per_row();
}
}
+1 -1
View File
@@ -98,7 +98,7 @@ WindowFileList::redraw() {
Range range = rak::advance_bidirectional<unsigned int>(0, *m_focus, fl->size_files(), m_canvas->height() - pos);
while (range.first != range.second) {
torrent::File* e = fl->at_index(range.first);
torrent::File* e = *(fl->begin() + range.first);
std::string path = e->path()->as_string();
+2 -2
View File
@@ -91,7 +91,7 @@ WindowPeerList::redraw() {
m_list->end(),
m_canvas->height() - y);
if (m_download->download()->chunks_total() <= 0)
if (m_download->download()->file_list()->size_chunks() <= 0)
throw std::logic_error("WindowPeerList::redraw() m_slotChunksTotal() returned invalid value");
while (range.first != range.second) {
@@ -151,7 +151,7 @@ WindowPeerList::redraw() {
int
WindowPeerList::done_percentage(torrent::Peer& p) {
int chunks = m_download->download()->chunks_total();
int chunks = m_download->download()->file_list()->size_chunks();
return chunks ? (100 * p.chunks_done()) / chunks : 0;
}