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 b60389430..40898c44e 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..347f01c80 100755 --- a/libtorrent/src/storage.cpp +++ b/libtorrent/src/storage.cpp @@ -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