fast piece optimization
This commit is contained in:
@@ -105,6 +105,7 @@
|
||||
* added info_hash to torrent_deleted_alert
|
||||
* improved LSD performance and made the interval configurable
|
||||
* improved UDP tracker support by caching connect tokens
|
||||
* fast piece optimization
|
||||
* fixed issue with disk read cache not being cleared when removing torrents
|
||||
|
||||
release 0.14.9
|
||||
|
@@ -559,6 +559,15 @@ namespace libtorrent
|
||||
return;
|
||||
}
|
||||
|
||||
if (upload_only())
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " *** SKIPPING ALLOWED SET BECAUSE PEER IS UPLOAD ONLY\n";
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
int num_allowed_pieces = m_ses.settings().allowed_fast_set_size;
|
||||
if (num_allowed_pieces == 0) return;
|
||||
|
||||
@@ -571,6 +580,10 @@ namespace libtorrent
|
||||
// an allowed fast message for every single piece
|
||||
for (int i = 0; i < num_pieces; ++i)
|
||||
{
|
||||
// there's no point in offering fast pieces
|
||||
// that the peer already has
|
||||
if (has_piece(i)) continue;
|
||||
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " ==> ALLOWED_FAST [ " << i << " ]\n";
|
||||
|
Reference in New Issue
Block a user