lt sync 2047

This commit is contained in:
Marcos Pinto 2008-03-10 01:24:05 +00:00
parent b5ff8eb29f
commit 7fbfbbc49c
3 changed files with 4 additions and 6 deletions

View File

@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
#if defined TORRENT_BSD || defined TORRENT_LINUX
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
#elif defined TORRENT_WINDOWS

View File

@ -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;

View File

@ -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<int>::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