forked from premiere/premiere-libtorrent
counts newly started torrents as active up to 2 minutes, to give them a chance to start downloading. Active torrents are not considered slow in the auto manager.
This commit is contained in:
parent
acdcb262af
commit
1092c558e4
|
@ -2981,6 +2981,9 @@ that will be sent to the tracker. The user-agent is a good way to identify your
|
|||
int max_peerlist_size;
|
||||
|
||||
int min_announce_interval;
|
||||
|
||||
bool prioritize_partial_pieces;
|
||||
int auto_manage_startup;
|
||||
};
|
||||
|
||||
``user_agent`` this is the client identification to the tracker.
|
||||
|
@ -3252,6 +3255,16 @@ for a tracker. This is specified in seconds, defaults to 5 minutes and
|
|||
is used as a sanity check on what is returned from a tracker. It
|
||||
mitigates hammering misconfigured trackers.
|
||||
|
||||
If ``prioritize_partial_pieces`` is true, partial pieces are picked
|
||||
before pieces that are more rare. If false, rare pieces are always
|
||||
prioritized, unless the number of partial pieces is growing out of
|
||||
proportion.
|
||||
|
||||
``auto_manage_startup`` is the number of seconds a torrent is considered
|
||||
active after it was started, regardless of upload and download speed. This
|
||||
is so that newly started torrents are not considered inactive until they
|
||||
have a fair chance to start downloading.
|
||||
|
||||
|
||||
pe_settings
|
||||
===========
|
||||
|
|
|
@ -142,6 +142,7 @@ namespace libtorrent
|
|||
, max_peerlist_size(8000)
|
||||
, min_announce_interval(5 * 60)
|
||||
, prioritize_partial_pieces(false)
|
||||
, auto_manage_startup(120)
|
||||
{}
|
||||
|
||||
// this is the user agent that will be sent to the tracker
|
||||
|
@ -441,6 +442,14 @@ namespace libtorrent
|
|||
// if true, partial pieces are picked before pieces
|
||||
// that are more rare
|
||||
bool prioritize_partial_pieces;
|
||||
|
||||
// the number of seconds a torrent is considered
|
||||
// active after it was started, regardless of
|
||||
// upload and download speed. This is so that
|
||||
// newly started torrents are not considered
|
||||
// inactive until they have a fair chance to
|
||||
// start downloading.
|
||||
int auto_manage_startup;
|
||||
};
|
||||
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
|
|
|
@ -217,6 +217,7 @@ namespace libtorrent
|
|||
void pause();
|
||||
void resume();
|
||||
|
||||
ptime started() const { return m_started; }
|
||||
void do_pause();
|
||||
void do_resume();
|
||||
|
||||
|
|
|
@ -1290,7 +1290,8 @@ namespace aux {
|
|||
{
|
||||
return !(s.dont_count_slow_torrents
|
||||
&& t->statistics().upload_payload_rate() == 0.f
|
||||
&& t->statistics().download_payload_rate() == 0.f);
|
||||
&& t->statistics().download_payload_rate() == 0.f
|
||||
&& time_now() - t->started() > seconds(s.auto_manage_startup));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue