made sequenced_download_threshold a per torrent setting. Updated the project page layout. Removed incorrect invariant checks in piece picker.
This commit is contained in:
parent
7bc1214749
commit
191fd76b42
|
@ -1,7 +1,8 @@
|
||||||
|
* modified the api slightly to make sequenced download threshold
|
||||||
|
a per torrent-setting.
|
||||||
* changed the address type to support IPv6
|
* changed the address type to support IPv6
|
||||||
* fixed in piece picker which would assert when changing
|
* fixed bug in piece picker which would not behave as
|
||||||
sequenced download threshold on torrents with already
|
expected with regard to sequenced download threshold.
|
||||||
downloaded pieces.
|
|
||||||
* fixed bug with file_progress() with files > 2 GB.
|
* fixed bug with file_progress() with files > 2 GB.
|
||||||
* added --enable-examples option to configure script.
|
* added --enable-examples option to configure script.
|
||||||
* fixed problem with the resource distribution algorithm
|
* fixed problem with the resource distribution algorithm
|
||||||
|
|
162
docs/manual.html
162
docs/manual.html
|
@ -75,89 +75,90 @@
|
||||||
<li><a class="reference" href="#connect-peer" id="id57" name="id57">connect_peer()</a></li>
|
<li><a class="reference" href="#connect-peer" id="id57" name="id57">connect_peer()</a></li>
|
||||||
<li><a class="reference" href="#set-ratio" id="id58" name="id58">set_ratio()</a></li>
|
<li><a class="reference" href="#set-ratio" id="id58" name="id58">set_ratio()</a></li>
|
||||||
<li><a class="reference" href="#set-upload-limit-set-download-limit" id="id59" name="id59">set_upload_limit() set_download_limit()</a></li>
|
<li><a class="reference" href="#set-upload-limit-set-download-limit" id="id59" name="id59">set_upload_limit() set_download_limit()</a></li>
|
||||||
<li><a class="reference" href="#set-peer-upload-limit-set-peer-download-limit" id="id60" name="id60">set_peer_upload_limit() set_peer_download_limit()</a></li>
|
<li><a class="reference" href="#set-sequenced-download-threshold" id="id60" name="id60">set_sequenced_download_threshold()</a></li>
|
||||||
<li><a class="reference" href="#pause-resume-is-paused" id="id61" name="id61">pause() resume() is_paused()</a></li>
|
<li><a class="reference" href="#set-peer-upload-limit-set-peer-download-limit" id="id61" name="id61">set_peer_upload_limit() set_peer_download_limit()</a></li>
|
||||||
<li><a class="reference" href="#is-seed" id="id62" name="id62">is_seed()</a></li>
|
<li><a class="reference" href="#pause-resume-is-paused" id="id62" name="id62">pause() resume() is_paused()</a></li>
|
||||||
<li><a class="reference" href="#has-metadata" id="id63" name="id63">has_metadata()</a></li>
|
<li><a class="reference" href="#is-seed" id="id63" name="id63">is_seed()</a></li>
|
||||||
<li><a class="reference" href="#set-tracker-login" id="id64" name="id64">set_tracker_login()</a></li>
|
<li><a class="reference" href="#has-metadata" id="id64" name="id64">has_metadata()</a></li>
|
||||||
<li><a class="reference" href="#trackers-replace-trackers" id="id65" name="id65">trackers() replace_trackers()</a></li>
|
<li><a class="reference" href="#set-tracker-login" id="id65" name="id65">set_tracker_login()</a></li>
|
||||||
<li><a class="reference" href="#add-url-seed" id="id66" name="id66">add_url_seed()</a></li>
|
<li><a class="reference" href="#trackers-replace-trackers" id="id66" name="id66">trackers() replace_trackers()</a></li>
|
||||||
<li><a class="reference" href="#use-interface" id="id67" name="id67">use_interface()</a></li>
|
<li><a class="reference" href="#add-url-seed" id="id67" name="id67">add_url_seed()</a></li>
|
||||||
<li><a class="reference" href="#info-hash" id="id68" name="id68">info_hash()</a></li>
|
<li><a class="reference" href="#use-interface" id="id68" name="id68">use_interface()</a></li>
|
||||||
<li><a class="reference" href="#id5" id="id69" name="id69">set_max_uploads() set_max_connections()</a></li>
|
<li><a class="reference" href="#info-hash" id="id69" name="id69">info_hash()</a></li>
|
||||||
<li><a class="reference" href="#write-resume-data" id="id70" name="id70">write_resume_data()</a></li>
|
<li><a class="reference" href="#id5" id="id70" name="id70">set_max_uploads() set_max_connections()</a></li>
|
||||||
<li><a class="reference" href="#metadata" id="id71" name="id71">metadata()</a></li>
|
<li><a class="reference" href="#write-resume-data" id="id71" name="id71">write_resume_data()</a></li>
|
||||||
<li><a class="reference" href="#id6" id="id72" name="id72">status()</a></li>
|
<li><a class="reference" href="#metadata" id="id72" name="id72">metadata()</a></li>
|
||||||
<li><a class="reference" href="#get-download-queue" id="id73" name="id73">get_download_queue()</a></li>
|
<li><a class="reference" href="#id6" id="id73" name="id73">status()</a></li>
|
||||||
<li><a class="reference" href="#get-peer-info" id="id74" name="id74">get_peer_info()</a></li>
|
<li><a class="reference" href="#get-download-queue" id="id74" name="id74">get_download_queue()</a></li>
|
||||||
<li><a class="reference" href="#get-torrent-info" id="id75" name="id75">get_torrent_info()</a></li>
|
<li><a class="reference" href="#get-peer-info" id="id75" name="id75">get_peer_info()</a></li>
|
||||||
<li><a class="reference" href="#is-valid" id="id76" name="id76">is_valid()</a></li>
|
<li><a class="reference" href="#get-torrent-info" id="id76" name="id76">get_torrent_info()</a></li>
|
||||||
|
<li><a class="reference" href="#is-valid" id="id77" name="id77">is_valid()</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="reference" href="#torrent-status" id="id77" name="id77">torrent_status</a></li>
|
<li><a class="reference" href="#torrent-status" id="id78" name="id78">torrent_status</a></li>
|
||||||
<li><a class="reference" href="#peer-info" id="id78" name="id78">peer_info</a></li>
|
<li><a class="reference" href="#peer-info" id="id79" name="id79">peer_info</a></li>
|
||||||
<li><a class="reference" href="#session-settings" id="id79" name="id79">session_settings</a></li>
|
<li><a class="reference" href="#session-settings" id="id80" name="id80">session_settings</a></li>
|
||||||
<li><a class="reference" href="#ip-filter" id="id80" name="id80">ip_filter</a><ul>
|
<li><a class="reference" href="#ip-filter" id="id81" name="id81">ip_filter</a><ul>
|
||||||
<li><a class="reference" href="#id8" id="id81" name="id81">ip_filter()</a></li>
|
<li><a class="reference" href="#id8" id="id82" name="id82">ip_filter()</a></li>
|
||||||
<li><a class="reference" href="#add-rule" id="id82" name="id82">add_rule()</a></li>
|
<li><a class="reference" href="#add-rule" id="id83" name="id83">add_rule()</a></li>
|
||||||
<li><a class="reference" href="#access" id="id83" name="id83">access()</a></li>
|
<li><a class="reference" href="#access" id="id84" name="id84">access()</a></li>
|
||||||
<li><a class="reference" href="#export-filter" id="id84" name="id84">export_filter()</a></li>
|
<li><a class="reference" href="#export-filter" id="id85" name="id85">export_filter()</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="reference" href="#big-number" id="id85" name="id85">big_number</a></li>
|
<li><a class="reference" href="#big-number" id="id86" name="id86">big_number</a></li>
|
||||||
<li><a class="reference" href="#hasher" id="id86" name="id86">hasher</a></li>
|
<li><a class="reference" href="#hasher" id="id87" name="id87">hasher</a></li>
|
||||||
<li><a class="reference" href="#fingerprint" id="id87" name="id87">fingerprint</a></li>
|
<li><a class="reference" href="#fingerprint" id="id88" name="id88">fingerprint</a></li>
|
||||||
<li><a class="reference" href="#free-functions" id="id88" name="id88">free functions</a><ul>
|
<li><a class="reference" href="#free-functions" id="id89" name="id89">free functions</a><ul>
|
||||||
<li><a class="reference" href="#identify-client" id="id89" name="id89">identify_client()</a></li>
|
<li><a class="reference" href="#identify-client" id="id90" name="id90">identify_client()</a></li>
|
||||||
<li><a class="reference" href="#client-fingerprint" id="id90" name="id90">client_fingerprint()</a></li>
|
<li><a class="reference" href="#client-fingerprint" id="id91" name="id91">client_fingerprint()</a></li>
|
||||||
<li><a class="reference" href="#bdecode-bencode" id="id91" name="id91">bdecode() bencode()</a></li>
|
<li><a class="reference" href="#bdecode-bencode" id="id92" name="id92">bdecode() bencode()</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="reference" href="#alerts" id="id92" name="id92">alerts</a><ul>
|
<li><a class="reference" href="#alerts" id="id93" name="id93">alerts</a><ul>
|
||||||
<li><a class="reference" href="#listen-failed-alert" id="id93" name="id93">listen_failed_alert</a></li>
|
<li><a class="reference" href="#listen-failed-alert" id="id94" name="id94">listen_failed_alert</a></li>
|
||||||
<li><a class="reference" href="#file-error-alert" id="id94" name="id94">file_error_alert</a></li>
|
<li><a class="reference" href="#file-error-alert" id="id95" name="id95">file_error_alert</a></li>
|
||||||
<li><a class="reference" href="#tracker-announce-alert" id="id95" name="id95">tracker_announce_alert</a></li>
|
<li><a class="reference" href="#tracker-announce-alert" id="id96" name="id96">tracker_announce_alert</a></li>
|
||||||
<li><a class="reference" href="#tracker-alert" id="id96" name="id96">tracker_alert</a></li>
|
<li><a class="reference" href="#tracker-alert" id="id97" name="id97">tracker_alert</a></li>
|
||||||
<li><a class="reference" href="#tracker-reply-alert" id="id97" name="id97">tracker_reply_alert</a></li>
|
<li><a class="reference" href="#tracker-reply-alert" id="id98" name="id98">tracker_reply_alert</a></li>
|
||||||
<li><a class="reference" href="#tracker-warning-alert" id="id98" name="id98">tracker_warning_alert</a></li>
|
<li><a class="reference" href="#tracker-warning-alert" id="id99" name="id99">tracker_warning_alert</a></li>
|
||||||
<li><a class="reference" href="#url-seed-alert" id="id99" name="id99">url_seed_alert</a></li>
|
<li><a class="reference" href="#url-seed-alert" id="id100" name="id100">url_seed_alert</a></li>
|
||||||
<li><a class="reference" href="#hash-failed-alert" id="id100" name="id100">hash_failed_alert</a></li>
|
<li><a class="reference" href="#hash-failed-alert" id="id101" name="id101">hash_failed_alert</a></li>
|
||||||
<li><a class="reference" href="#peer-ban-alert" id="id101" name="id101">peer_ban_alert</a></li>
|
<li><a class="reference" href="#peer-ban-alert" id="id102" name="id102">peer_ban_alert</a></li>
|
||||||
<li><a class="reference" href="#peer-error-alert" id="id102" name="id102">peer_error_alert</a></li>
|
<li><a class="reference" href="#peer-error-alert" id="id103" name="id103">peer_error_alert</a></li>
|
||||||
<li><a class="reference" href="#invalid-request-alert" id="id103" name="id103">invalid_request_alert</a></li>
|
<li><a class="reference" href="#invalid-request-alert" id="id104" name="id104">invalid_request_alert</a></li>
|
||||||
<li><a class="reference" href="#torrent-finished-alert" id="id104" name="id104">torrent_finished_alert</a></li>
|
<li><a class="reference" href="#torrent-finished-alert" id="id105" name="id105">torrent_finished_alert</a></li>
|
||||||
<li><a class="reference" href="#metadata-failed-alert" id="id105" name="id105">metadata_failed_alert</a></li>
|
<li><a class="reference" href="#metadata-failed-alert" id="id106" name="id106">metadata_failed_alert</a></li>
|
||||||
<li><a class="reference" href="#metadata-received-alert" id="id106" name="id106">metadata_received_alert</a></li>
|
<li><a class="reference" href="#metadata-received-alert" id="id107" name="id107">metadata_received_alert</a></li>
|
||||||
<li><a class="reference" href="#fastresume-rejected-alert" id="id107" name="id107">fastresume_rejected_alert</a></li>
|
<li><a class="reference" href="#fastresume-rejected-alert" id="id108" name="id108">fastresume_rejected_alert</a></li>
|
||||||
<li><a class="reference" href="#dispatcher" id="id108" name="id108">dispatcher</a></li>
|
<li><a class="reference" href="#dispatcher" id="id109" name="id109">dispatcher</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="reference" href="#exceptions" id="id109" name="id109">exceptions</a><ul>
|
<li><a class="reference" href="#exceptions" id="id110" name="id110">exceptions</a><ul>
|
||||||
<li><a class="reference" href="#invalid-handle" id="id110" name="id110">invalid_handle</a></li>
|
<li><a class="reference" href="#invalid-handle" id="id111" name="id111">invalid_handle</a></li>
|
||||||
<li><a class="reference" href="#duplicate-torrent" id="id111" name="id111">duplicate_torrent</a></li>
|
<li><a class="reference" href="#duplicate-torrent" id="id112" name="id112">duplicate_torrent</a></li>
|
||||||
<li><a class="reference" href="#invalid-encoding" id="id112" name="id112">invalid_encoding</a></li>
|
<li><a class="reference" href="#invalid-encoding" id="id113" name="id113">invalid_encoding</a></li>
|
||||||
<li><a class="reference" href="#type-error" id="id113" name="id113">type_error</a></li>
|
<li><a class="reference" href="#type-error" id="id114" name="id114">type_error</a></li>
|
||||||
<li><a class="reference" href="#invalid-torrent-file" id="id114" name="id114">invalid_torrent_file</a></li>
|
<li><a class="reference" href="#invalid-torrent-file" id="id115" name="id115">invalid_torrent_file</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="reference" href="#fast-resume" id="id115" name="id115">fast resume</a><ul>
|
<li><a class="reference" href="#fast-resume" id="id116" name="id116">fast resume</a><ul>
|
||||||
<li><a class="reference" href="#file-format" id="id116" name="id116">file format</a></li>
|
<li><a class="reference" href="#file-format" id="id117" name="id117">file format</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="reference" href="#threads" id="id117" name="id117">threads</a></li>
|
<li><a class="reference" href="#threads" id="id118" name="id118">threads</a></li>
|
||||||
<li><a class="reference" href="#storage-allocation" id="id118" name="id118">storage allocation</a><ul>
|
<li><a class="reference" href="#storage-allocation" id="id119" name="id119">storage allocation</a><ul>
|
||||||
<li><a class="reference" href="#full-allocation" id="id119" name="id119">full allocation</a></li>
|
<li><a class="reference" href="#full-allocation" id="id120" name="id120">full allocation</a></li>
|
||||||
<li><a class="reference" href="#compact-allocation" id="id120" name="id120">compact allocation</a></li>
|
<li><a class="reference" href="#compact-allocation" id="id121" name="id121">compact allocation</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="reference" href="#extensions" id="id121" name="id121">extensions</a><ul>
|
<li><a class="reference" href="#extensions" id="id122" name="id122">extensions</a><ul>
|
||||||
<li><a class="reference" href="#chat-messages" id="id122" name="id122">chat messages</a></li>
|
<li><a class="reference" href="#chat-messages" id="id123" name="id123">chat messages</a></li>
|
||||||
<li><a class="reference" href="#metadata-from-peers" id="id123" name="id123">metadata from peers</a></li>
|
<li><a class="reference" href="#metadata-from-peers" id="id124" name="id124">metadata from peers</a></li>
|
||||||
<li><a class="reference" href="#http-seeding" id="id124" name="id124">HTTP seeding</a></li>
|
<li><a class="reference" href="#http-seeding" id="id125" name="id125">HTTP seeding</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a class="reference" href="#filename-checks" id="id125" name="id125">filename checks</a></li>
|
<li><a class="reference" href="#filename-checks" id="id126" name="id126">filename checks</a></li>
|
||||||
<li><a class="reference" href="#acknowledgments" id="id126" name="id126">acknowledgments</a></li>
|
<li><a class="reference" href="#acknowledgments" id="id127" name="id127">acknowledgments</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="overview">
|
<div class="section" id="overview">
|
||||||
|
@ -1127,6 +1128,7 @@ struct torrent_handle
|
||||||
void set_max_connections(int max_connections) const;
|
void set_max_connections(int max_connections) const;
|
||||||
void set_upload_limit(int limit) const;
|
void set_upload_limit(int limit) const;
|
||||||
void set_download_limit(int limit) const;
|
void set_download_limit(int limit) const;
|
||||||
|
void set_sequenced_download_threshold(int threshold) const;
|
||||||
|
|
||||||
void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
||||||
void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
||||||
|
@ -1250,6 +1252,24 @@ Note that setting a higher limit on a torrent then the global limit (<tt class="
|
||||||
will not override the global rate limit. The torrent can never upload more than the global rate
|
will not override the global rate limit. The torrent can never upload more than the global rate
|
||||||
limit.</p>
|
limit.</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="section" id="set-sequenced-download-threshold">
|
||||||
|
<h2><a name="set-sequenced-download-threshold">set_sequenced_download_threshold()</a></h2>
|
||||||
|
<blockquote>
|
||||||
|
<pre class="literal-block">
|
||||||
|
void set_sequenced_download_threshold(int threshold);
|
||||||
|
</pre>
|
||||||
|
</blockquote>
|
||||||
|
<p>sequenced-download threshold is the limit on how popular a piece has to be
|
||||||
|
(popular == inverse of rarity) to be downloaded in sequence instead of in
|
||||||
|
random (rarest first) order. It can be used to tweak disk performance in
|
||||||
|
settings where the random download property is less necessary. For example, if
|
||||||
|
the threshold is 10, all pieces which 10 or more peers have, will be downloaded
|
||||||
|
in index order. This setting defaults to 100, which means that it is disabled
|
||||||
|
in practice.</p>
|
||||||
|
<p>Setting this threshold to a very small value will affect the piece distribution
|
||||||
|
negatively in the swarm. It should basically only be used in situations where
|
||||||
|
the random seeks on the disk is the download bottleneck.</p>
|
||||||
|
</div>
|
||||||
<div class="section" id="set-peer-upload-limit-set-peer-download-limit">
|
<div class="section" id="set-peer-upload-limit-set-peer-download-limit">
|
||||||
<h2><a name="set-peer-upload-limit-set-peer-download-limit">set_peer_upload_limit() set_peer_download_limit()</a></h2>
|
<h2><a name="set-peer-upload-limit-set-peer-download-limit">set_peer_upload_limit() set_peer_download_limit()</a></h2>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
@ -1836,7 +1856,6 @@ struct session_settings
|
||||||
|
|
||||||
int piece_timeout;
|
int piece_timeout;
|
||||||
float request_queue_time;
|
float request_queue_time;
|
||||||
int sequenced_download_threshold;
|
|
||||||
int max_allowed_in_request_queue;
|
int max_allowed_in_request_queue;
|
||||||
int max_out_request_queue;
|
int max_out_request_queue;
|
||||||
int whole_pieces_threshold;
|
int whole_pieces_threshold;
|
||||||
|
@ -1877,13 +1896,6 @@ it times out if no piece response is returned.</p>
|
||||||
<p><tt class="docutils literal"><span class="pre">request_queue_time</span></tt> is the length of the request queue given in the number
|
<p><tt class="docutils literal"><span class="pre">request_queue_time</span></tt> is the length of the request queue given in the number
|
||||||
of seconds it should take for the other end to send all the pieces. i.e. the
|
of seconds it should take for the other end to send all the pieces. i.e. the
|
||||||
actual number of requests depends on the download rate and this number.</p>
|
actual number of requests depends on the download rate and this number.</p>
|
||||||
<p><tt class="docutils literal"><span class="pre">sequenced_download_threshold</span></tt> is the limit on how popular a piece has to be
|
|
||||||
(popular == inverse of rarity) to be downloaded in sequence instead of in
|
|
||||||
random (rarest first) order. It can be used to tweak disk performance in
|
|
||||||
settings where the random download property is less necessary. For example, if
|
|
||||||
the threshold is 10, all pieces which 10 or more peers have, will be downloaded
|
|
||||||
in index order. This setting defaults to 100, which means that it is disabled
|
|
||||||
in practice.</p>
|
|
||||||
<p><tt class="docutils literal"><span class="pre">max_allowed_in_request_queue</span></tt> is the number of outstanding block requests
|
<p><tt class="docutils literal"><span class="pre">max_allowed_in_request_queue</span></tt> is the number of outstanding block requests
|
||||||
a peer is allowed to queue up in the client. If a peer sends more requests
|
a peer is allowed to queue up in the client. If a peer sends more requests
|
||||||
than this (before the first one has been handled) the last request will be
|
than this (before the first one has been handled) the last request will be
|
||||||
|
|
|
@ -1062,6 +1062,7 @@ Its declaration looks like this::
|
||||||
void set_max_connections(int max_connections) const;
|
void set_max_connections(int max_connections) const;
|
||||||
void set_upload_limit(int limit) const;
|
void set_upload_limit(int limit) const;
|
||||||
void set_download_limit(int limit) const;
|
void set_download_limit(int limit) const;
|
||||||
|
void set_sequenced_download_threshold(int threshold) const;
|
||||||
|
|
||||||
void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
||||||
void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
||||||
|
@ -1193,6 +1194,27 @@ Note that setting a higher limit on a torrent then the global limit (``session::
|
||||||
will not override the global rate limit. The torrent can never upload more than the global rate
|
will not override the global rate limit. The torrent can never upload more than the global rate
|
||||||
limit.
|
limit.
|
||||||
|
|
||||||
|
|
||||||
|
set_sequenced_download_threshold()
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
void set_sequenced_download_threshold(int threshold);
|
||||||
|
|
||||||
|
sequenced-download threshold is the limit on how popular a piece has to be
|
||||||
|
(popular == inverse of rarity) to be downloaded in sequence instead of in
|
||||||
|
random (rarest first) order. It can be used to tweak disk performance in
|
||||||
|
settings where the random download property is less necessary. For example, if
|
||||||
|
the threshold is 10, all pieces which 10 or more peers have, will be downloaded
|
||||||
|
in index order. This setting defaults to 100, which means that it is disabled
|
||||||
|
in practice.
|
||||||
|
|
||||||
|
Setting this threshold to a very small value will affect the piece distribution
|
||||||
|
negatively in the swarm. It should basically only be used in situations where
|
||||||
|
the random seeks on the disk is the download bottleneck.
|
||||||
|
|
||||||
|
|
||||||
set_peer_upload_limit() set_peer_download_limit()
|
set_peer_upload_limit() set_peer_download_limit()
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
|
|
||||||
|
@ -1812,7 +1834,6 @@ that will be sent to the tracker. The user-agent is a good way to identify your
|
||||||
|
|
||||||
int piece_timeout;
|
int piece_timeout;
|
||||||
float request_queue_time;
|
float request_queue_time;
|
||||||
int sequenced_download_threshold;
|
|
||||||
int max_allowed_in_request_queue;
|
int max_allowed_in_request_queue;
|
||||||
int max_out_request_queue;
|
int max_out_request_queue;
|
||||||
int whole_pieces_threshold;
|
int whole_pieces_threshold;
|
||||||
|
@ -1863,14 +1884,6 @@ it times out if no piece response is returned.
|
||||||
of seconds it should take for the other end to send all the pieces. i.e. the
|
of seconds it should take for the other end to send all the pieces. i.e. the
|
||||||
actual number of requests depends on the download rate and this number.
|
actual number of requests depends on the download rate and this number.
|
||||||
|
|
||||||
``sequenced_download_threshold`` is the limit on how popular a piece has to be
|
|
||||||
(popular == inverse of rarity) to be downloaded in sequence instead of in
|
|
||||||
random (rarest first) order. It can be used to tweak disk performance in
|
|
||||||
settings where the random download property is less necessary. For example, if
|
|
||||||
the threshold is 10, all pieces which 10 or more peers have, will be downloaded
|
|
||||||
in index order. This setting defaults to 100, which means that it is disabled
|
|
||||||
in practice.
|
|
||||||
|
|
||||||
``max_allowed_in_request_queue`` is the number of outstanding block requests
|
``max_allowed_in_request_queue`` is the number of outstanding block requests
|
||||||
a peer is allowed to queue up in the client. If a peer sends more requests
|
a peer is allowed to queue up in the client. If a peer sends more requests
|
||||||
than this (before the first one has been handled) the last request will be
|
than this (before the first one has been handled) the last request will be
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
project listed here, let <a class="reference" href="mailto:arvid@rasterbar.com">me</a> know.</p>
|
project listed here, let <a class="reference" href="mailto:arvid@rasterbar.com">me</a> know.</p>
|
||||||
<table border="1" class="docutils">
|
<table border="1" class="docutils">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col width="44%" />
|
<col width="68%" />
|
||||||
<col width="56%" />
|
<col width="32%" />
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<tbody valign="top">
|
<tbody valign="top">
|
||||||
<tr><td><p class="first"><strong>electric sheep</strong></p>
|
<tr><td><p class="first"><strong>electric sheep</strong></p>
|
||||||
|
|
|
@ -6,21 +6,21 @@ project listed here, let me_ know.
|
||||||
|
|
||||||
.. _me: mailto:arvid@rasterbar.com
|
.. _me: mailto:arvid@rasterbar.com
|
||||||
|
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **electric sheep** | .. image:: electric_sheep_thumb.jpg |
|
| **electric sheep** | .. image:: electric_sheep_thumb.jpg |
|
||||||
| | |
|
| | |
|
||||||
| `electric sheep`_ is a screensaver | |
|
| `electric sheep`_ is a screensaver | |
|
||||||
| which collectively generates | |
|
| which collectively generates | |
|
||||||
| animations and lets the users | |
|
| animations and lets the users | |
|
||||||
| vote which one to live on. | |
|
| vote which one to live on. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **qBittorrent** | .. image:: qbittorrent_thumb.jpg |
|
| **qBittorrent** | .. image:: qbittorrent_thumb.jpg |
|
||||||
| | |
|
| | |
|
||||||
| qBittorrent_ is a QT bittorrent | |
|
| qBittorrent_ is a QT bittorrent | |
|
||||||
| client available for linux (likely | |
|
| client available for linux (likely | |
|
||||||
| portable to most other desktops as | |
|
| portable to most other desktops as | |
|
||||||
| well). Written by Christophe Dumez. | |
|
| well). Written by Christophe Dumez. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **btg** | .. image:: btg_thumb.jpg |
|
| **btg** | .. image:: btg_thumb.jpg |
|
||||||
| | |
|
| | |
|
||||||
| btg_ is a unix bittorrent client | |
|
| btg_ is a unix bittorrent client | |
|
||||||
|
@ -32,62 +32,62 @@ project listed here, let me_ know.
|
||||||
| (accessable through a web browser). | |
|
| (accessable through a web browser). | |
|
||||||
| Written by Michael Wojciechowski | |
|
| Written by Michael Wojciechowski | |
|
||||||
| and Johan Stršm. | |
|
| and Johan Stršm. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **MooPolice** | .. image:: moopolice_thumb.gif |
|
| **MooPolice** | .. image:: moopolice_thumb.gif |
|
||||||
| | |
|
| | |
|
||||||
| MooPolice_ is a windows bittorrent | |
|
| MooPolice_ is a windows bittorrent | |
|
||||||
| client with a quite unique look. | |
|
| client with a quite unique look. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **BitsCast** | .. image:: bitscast_thumb.png |
|
| **BitsCast** | .. image:: bitscast_thumb.png |
|
||||||
| | |
|
| | |
|
||||||
| RSS reader, podcast subscriber, | |
|
| RSS reader, podcast subscriber, | |
|
||||||
| video feed downloader, bittorrent | |
|
| video feed downloader, bittorrent | |
|
||||||
| feed downloader. See BitsCast_ | |
|
| feed downloader. See BitsCast_ | |
|
||||||
| homepage for more info. | |
|
| homepage for more info. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **BitSlug** | .. image:: bitslug_thumb.png |
|
| **BitSlug** | .. image:: bitslug_thumb.png |
|
||||||
| | |
|
| | |
|
||||||
| BitSlug_ is a MacOSX cocoa client. | |
|
| BitSlug_ is a MacOSX cocoa client. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **BitBuddy** | .. image:: bitbuddy_thumb.jpg |
|
| **BitBuddy** | .. image:: bitbuddy_thumb.jpg |
|
||||||
| | |
|
| | |
|
||||||
| BitBuddy_ is a windows bittorrent | |
|
| BitBuddy_ is a windows bittorrent | |
|
||||||
| client by Daniel Wang, quite | |
|
| client by Daniel Wang, quite | |
|
||||||
| similar to BitComet GUI-wise. | |
|
| similar to BitComet GUI-wise. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **Arctic Torrent** | .. image:: arctic_thumb.png |
|
| **Arctic Torrent** | .. image:: arctic_thumb.png |
|
||||||
| | |
|
| | |
|
||||||
| `Arctic Torrent`_ is a light-weight | |
|
| `Arctic Torrent`_ is a light-weight | |
|
||||||
| bittorrent client for windows. | |
|
| bittorrent client for windows. | |
|
||||||
| Written by Cory Nelson. | |
|
| Written by Cory Nelson. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **ZipTorrent** | .. image:: ziptorrent_thumb.gif |
|
| **ZipTorrent** | .. image:: ziptorrent_thumb.gif |
|
||||||
| | |
|
| | |
|
||||||
| ZipTorrent_ is another windows | |
|
| ZipTorrent_ is another windows | |
|
||||||
| bittorrent client with | |
|
| bittorrent client with | |
|
||||||
| decentralized search facility. | |
|
| decentralized search facility. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **Jamplayer** | |
|
| **Jamplayer** | |
|
||||||
| | |
|
| | |
|
||||||
| Jamplayer_ is a remote controlled | |
|
| Jamplayer_ is a remote controlled | |
|
||||||
| music player and downloader using | |
|
| music player and downloader using | |
|
||||||
| the jamendo music network. | |
|
| the jamendo music network. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **FireANT** | |
|
| **FireANT** | |
|
||||||
| | |
|
| | |
|
||||||
| FireANT_ is a video blog available | |
|
| FireANT_ is a video blog available | |
|
||||||
| for Windows and Mac OSX. | |
|
| for Windows and Mac OSX. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **eDonkey 2000** | |
|
| **eDonkey 2000** | |
|
||||||
| | |
|
| | |
|
||||||
| eDonkey2000_ comes bundled with a | |
|
| eDonkey2000_ comes bundled with a | |
|
||||||
| bittorrent plugin by 'The Orphan'. | |
|
| bittorrent plugin by 'The Orphan'. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
| **pHoeniX** | |
|
| **pHoeniX** | |
|
||||||
| | |
|
| | |
|
||||||
| pHoeniX_ is an eMule mod supporting,| |
|
| pHoeniX_ is an eMule mod supporting, | |
|
||||||
| among other things, bittorrent. | |
|
| among other things, bittorrent. | |
|
||||||
+-------------------------------------+-----------------------------------------------+
|
+-------------------------------------------------------------------------------+-------------------------------------+
|
||||||
|
|
||||||
.. _`electric sheep`: http://electricsheep.org
|
.. _`electric sheep`: http://electricsheep.org
|
||||||
.. _qBittorrent: http://www.qbittorrent.org/
|
.. _qBittorrent: http://www.qbittorrent.org/
|
||||||
|
|
|
@ -348,6 +348,7 @@ void add_torrent(libtorrent::session& ses
|
||||||
h.set_max_connections(60);
|
h.set_max_connections(60);
|
||||||
h.set_max_uploads(-1);
|
h.set_max_uploads(-1);
|
||||||
h.set_ratio(preferred_ratio);
|
h.set_ratio(preferred_ratio);
|
||||||
|
h.set_sequenced_download_threshold(15);
|
||||||
}
|
}
|
||||||
|
|
||||||
void scan_dir(path const& dir_path
|
void scan_dir(path const& dir_path
|
||||||
|
@ -553,7 +554,6 @@ int main(int ac, char* av[])
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.user_agent = "client_test " LIBTORRENT_VERSION;
|
settings.user_agent = "client_test " LIBTORRENT_VERSION;
|
||||||
settings.sequenced_download_threshold = 15;
|
|
||||||
|
|
||||||
std::deque<std::string> events;
|
std::deque<std::string> events;
|
||||||
|
|
||||||
|
@ -667,6 +667,7 @@ int main(int ac, char* av[])
|
||||||
h.set_max_connections(60);
|
h.set_max_connections(60);
|
||||||
h.set_max_uploads(-1);
|
h.set_max_uploads(-1);
|
||||||
h.set_ratio(preferred_ratio);
|
h.set_ratio(preferred_ratio);
|
||||||
|
h.set_sequenced_download_threshold(15);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if it's a torrent file, open it as usual
|
// if it's a torrent file, open it as usual
|
||||||
|
|
|
@ -111,8 +111,7 @@ namespace libtorrent
|
||||||
};
|
};
|
||||||
|
|
||||||
piece_picker(int blocks_per_piece
|
piece_picker(int blocks_per_piece
|
||||||
, int total_num_blocks
|
, int total_num_blocks);
|
||||||
, int sequenced_download_threshold);
|
|
||||||
|
|
||||||
void set_sequenced_download_threshold(int sequenced_download_threshold);
|
void set_sequenced_download_threshold(int sequenced_download_threshold);
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,6 @@ namespace libtorrent
|
||||||
, tracker_maximum_response_length(1024*1024)
|
, tracker_maximum_response_length(1024*1024)
|
||||||
, piece_timeout(120)
|
, piece_timeout(120)
|
||||||
, request_queue_time(3.f)
|
, request_queue_time(3.f)
|
||||||
, sequenced_download_threshold(100)
|
|
||||||
, max_allowed_in_request_queue(250)
|
, max_allowed_in_request_queue(250)
|
||||||
, max_out_request_queue(200)
|
, max_out_request_queue(200)
|
||||||
, whole_pieces_threshold(20)
|
, whole_pieces_threshold(20)
|
||||||
|
@ -98,15 +97,6 @@ namespace libtorrent
|
||||||
// depends on the download rate and this number.
|
// depends on the download rate and this number.
|
||||||
float request_queue_time;
|
float request_queue_time;
|
||||||
|
|
||||||
// this is the limit on how popular a piece has to be
|
|
||||||
// (popular == inverse of rarity) to be downloaded
|
|
||||||
// in sequence instead of in random (rarest first) order.
|
|
||||||
// it can be used to tweak disk performance in settings
|
|
||||||
// where the random download property is less necessary.
|
|
||||||
// for example, if the threshold is 7, all pieces which 7
|
|
||||||
// or more peers have, will be downloaded in index order.
|
|
||||||
int sequenced_download_threshold;
|
|
||||||
|
|
||||||
// the number of outstanding block requests a peer is
|
// the number of outstanding block requests a peer is
|
||||||
// allowed to queue up in the client. If a peer sends
|
// allowed to queue up in the client. If a peer sends
|
||||||
// more requests than this (before the first one has
|
// more requests than this (before the first one has
|
||||||
|
|
|
@ -135,6 +135,8 @@ namespace libtorrent
|
||||||
|
|
||||||
session_settings const& settings() const;
|
session_settings const& settings() const;
|
||||||
|
|
||||||
|
void set_sequenced_download_threshold(int threshold);
|
||||||
|
|
||||||
// is called every second by session. This will
|
// is called every second by session. This will
|
||||||
// caclulate the upload/download and number
|
// caclulate the upload/download and number
|
||||||
// of connections this torrent needs. And prepare
|
// of connections this torrent needs. And prepare
|
||||||
|
|
|
@ -284,6 +284,7 @@ namespace libtorrent
|
||||||
|
|
||||||
void set_upload_limit(int limit) const;
|
void set_upload_limit(int limit) const;
|
||||||
void set_download_limit(int limit) const;
|
void set_download_limit(int limit) const;
|
||||||
|
void set_sequenced_download_threshold(int threshold) const;
|
||||||
|
|
||||||
void set_peer_upload_limit(tcp::endpoint ip, int limit) const;
|
void set_peer_upload_limit(tcp::endpoint ip, int limit) const;
|
||||||
void set_peer_download_limit(tcp::endpoint ip, int limit) const;
|
void set_peer_download_limit(tcp::endpoint ip, int limit) const;
|
||||||
|
|
|
@ -51,14 +51,13 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
|
|
||||||
piece_picker::piece_picker(int blocks_per_piece, int total_num_blocks
|
piece_picker::piece_picker(int blocks_per_piece, int total_num_blocks)
|
||||||
, int sequenced_download_threshold)
|
|
||||||
: m_piece_info(2)
|
: m_piece_info(2)
|
||||||
, m_downloading_piece_info(2)
|
, m_downloading_piece_info(2)
|
||||||
, m_piece_map((total_num_blocks + blocks_per_piece-1) / blocks_per_piece)
|
, m_piece_map((total_num_blocks + blocks_per_piece-1) / blocks_per_piece)
|
||||||
, m_num_filtered(0)
|
, m_num_filtered(0)
|
||||||
, m_num_have_filtered(0)
|
, m_num_have_filtered(0)
|
||||||
, m_sequenced_download_threshold(sequenced_download_threshold)
|
, m_sequenced_download_threshold(100)
|
||||||
{
|
{
|
||||||
assert(blocks_per_piece > 0);
|
assert(blocks_per_piece > 0);
|
||||||
assert(total_num_blocks >= 0);
|
assert(total_num_blocks >= 0);
|
||||||
|
@ -167,7 +166,6 @@ namespace libtorrent
|
||||||
|
|
||||||
if (old_limit < sequenced_download_threshold)
|
if (old_limit < sequenced_download_threshold)
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
|
||||||
assert(int(m_piece_info.size()) > old_limit);
|
assert(int(m_piece_info.size()) > old_limit);
|
||||||
info_t& in = m_piece_info[old_limit];
|
info_t& in = m_piece_info[old_limit];
|
||||||
std::random_shuffle(in.begin(), in.end());
|
std::random_shuffle(in.begin(), in.end());
|
||||||
|
@ -181,7 +179,6 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
else if (int(m_piece_info.size()) > sequenced_download_threshold)
|
else if (int(m_piece_info.size()) > sequenced_download_threshold)
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
|
||||||
assert(int(m_piece_info.size()) > sequenced_download_threshold);
|
assert(int(m_piece_info.size()) > sequenced_download_threshold);
|
||||||
info_t& in = m_piece_info[sequenced_download_threshold];
|
info_t& in = m_piece_info[sequenced_download_threshold];
|
||||||
std::sort(in.begin(), in.end());
|
std::sort(in.begin(), in.end());
|
||||||
|
|
|
@ -494,18 +494,6 @@ namespace libtorrent { namespace detail
|
||||||
|
|
||||||
void session_impl::set_settings(session_settings const& s)
|
void session_impl::set_settings(session_settings const& s)
|
||||||
{
|
{
|
||||||
if (m_settings.sequenced_download_threshold
|
|
||||||
!= s.sequenced_download_threshold)
|
|
||||||
{
|
|
||||||
for (torrent_map::iterator i = m_torrents.begin()
|
|
||||||
, end(m_torrents.end()); i != end; ++i)
|
|
||||||
{
|
|
||||||
torrent& t = *i->second;
|
|
||||||
if (t.valid_metadata())
|
|
||||||
t.picker().set_sequenced_download_threshold(
|
|
||||||
s.sequenced_download_threshold);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_settings = s;
|
m_settings = s;
|
||||||
// replace all occurances of '\n' with ' '.
|
// replace all occurances of '\n' with ' '.
|
||||||
std::string::iterator i = m_settings.user_agent.begin();
|
std::string::iterator i = m_settings.user_agent.begin();
|
||||||
|
|
|
@ -421,8 +421,7 @@ namespace libtorrent
|
||||||
m_block_size = calculate_block_size(m_torrent_file, m_default_block_size);
|
m_block_size = calculate_block_size(m_torrent_file, m_default_block_size);
|
||||||
m_picker.reset(new piece_picker(
|
m_picker.reset(new piece_picker(
|
||||||
static_cast<int>(m_torrent_file.piece_length() / m_block_size)
|
static_cast<int>(m_torrent_file.piece_length() / m_block_size)
|
||||||
, static_cast<int>((m_torrent_file.total_size()+m_block_size-1)/m_block_size)
|
, static_cast<int>((m_torrent_file.total_size()+m_block_size-1)/m_block_size)));
|
||||||
, m_settings.sequenced_download_threshold));
|
|
||||||
|
|
||||||
std::vector<std::string> const& url_seeds = m_torrent_file.url_seeds();
|
std::vector<std::string> const& url_seeds = m_torrent_file.url_seeds();
|
||||||
std::copy(url_seeds.begin(), url_seeds.end(), std::inserter(m_web_seeds
|
std::copy(url_seeds.begin(), url_seeds.end(), std::inserter(m_web_seeds
|
||||||
|
@ -1464,6 +1463,13 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void torrent::set_sequenced_download_threshold(int threshold)
|
||||||
|
{
|
||||||
|
if (valid_metadata())
|
||||||
|
picker().set_sequenced_download_threshold(threshold);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void torrent::set_max_uploads(int limit)
|
void torrent::set_max_uploads(int limit)
|
||||||
{
|
{
|
||||||
assert(limit >= -1);
|
assert(limit >= -1);
|
||||||
|
|
|
@ -317,6 +317,13 @@ namespace libtorrent
|
||||||
return torrent_status();
|
return torrent_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void torrent_handle::set_sequenced_download_threshold(int threshold) const
|
||||||
|
{
|
||||||
|
INVARIANT_CHECK;
|
||||||
|
call_member<void>(m_ses, m_chk, m_info_hash
|
||||||
|
, bind(&torrent::set_sequenced_download_threshold, _1, threshold));
|
||||||
|
}
|
||||||
|
|
||||||
void torrent_handle::filter_piece(int index, bool filter) const
|
void torrent_handle::filter_piece(int index, bool filter) const
|
||||||
{
|
{
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
Loading…
Reference in New Issue