From 40875769055cf84b8ab4ea3ed082f8aaf93974c2 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 8 Mar 2008 23:38:26 +0000 Subject: [PATCH] lt sync 2049 --- libtorrent/src/enum_net.cpp | 1 + libtorrent/src/policy.cpp | 5 +---- libtorrent/src/storage.cpp | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libtorrent/src/enum_net.cpp b/libtorrent/src/enum_net.cpp index 5431b7c53..ec3238d52 100644 --- a/libtorrent/src/enum_net.cpp +++ b/libtorrent/src/enum_net.cpp @@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. #if defined TORRENT_BSD || defined TORRENT_LINUX #include +#include #include #include #elif defined TORRENT_WINDOWS diff --git a/libtorrent/src/policy.cpp b/libtorrent/src/policy.cpp index 4f3f8cfa4..c577371d8 100755 --- a/libtorrent/src/policy.cpp +++ b/libtorrent/src/policy.cpp @@ -502,10 +502,7 @@ namespace libtorrent = transferred_amount / (connected_time_in_seconds + 1); // prefer to disconnect uninteresting peers, and secondly slow peers - if (transfer_rate <= slowest_transfer_rate - || (disconnect_peer != m_peers.end() - && disconnect_peer->second.connection->is_interesting() - && !c->is_interesting())) + if (transfer_rate <= slowest_transfer_rate) { slowest_transfer_rate = transfer_rate; disconnect_peer = i; diff --git a/libtorrent/src/storage.cpp b/libtorrent/src/storage.cpp index 69701f734..196ffae3e 100755 --- a/libtorrent/src/storage.cpp +++ b/libtorrent/src/storage.cpp @@ -583,7 +583,7 @@ namespace libtorrent for (torrent_info::file_iterator i = m_info->begin_files(true) , end(m_info->end_files(true)); i != end; ++i, ++fs) { - std::cerr << "filesize: " << i->size << std::endl; + //std::cerr << "filesize: " << i->size << std::endl; if (i->size != fs->first) { error = "file size for '" + i->path.native_file_string() @@ -1150,14 +1150,14 @@ namespace libtorrent for (last = m_slot_to_piece.rbegin(); last != m_slot_to_piece.rend(); ++last) { - if (*last != unallocated && have[*last]) break; + if (*last != unallocated) break; } for (std::vector::const_iterator i = m_slot_to_piece.begin(); i != last.base(); ++i) { - p.push_back((*i >= 0 && have[*i]) ? *i : unassigned); + p.push_back((*i >= 0) ? *i : unassigned); } } else