fix documentation

This commit is contained in:
Arvid Norberg 2014-07-02 06:15:57 +00:00
parent c5f6bb7582
commit a9862c6f50
8 changed files with 447 additions and 190 deletions

View File

@ -67,6 +67,7 @@
<li><a class="reference external" href="utp.html">uTP</a></li>
<li><a class="reference external" href="extension_protocol.html">extensions protocol</a></li>
<li><a class="reference external" href="reference-Plugins.html">plugin interface</a></li>
<li><a class="reference external" href="streaming.html">streaming</a></li>
<li><a class="reference external" href="dht_extensions.html">DHT extensions</a></li>
<li><a class="reference external" href="dht_sec.html">DHT security extension</a></li>
<li><a class="reference external" href="dht_store.html">DHT store extension</a></li>
@ -122,7 +123,7 @@ list or posted to the <a class="reference external" href="https://code.google.co
</div>
<div class="section" id="acknowledgements">
<h2>Acknowledgements</h2>
<p>Written by Arvid Norberg. Copyright © 2003-2009</p>
<p>Written by Arvid Norberg. Copyright © 2003-2014</p>
<p>Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson</p>
<p>Thanks to Reimond Retz for bugfixes, suggestions and testing</p>
<p>Thanks to <a class="reference external" href="http://www.cs.umu.se">Umeå University</a> for providing development and test hardware.</p>

View File

@ -410,6 +410,11 @@ including the root and all leaves. The tree is not
necessarily complete, but complete enough to be able to send
any piece that we have, indicated by the have bitmask.</td>
</tr>
<tr><td><tt class="docutils literal">save_path</tt></td>
<td>string. The save path where this torrent was saved. This is
especially useful when moving torrents with move_storage()
since this will be updated.</td>
</tr>
<tr><td><tt class="docutils literal">peers</tt></td>
<td><p class="first">list of dictionaries. Each dictionary has the following
layout:</p>

View File

@ -103,9 +103,9 @@ the torrent. The <a class="reference external" href="reference-Bencoding.html#en
<pre class="literal-block">
struct create_torrent
{
<strong>create_torrent</strong> (torrent_info const&amp; ti);
<strong>create_torrent</strong> (file_storage&amp; fs, int piece_size = 0
, int pad_file_limit = -1, int flags = optimize, int alignment = 0x4000);
, int pad_file_limit = -1, int flags = optimize, int alignment = -1);
<strong>create_torrent</strong> (torrent_info const&amp; ti);
entry <strong>generate</strong> () const;
file_storage const&amp; <strong>files</strong> () const;
void <strong>set_comment</strong> (char const* str);
@ -137,9 +137,9 @@ struct create_torrent
<a name="create_torrent()"></a><div class="section" id="id5">
<h2>create_torrent()</h2>
<pre class="literal-block">
<strong>create_torrent</strong> (torrent_info const&amp; ti);
<strong>create_torrent</strong> (file_storage&amp; fs, int piece_size = 0
, int pad_file_limit = -1, int flags = optimize, int alignment = 0x4000);
, int pad_file_limit = -1, int flags = optimize, int alignment = -1);
<strong>create_torrent</strong> (torrent_info const&amp; ti);
</pre>
<p>The <tt class="docutils literal">piece_size</tt> is the size of each piece in bytes. It must
be a multiple of 16 kiB. If a piece size of 0 is specified, a
@ -157,9 +157,9 @@ the content of the info dictionary (such as <tt class="docutils literal">set_has
have any affect.</p>
<p>The <tt class="docutils literal">flags</tt> arguments specifies options for the torrent creation. It can
be any combination of the flags defined by <a class="reference external" href="reference-Create_Torrents.html#flags_t">create_torrent::flags_t</a>.</p>
<p><tt class="docutils literal">alignment</tt> is used when pad files are enabled. This is the size eligible
files are aligned to. The default is the default bittorrent block size of
16 kiB. It is common to align to the piece size of the torrent.</p>
<p><tt class="docutils literal">alignment</tt> is used when pad files are enabled. This is the size
eligible files are aligned to. The default is -1, which means the
piece size of the torrent.</p>
<a name="generate()"></a></div>
<div class="section" id="generate">
<h2>generate()</h2>

View File

@ -55,14 +55,14 @@
<div class="contents topic" id="table-of-contents">
<p class="topic-title first">Table of contents</p>
<ul class="simple">
<li><a class="reference internal" href="#add-torrent-params" id="id172">add_torrent_params</a></li>
<li><a class="reference internal" href="#cache-status" id="id173">cache_status</a></li>
<li><a class="reference internal" href="#session-proxy" id="id174">session_proxy</a></li>
<li><a class="reference internal" href="#id36" id="id175">session</a></li>
<li><a class="reference internal" href="#dht-lookup" id="id176">dht_lookup</a></li>
<li><a class="reference internal" href="#dht-routing-bucket" id="id177">dht_routing_bucket</a></li>
<li><a class="reference internal" href="#utp-status" id="id178">utp_status</a></li>
<li><a class="reference internal" href="#session-status" id="id179">session_status</a></li>
<li><a class="reference internal" href="#add-torrent-params" id="id173">add_torrent_params</a></li>
<li><a class="reference internal" href="#cache-status" id="id174">cache_status</a></li>
<li><a class="reference internal" href="#session-proxy" id="id175">session_proxy</a></li>
<li><a class="reference internal" href="#id37" id="id176">session</a></li>
<li><a class="reference internal" href="#dht-lookup" id="id177">dht_lookup</a></li>
<li><a class="reference internal" href="#dht-routing-bucket" id="id178">dht_routing_bucket</a></li>
<li><a class="reference internal" href="#utp-status" id="id179">utp_status</a></li>
<li><a class="reference internal" href="#session-status" id="id180">session_status</a></li>
</ul>
</div>
<a name="add_torrent_params"></a><div class="section" id="add-torrent-params">
@ -106,6 +106,7 @@ struct add_torrent_params
flag_update_subscribe,
flag_super_seeding,
flag_sequential_download,
flag_use_resume_save_path,
};
int version;
@ -146,9 +147,9 @@ data for the torrent. For more information, see the <tt class="docutils literal"
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/add_torrent_params.hpp">libtorrent/add_torrent_params.hpp</a>&quot;</p>
<table border="1" class="docutils">
<colgroup>
<col width="27%" />
<col width="26%" />
<col width="7%" />
<col width="66%" />
<col width="67%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">name</th>
@ -176,9 +177,9 @@ in there will override the seed mode you set here.</p>
</tr>
<tr><td>flag_override_resume_data</td>
<td>2</td>
<td><p class="first">If <tt class="docutils literal">flag_override_resume_data</tt> is set, the <tt class="docutils literal">paused</tt> and
<tt class="docutils literal">auto_managed</tt> state of the torrent are not loaded from the
resume data, but the states requested by the flags in
<td><p class="first">If <tt class="docutils literal">flag_override_resume_data</tt> is set, the <tt class="docutils literal">paused</tt>,
<tt class="docutils literal">auto_managed</tt> and <tt class="docutils literal">save_path</tt> of the torrent are not loaded
from the resume data, but the states requested by the flags in
<tt class="docutils literal">add_torrent_params</tt> will override them.</p>
<p class="last">If you pass in resume data, the paused state of the torrent when
the resume data was saved will override the paused state you pass
@ -282,6 +283,12 @@ immediately after adding it.</td>
effect as calling <tt class="docutils literal"><span class="pre">torrent_handle::sequential_download(true)</span></tt> on
the torrent handle immediately after adding it.</td>
</tr>
<tr><td>flag_use_resume_save_path</td>
<td>4096</td>
<td>if this flag is set, the save path from the resume data file, if
present, is honored. This defaults to not being set, in which
case the save_path specified in <a class="reference external" href="reference-Session.html#add_torrent_params">add_torrent_params</a> is always used.</td>
</tr>
</tbody>
</table>
<a name="version"></a><dl class="docutils">
@ -304,12 +311,18 @@ peers, the <tt class="docutils literal">trackers</tt> can specify tracker URLs f
<dd>url seeds to be added to the torrent (<a class="reference external" href="http://bittorrent.org/beps/bep_0017.html">BEP 17</a>).</dd>
</dl>
<a name="dht_nodes"></a>
<a name="name"></a>
<a name="save_path"></a><dl class="docutils">
<dt>dht_nodes name save_path</dt>
<a name="name"></a><dl class="docutils">
<dt>dht_nodes name</dt>
<dd>a list of hostname and port pairs, representing DHT nodes to be added
to the <a class="reference external" href="reference-Session.html#session">session</a> (if DHT is enabled). The hostname may be an IP address.</dd>
</dl>
<a name="save_path"></a><dl class="docutils">
<dt>save_path</dt>
<dd>the path where the torrent is or will be stored. Note that this may
alos be stored in resume data. If you which the save path saved in
the resume data to be used, you need to set the
flag_use_resume_save_path flag.</dd>
</dl>
<a name="resume_data"></a><dl class="docutils">
<dt>resume_data</dt>
<dd>The optional parameter, <tt class="docutils literal">resume_data</tt> can be given if up to date
@ -441,7 +454,7 @@ struct cache_status
int read_queue_size;
};
</pre>
<a name="cache_status()"></a><div class="section" id="id23">
<a name="cache_status()"></a><div class="section" id="id24">
<h2>cache_status()</h2>
<pre class="literal-block">
<strong>cache_status</strong> ();
@ -563,7 +576,7 @@ class session_proxy
<strong>session_proxy</strong> ();
};
</pre>
<a name="session_proxy()"></a><div class="section" id="id34">
<a name="session_proxy()"></a><div class="section" id="id35">
<h2>session_proxy()</h2>
<pre class="literal-block">
<strong>session_proxy</strong> ();
@ -572,7 +585,7 @@ class session_proxy
implementation object.</p>
<a name="session"></a></div>
</div>
<div class="section" id="id36">
<div class="section" id="id37">
<h1>session</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/session.hpp">libtorrent/session.hpp</a>&quot;</p>
<p>The <a class="reference external" href="reference-Session.html#session">session</a> holds all state that spans multiple torrents. Among other
@ -710,7 +723,7 @@ class session: public boost::noncopyable
};
};
</pre>
<a name="session()"></a><div class="section" id="id40">
<a name="session()"></a><div class="section" id="id41">
<h2>session()</h2>
<pre class="literal-block">
<strong>session</strong> (fingerprint const&amp; print = fingerprint(&quot;LT&quot;
@ -742,7 +755,7 @@ pass 0 as the flags parameter.</p>
<p>The <tt class="docutils literal">alert_mask</tt> is the same mask that you would send to
<a class="reference external" href="reference-Session.html#set_alert_mask()">set_alert_mask()</a>.</p>
<a name="~session()"></a></div>
<div class="section" id="id43">
<div class="section" id="id44">
<h2>~session()</h2>
<pre class="literal-block">
<strong>~session</strong> ();
@ -1027,7 +1040,7 @@ void <strong>dht_get_item</strong> (sha1_hash const&amp; target);
<p>query the DHT for an immutable item at the <tt class="docutils literal">target</tt> hash.
the result is posted as a <a class="reference external" href="reference-Alerts.html#dht_immutable_item_alert">dht_immutable_item_alert</a>.</p>
<a name="dht_get_item()"></a></div>
<div class="section" id="id98">
<div class="section" id="id99">
<h2>dht_get_item()</h2>
<pre class="literal-block">
void <strong>dht_get_item</strong> (boost::array&lt;char, 32&gt; key
@ -1049,7 +1062,7 @@ the returned hash is the key that is to be used to look the item
up agan. It's just the sha-1 hash of the bencoded form of the
structure.</p>
<a name="dht_put_item()"></a></div>
<div class="section" id="id100">
<div class="section" id="id101">
<h2>dht_put_item()</h2>
<pre class="literal-block">
void <strong>dht_put_item</strong> (boost::array&lt;char, 32&gt; key

View File

@ -55,10 +55,10 @@
<div class="contents topic" id="table-of-contents">
<p class="topic-title first">Table of contents</p>
<ul class="simple">
<li><a class="reference internal" href="#proxy-settings" id="id38">proxy_settings</a></li>
<li><a class="reference internal" href="#session-settings" id="id39">session_settings</a></li>
<li><a class="reference internal" href="#dht-settings" id="id40">dht_settings</a></li>
<li><a class="reference internal" href="#pe-settings" id="id41">pe_settings</a></li>
<li><a class="reference internal" href="#proxy-settings" id="id46">proxy_settings</a></li>
<li><a class="reference internal" href="#session-settings" id="id47">session_settings</a></li>
<li><a class="reference internal" href="#dht-settings" id="id48">dht_settings</a></li>
<li><a class="reference internal" href="#pe-settings" id="id49">pe_settings</a></li>
</ul>
</div>
<a name="proxy_settings"></a><div class="section" id="proxy-settings">
@ -71,6 +71,17 @@ struct proxy_settings
{
<strong>proxy_settings</strong> ();
enum proxy_type
{
none,
socks4,
socks5,
socks5_pw,
http,
http_pw,
i2p_proxy,
};
std::string hostname;
std::string username;
std::string password;
@ -87,6 +98,65 @@ struct proxy_settings
</pre>
<p>defaults constructs proxy settings, initializing it to the default
settings.</p>
<a name="proxy_type"></a></div>
<div class="section" id="enum-proxy-type">
<h2>enum proxy_type</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/session_settings.hpp">libtorrent/session_settings.hpp</a>&quot;</p>
<table border="1" class="docutils">
<colgroup>
<col width="11%" />
<col width="7%" />
<col width="81%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">name</th>
<th class="head">value</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>none</td>
<td>0</td>
<td>This is the default, no proxy server is used, all other fields are
ignored.</td>
</tr>
<tr><td>socks4</td>
<td>1</td>
<td>The server is assumed to be a <a class="reference external" href="http://www.ufasoft.com/doc/socks4_protocol.htm">SOCKS4 server</a> that requires a
username.</td>
</tr>
<tr><td>socks5</td>
<td>2</td>
<td>The server is assumed to be a SOCKS5 server (<a class="reference external" href="http://www.faqs.org/rfcs/rfc1928.html">RFC 1928</a>) that does
not require any authentication. The username and password are
ignored.</td>
</tr>
<tr><td>socks5_pw</td>
<td>3</td>
<td>The server is assumed to be a SOCKS5 server that supports plain
text username and password authentication (<a class="reference external" href="http://www.faqs.org/rfcs/rfc1929.html">RFC 1929</a>). The
username and password specified may be sent to the proxy if it
requires.</td>
</tr>
<tr><td>http</td>
<td>4</td>
<td>The server is assumed to be an HTTP proxy. If the transport used
for the connection is non-HTTP, the server is assumed to support
the <a class="reference external" href="http://tools.ietf.org/html/draft-luotonen-web-proxy-tunneling-01">CONNECT</a> method. i.e. for web seeds and HTTP trackers, a plain
proxy will suffice. The proxy is assumed to not require
authorization. The username and password will not be used.</td>
</tr>
<tr><td>http_pw</td>
<td>5</td>
<td>The server is assumed to be an HTTP proxy that requires user
authorization. The username and password will be sent to the proxy.</td>
</tr>
<tr><td>i2p_proxy</td>
<td>6</td>
<td>route through a i2p SAM proxy</td>
</tr>
</tbody>
</table>
<a name="hostname"></a><dl class="docutils">
<dt>hostname</dt>
<dd>the name or IP of the proxy server. <tt class="docutils literal">port</tt> is the port number the
@ -101,7 +171,7 @@ and password fields must be set to the credentials for the proxy.</dd>
</dl>
<a name="type"></a><dl class="docutils">
<dt>type</dt>
<dd>tells libtorrent what kind of proxy server it is. See proxy_type
<dd>tells libtorrent what kind of proxy server it is. See <a class="reference external" href="reference-Settings.html#proxy_type">proxy_type</a>
enum for options</dd>
</dl>
<a name="port"></a><dl class="docutils">
@ -135,6 +205,27 @@ struct session_settings
LIBTORRENT_VERSION);
<strong>~session_settings</strong> ();
enum suggest_mode_t
{
no_piece_suggestions,
suggest_read_cache,
};
enum choking_algorithm_t
{
fixed_slots_choker,
auto_expand_choker,
rate_based_choker,
bittyrant_choker,
};
enum seed_choking_algorithm_t
{
round_robin,
fastest_upload,
anti_leech,
};
enum io_buffer_mode_t
{
enable_os_cache,
@ -187,7 +278,6 @@ struct session_settings
int num_want;
int initial_picker_threshold;
int allowed_fast_set_size;
suggest_read_cache = 1 };
int suggest_mode;
int max_queued_disk_bytes;
int max_queued_disk_bytes_low_watermark;
@ -198,9 +288,7 @@ struct session_settings
int send_buffer_low_watermark;
int send_buffer_watermark;
int send_buffer_watermark_factor;
bittyrant_choker };
int choking_algorithm;
anti_leech };
int seed_choking_algorithm;
bool use_parole_mode;
int cache_size;
@ -343,6 +431,118 @@ struct session_settings
<strong>~session_settings</strong> ();
</pre>
<p>initializes the <a class="reference external" href="reference-Settings.html#session_settings">session_settings</a> to the default settings.</p>
<a name="suggest_mode_t"></a></div>
<div class="section" id="enum-suggest-mode-t">
<h2>enum suggest_mode_t</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/session_settings.hpp">libtorrent/session_settings.hpp</a>&quot;</p>
<table border="1" class="docutils">
<colgroup>
<col width="23%" />
<col width="7%" />
<col width="69%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">name</th>
<th class="head">value</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>no_piece_suggestions</td>
<td>0</td>
<td>the default. will not send out suggest messages.</td>
</tr>
<tr><td>suggest_read_cache</td>
<td>1</td>
<td>send out suggest messages for the most recent pieces that are in
the read cache.</td>
</tr>
</tbody>
</table>
<a name="choking_algorithm_t"></a></div>
<div class="section" id="enum-choking-algorithm-t">
<h2>enum choking_algorithm_t</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/session_settings.hpp">libtorrent/session_settings.hpp</a>&quot;</p>
<table border="1" class="docutils">
<colgroup>
<col width="21%" />
<col width="7%" />
<col width="72%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">name</th>
<th class="head">value</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>fixed_slots_choker</td>
<td>0</td>
<td>the traditional choker with a fixed number of unchoke slots, as
specified by session::set_max_uploads()..</td>
</tr>
<tr><td>auto_expand_choker</td>
<td>1</td>
<td>opens at least the number of slots as specified by
session::set_max_uploads() but opens up more slots if the upload
capacity is not saturated. This unchoker will work just like the
<tt class="docutils literal">fixed_slot_choker</tt> if there's no global upload rate limit set.</td>
</tr>
<tr><td>rate_based_choker</td>
<td>2</td>
<td>opens up unchoke slots based on the upload rate achieved to peers.
The more slots that are opened, the marginal upload rate required
to open up another slot increases.</td>
</tr>
<tr><td>bittyrant_choker</td>
<td>3</td>
<td>attempts to optimize download rate by finding the reciprocation
rate of each peer individually and prefers peers that gives the
highest <em>return on investment</em>. It still allocates all upload
capacity, but shuffles it around to the best peers first. For this
choker to be efficient, you need to set a global upload rate limit
<a class="reference external" href="reference-Settings.html#upload_rate_limit">session_settings::upload_rate_limit</a>. For more information about
this choker, see the <a class="reference external" href="http://bittyrant.cs.washington.edu/#papers">paper</a>.</td>
</tr>
</tbody>
</table>
<a name="seed_choking_algorithm_t"></a></div>
<div class="section" id="enum-seed-choking-algorithm-t">
<h2>enum seed_choking_algorithm_t</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/session_settings.hpp">libtorrent/session_settings.hpp</a>&quot;</p>
<table border="1" class="docutils">
<colgroup>
<col width="17%" />
<col width="8%" />
<col width="75%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">name</th>
<th class="head">value</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>round_robin</td>
<td>0</td>
<td>round-robins the peers that are unchoked when seeding. This
distributes the upload bandwidht uniformly and fairly. It minimizes
the ability for a peer to download everything without
redistributing it.</td>
</tr>
<tr><td>fastest_upload</td>
<td>1</td>
<td>unchokes the peers we can send to the fastest. This might be a bit
more reliable in utilizing all available capacity.</td>
</tr>
<tr><td>anti_leech</td>
<td>2</td>
<td>prioritizes peers who have just started or are just about to finish
the download. The intention is to force peers in the middle of the
download to trade with each other.</td>
</tr>
</tbody>
</table>
<a name="io_buffer_mode_t"></a></div>
<div class="section" id="enum-io-buffer-mode-t">
<h2>enum io_buffer_mode_t</h2>
@ -661,18 +861,13 @@ rarest first order.</dd>
<dd>the number of allowed pieces to send to choked peers that supports the
fast extensions</dd>
</dl>
<a name="}"></a><dl class="docutils">
<dt>}</dt>
<dd>send out suggest messages for the most recent pieces that are in
the read cache.</dd>
</dl>
<a name="suggest_mode"></a><dl class="docutils">
<dt>suggest_mode</dt>
<dd><p class="first">this determines which pieces will be suggested to peers suggest read
cache will make libtorrent suggest pieces that are fresh in the disk
read cache, to potentially lower disk access and increase the cache
hit ratio</p>
<p class="last">for options, see suggest_mode_t.</p>
<p class="last">for options, see <a class="reference external" href="reference-Settings.html#suggest_mode_t">suggest_mode_t</a>.</p>
</dd>
</dl>
<a name="max_queued_disk_bytes"></a><dl class="docutils">
@ -757,36 +952,17 @@ performance and disk throughput. Setting it too high may waste RAM and
create a bias towards read jobs over write jobs.</p>
</dd>
</dl>
<a name="}"></a><dl class="docutils">
<dt>}</dt>
<dd>opens up unchoke slots based on the upload rate achieved to peers.
The more slots that are opened, the marginal upload rate required
to open up another slot increases.
attempts to optimize download rate by finding the reciprocation
rate of each peer individually and prefers peers that gives the
highest <em>return on investment</em>. It still allocates all upload
capacity, but shuffles it around to the best peers first. For this
choker to be efficient, you need to set a global upload rate limit
<a class="reference external" href="reference-Settings.html#upload_rate_limit">session_settings::upload_rate_limit</a>. For more information about
this choker, see the <a class="reference external" href="http://bittyrant.cs.washington.edu/#papers">paper</a>.</dd>
</dl>
<a name="choking_algorithm"></a><dl class="docutils">
<dt>choking_algorithm</dt>
<dd>specifies which algorithm to use to determine which peers to unchoke.
This setting replaces the deprecated settings <tt class="docutils literal">auto_upload_slots</tt>
and <tt class="docutils literal">auto_upload_slots_rate_based</tt>. For options, see
choking_algorithm_t.</dd>
</dl>
<a name="}"></a><dl class="docutils">
<dt>}</dt>
<dd>prioritizes peers who have just started or are just about to finish
the download. The intention is to force peers in the middle of the
download to trade with each other.</dd>
<a class="reference external" href="reference-Settings.html#choking_algorithm_t">choking_algorithm_t</a>.</dd>
</dl>
<a name="seed_choking_algorithm"></a><dl class="docutils">
<dt>seed_choking_algorithm</dt>
<dd>controls the seeding unchoke behavior. For options, see
seed_choking_algorithm_t.</dd>
<a class="reference external" href="reference-Settings.html#seed_choking_algorithm_t">seed_choking_algorithm_t</a>.</dd>
</dl>
<a name="use_parole_mode"></a><dl class="docutils">
<dt>use_parole_mode</dt>
@ -1773,7 +1949,7 @@ struct dht_settings
bool ignore_dark_internet;
};
</pre>
<a name="dht_settings()"></a><div class="section" id="id26">
<a name="dht_settings()"></a><div class="section" id="id34">
<h2>dht_settings()</h2>
<pre class="literal-block">
<strong>dht_settings</strong> ();
@ -1893,7 +2069,7 @@ struct pe_settings
bool prefer_rc4;
};
</pre>
<a name="pe_settings()"></a><div class="section" id="id30">
<a name="pe_settings()"></a><div class="section" id="id38">
<h2>pe_settings()</h2>
<pre class="literal-block">
<strong>pe_settings</strong> ();

View File

@ -201,7 +201,7 @@ class file_storage
void <strong>set_name</strong> (std::string const&amp; n);
const std::string&amp; <strong>name</strong> () const;
void <strong>swap</strong> (file_storage&amp; ti);
void <strong>optimize</strong> (int pad_file_limit = -1, int alignment = 0x10000);
void <strong>optimize</strong> (int pad_file_limit = -1, int alignment = -1);
size_type <strong>file_size</strong> (int index) const;
sha1_hash <strong>hash</strong> (int index) const;
std::string <strong>file_name</strong> (int index) const;
@ -377,11 +377,14 @@ void <strong>swap</strong> (file_storage&amp; ti);
<div class="section" id="optimize">
<h2>optimize()</h2>
<pre class="literal-block">
void <strong>optimize</strong> (int pad_file_limit = -1, int alignment = 0x10000);
void <strong>optimize</strong> (int pad_file_limit = -1, int alignment = -1);
</pre>
<p>if pad_file_limit &gt;= 0, files larger than
that limit will be padded, default is to
not add any padding</p>
<p>if pad_file_limit &gt;= 0, files larger than that limit will be padded,
default is to not add any padding (-1). The alignment specifies the
alignment files should be padded to. This defaults to the piece size
(-1) but it may also make sense to set it to 16 kiB, or something
divisible by 16 kiB.
If pad_file_limit is 0, every file will be padded (except empty ones).</p>
<a name="mtime()"></a>
<a name="hash()"></a>
<a name="symlink()"></a>

View File

@ -24,12 +24,12 @@
<span style="color: #f77">2 important</span>
<span style="color: #3c3">6 relevant</span>
<span style="color: #77f">13 feasible</span>
<span style="color: #999">45 notes</span>
<table width="100%" border="1" style="border-collapse: collapse;"><tr style="background: #fdd"><td>relevance&nbsp;4</td><td><a href="javascript:expand(0)">../src/session_impl.cpp:666</a></td><td>in order to support SSL over uTP, the utp_socket manager either needs to be able to receive packets on multiple ports, or we need to peek into the first few bytes the payload stream of a socket to determine whether or not it's an SSL connection. (The former is simpler but won't do as well with NATs)</td></tr><tr id="0" style="display: none;" colspan="3"><td colspan="3"><h2>in order to support SSL over uTP, the utp_socket manager either
<span style="color: #999">46 notes</span>
<table width="100%" border="1" style="border-collapse: collapse;"><tr style="background: #fdd"><td>relevance&nbsp;4</td><td><a href="javascript:expand(0)">../src/session_impl.cpp:664</a></td><td>in order to support SSL over uTP, the utp_socket manager either needs to be able to receive packets on multiple ports, or we need to peek into the first few bytes the payload stream of a socket to determine whether or not it's an SSL connection. (The former is simpler but won't do as well with NATs)</td></tr><tr id="0" style="display: none;" colspan="3"><td colspan="3"><h2>in order to support SSL over uTP, the utp_socket manager either
needs to be able to receive packets on multiple ports, or we need to
peek into the first few bytes the payload stream of a socket to determine
whether or not it's an SSL connection. (The former is simpler but won't
do as well with NATs)</h2><h4>../src/session_impl.cpp:666</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> , m_optimistic_unchoke_time_scaler(0)
do as well with NATs)</h2><h4>../src/session_impl.cpp:664</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> , m_optimistic_unchoke_time_scaler(0)
, m_disconnect_time_scaler(90)
, m_auto_scrape_time_scaler(180)
, m_next_explicit_cache_torrent(0)
@ -131,7 +131,7 @@ namespace libtorrent
case integer16: *((boost::uint16_t*)dest) = boost::uint16_t(val); break;
case integer: *((int*)dest) = int(val); break;
case size_integer: *((size_type*)dest) = size_type(val); break;
</pre></td></tr><tr style="background: #fcc"><td>relevance&nbsp;3</td><td><a href="javascript:expand(2)">../src/torrent.cpp:6170</a></td><td>if peer is a really good peer, maybe we shouldn't disconnect it</td></tr><tr id="2" style="display: none;" colspan="3"><td colspan="3"><h2>if peer is a really good peer, maybe we shouldn't disconnect it</h2><h4>../src/torrent.cpp:6170</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> return false;
</pre></td></tr><tr style="background: #fcc"><td>relevance&nbsp;3</td><td><a href="javascript:expand(2)">../src/torrent.cpp:6244</a></td><td>if peer is a really good peer, maybe we shouldn't disconnect it</td></tr><tr id="2" style="display: none;" colspan="3"><td colspan="3"><h2>if peer is a really good peer, maybe we shouldn't disconnect it</h2><h4>../src/torrent.cpp:6244</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> return false;
}
TORRENT_ASSERT(m_connections.find(p) == m_connections.end());
m_connections.insert(p);
@ -182,9 +182,9 @@ namespace libtorrent
return m_connections.size() &lt; m_max_connections
&amp;&amp; !is_paused()
&amp;&amp; ((m_state != torrent_status::checking_files
</pre></td></tr><tr style="background: #fcc"><td>relevance&nbsp;3</td><td><a href="javascript:expand(3)">../src/web_peer_connection.cpp:493</a></td><td>just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the following</td></tr><tr id="3" style="display: none;" colspan="3"><td colspan="3"><h2>just make this peer not have the pieces
</pre></td></tr><tr style="background: #fcc"><td>relevance&nbsp;3</td><td><a href="javascript:expand(3)">../src/web_peer_connection.cpp:580</a></td><td>just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the following</td></tr><tr id="3" style="display: none;" colspan="3"><td colspan="3"><h2>just make this peer not have the pieces
associated with the file we just requested. Only
when it doesn't have any of the file do the following</h2><h4>../src/web_peer_connection.cpp:493</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
when it doesn't have any of the file do the following</h2><h4>../src/web_peer_connection.cpp:580</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
++m_num_responses;
if (m_parser.connection_close())
@ -286,9 +286,9 @@ when it doesn't have any of the file do the following</h2><h4>../src/web_peer_co
error = "out of memory: ";
error += e.what();
return true;
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(5)">../src/policy.cpp:155</a></td><td>this could be optimized if SSE 4.2 is available. It could also be optimized given that we have a fixed length</td></tr><tr id="5" style="display: none;" colspan="3"><td colspan="3"><h2>this could be optimized if SSE 4.2 is
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(5)">../src/policy.cpp:153</a></td><td>this could be optimized if SSE 4.2 is available. It could also be optimized given that we have a fixed length</td></tr><tr id="5" style="display: none;" colspan="3"><td colspan="3"><h2>this could be optimized if SSE 4.2 is
available. It could also be optimized given
that we have a fixed length</h2><h4>../src/policy.cpp:155</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // 4. if IPs are not in the same /16, mask the IPs by 0xffff5555, hash them
that we have a fixed length</h2><h4>../src/policy.cpp:153</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // 4. if IPs are not in the same /16, mask the IPs by 0xffff5555, hash them
// ordered, lowest first.
//
// * for IPv6 peers, just use the first 64 bits and widen the masks.
@ -339,7 +339,7 @@ that we have a fixed length</h2><h4>../src/policy.cpp:155</h4><pre style="backgr
crc.process_bytes((char const*)&amp;b1[0], 16);
crc.process_bytes((char const*)&amp;b2[0], 16);
}
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(6)">../src/torrent.cpp:635</a></td><td>post alert</td></tr><tr id="6" style="display: none;" colspan="3"><td colspan="3"><h2>post alert</h2><h4>../src/torrent.cpp:635</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> state_updated();
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(6)">../src/torrent.cpp:634</a></td><td>post alert</td></tr><tr id="6" style="display: none;" colspan="3"><td colspan="3"><h2>post alert</h2><h4>../src/torrent.cpp:634</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> state_updated();
set_state(torrent_status::downloading);
@ -390,7 +390,9 @@ that we have a fixed length</h2><h4>../src/policy.cpp:155</h4><pre style="backgr
}
void torrent::start()
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(7)">../src/web_peer_connection.cpp:546</a></td><td>create a mapping of file-index to redirection URLs. Use that to form URLs instead. Support to reconnect to a new server without destructing this peer_connection</td></tr><tr id="7" style="display: none;" colspan="3"><td colspan="3"><h2>create a mapping of file-index to redirection URLs. Use that to form URLs instead. Support to reconnect to a new server without destructing this peer_connection</h2><h4>../src/web_peer_connection.cpp:546</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> t-&gt;remove_web_seed(this);
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(7)">../src/web_peer_connection.cpp:633</a></td><td>create a mapping of file-index to redirection URLs. Use that to form URLs instead. Support to reconnect to a new server without destructing this peer_connection</td></tr><tr id="7" style="display: none;" colspan="3"><td colspan="3"><h2>create a mapping of file-index to redirection URLs. Use that to form
URLs instead. Support to reconnect to a new server without destructing this
peer_connection</h2><h4>../src/web_peer_connection.cpp:633</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> t-&gt;remove_web_seed(this);
disconnect(errors::missing_location, 2);
#ifdef TORRENT_DEBUG
TORRENT_ASSERT(m_statistics.last_payload_downloaded()
@ -441,7 +443,7 @@ that we have a fixed length</h2><h4>../src/policy.cpp:155</h4><pre style="backgr
return;
}
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(8)">../src/kademlia/node.cpp:68</a></td><td>make this configurable in dht_settings</td></tr><tr id="8" style="display: none;" colspan="3"><td colspan="3"><h2>make this configurable in dht_settings</h2><h4>../src/kademlia/node.cpp:68</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">#include "libtorrent/kademlia/rpc_manager.hpp"
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(8)">../src/kademlia/node.cpp:66</a></td><td>make this configurable in dht_settings</td></tr><tr id="8" style="display: none;" colspan="3"><td colspan="3"><h2>make this configurable in dht_settings</h2><h4>../src/kademlia/node.cpp:66</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">#include "libtorrent/kademlia/rpc_manager.hpp"
#include "libtorrent/kademlia/routing_table.hpp"
#include "libtorrent/kademlia/node.hpp"
#include "libtorrent/kademlia/dht_observer.hpp"
@ -492,9 +494,9 @@ void purge_peers(std::set&lt;peer_entry&gt;&amp; peers)
void nop() {}
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(9)">../src/kademlia/node_id.cpp:137</a></td><td>this could be optimized if SSE 4.2 is available. It could also be optimized given that we have a fixed length</td></tr><tr id="9" style="display: none;" colspan="3"><td colspan="3"><h2>this could be optimized if SSE 4.2 is
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(9)">../src/kademlia/node_id.cpp:135</a></td><td>this could be optimized if SSE 4.2 is available. It could also be optimized given that we have a fixed length</td></tr><tr id="9" style="display: none;" colspan="3"><td colspan="3"><h2>this could be optimized if SSE 4.2 is
available. It could also be optimized given
that we have a fixed length</h2><h4>../src/kademlia/node_id.cpp:137</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> b6 = ip_.to_v6().to_bytes();
that we have a fixed length</h2><h4>../src/kademlia/node_id.cpp:135</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> b6 = ip_.to_v6().to_bytes();
ip = &amp;b6[0];
num_octets = 8;
mask = v6mask;
@ -545,8 +547,8 @@ bool verify_id(node_id const&amp; nid, address const&amp; source_ip)
if (is_local(source_ip)) return true;
node_id h = generate_id_impl(source_ip, nid[19]);
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(10)">../src/http_seed_connection.cpp:117</a></td><td>in chunked encoding mode, this assert won't hold. the chunk headers should be subtracted from the receive_buffer_size</td></tr><tr id="10" style="display: none;" colspan="3"><td colspan="3"><h2>in chunked encoding mode, this assert won't hold.
the chunk headers should be subtracted from the receive_buffer_size</h2><h4>../src/http_seed_connection.cpp:117</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> boost::optional&lt;piece_block_progress&gt;
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(10)">../src/http_seed_connection.cpp:115</a></td><td>in chunked encoding mode, this assert won't hold. the chunk headers should be subtracted from the receive_buffer_size</td></tr><tr id="10" style="display: none;" colspan="3"><td colspan="3"><h2>in chunked encoding mode, this assert won't hold.
the chunk headers should be subtracted from the receive_buffer_size</h2><h4>../src/http_seed_connection.cpp:115</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> boost::optional&lt;piece_block_progress&gt;
http_seed_connection::downloading_piece_progress() const
{
if (m_requests.empty())
@ -597,8 +599,8 @@ the chunk headers should be subtracted from the receive_buffer_size</h2><h4>../s
std::string request;
request.reserve(400);
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(11)">../src/peer_connection.cpp:2581</a></td><td>peers should really be corked/uncorked outside of all completed disk operations</td></tr><tr id="11" style="display: none;" colspan="3"><td colspan="3"><h2>peers should really be corked/uncorked outside of
all completed disk operations</h2><h4>../src/peer_connection.cpp:2581</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> }
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(11)">../src/peer_connection.cpp:2587</a></td><td>peers should really be corked/uncorked outside of all completed disk operations</td></tr><tr id="11" style="display: none;" colspan="3"><td colspan="3"><h2>peers should really be corked/uncorked outside of
all completed disk operations</h2><h4>../src/peer_connection.cpp:2587</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> }
if (is_disconnecting()) return;
@ -649,8 +651,8 @@ all completed disk operations</h2><h4>../src/peer_connection.cpp:2581</h4><pre s
return;
}
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(12)">../src/session_impl.cpp:5544</a></td><td>report the proper address of the router as the source IP of this understanding of our external address, instead of the empty address</td></tr><tr id="12" style="display: none;" colspan="3"><td colspan="3"><h2>report the proper address of the router as the source IP of
this understanding of our external address, instead of the empty address</h2><h4>../src/session_impl.cpp:5544</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> void session_impl::on_port_mapping(int mapping, address const&amp; ip, int port
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(12)">../src/session_impl.cpp:5550</a></td><td>report the proper address of the router as the source IP of this understanding of our external address, instead of the empty address</td></tr><tr id="12" style="display: none;" colspan="3"><td colspan="3"><h2>report the proper address of the router as the source IP of
this understanding of our external address, instead of the empty address</h2><h4>../src/session_impl.cpp:5550</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> void session_impl::on_port_mapping(int mapping, address const&amp; ip, int port
, error_code const&amp; ec, int map_transport)
{
TORRENT_ASSERT(is_network_thread());
@ -701,9 +703,9 @@ this understanding of our external address, instead of the empty address</h2><h4
{
// INVARIANT_CHECK;
TORRENT_ASSERT(is_network_thread());
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(13)">../src/session_impl.cpp:6333</a></td><td>we only need to do this if our global IPv4 address has changed since the DHT (currently) only supports IPv4. Since restarting the DHT is kind of expensive, it would be nice to not do it unnecessarily</td></tr><tr id="13" style="display: none;" colspan="3"><td colspan="3"><h2>we only need to do this if our global IPv4 address has changed
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(13)">../src/session_impl.cpp:6339</a></td><td>we only need to do this if our global IPv4 address has changed since the DHT (currently) only supports IPv4. Since restarting the DHT is kind of expensive, it would be nice to not do it unnecessarily</td></tr><tr id="13" style="display: none;" colspan="3"><td colspan="3"><h2>we only need to do this if our global IPv4 address has changed
since the DHT (currently) only supports IPv4. Since restarting the DHT
is kind of expensive, it would be nice to not do it unnecessarily</h2><h4>../src/session_impl.cpp:6333</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">#endif
is kind of expensive, it would be nice to not do it unnecessarily</h2><h4>../src/session_impl.cpp:6339</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">#endif
if (!m_external_ip.cast_vote(ip, source_type, source)) return;
@ -754,11 +756,11 @@ is kind of expensive, it would be nice to not do it unnecessarily</h2><h4>../src
#ifdef TORRENT_DISK_STATS
TORRENT_ASSERT(m_buffer_allocations &gt;= 0);
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(14)">../src/torrent.cpp:1032</a></td><td>make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything up to the highest written piece in each file</td></tr><tr id="14" style="display: none;" colspan="3"><td colspan="3"><h2>make this depend on the error and on the filesystem the
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(14)">../src/torrent.cpp:1031</a></td><td>make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything up to the highest written piece in each file</td></tr><tr id="14" style="display: none;" colspan="3"><td colspan="3"><h2>make this depend on the error and on the filesystem the
files are being downloaded to. If the error is no_space_left_on_device
and the filesystem doesn't support sparse files, only zero the priorities
of the pieces that are at the tails of all files, leaving everything
up to the highest written piece in each file</h2><h4>../src/torrent.cpp:1032</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (c) c-&gt;disconnect(errors::no_memory);
up to the highest written piece in each file</h2><h4>../src/torrent.cpp:1031</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (c) c-&gt;disconnect(errors::no_memory);
return;
}
@ -809,8 +811,8 @@ up to the highest written piece in each file</h2><h4>../src/torrent.cpp:1032</h4
{
int size = m_torrent_file-&gt;piece_size(r.piece);
if (rp-&gt;fail)
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(15)">../src/torrent.cpp:5431</a></td><td>save the send_stats state instead of throwing them away it may pose an issue when downgrading though</td></tr><tr id="15" style="display: none;" colspan="3"><td colspan="3"><h2>save the send_stats state instead of throwing them away
it may pose an issue when downgrading though</h2><h4>../src/torrent.cpp:5431</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> ? (1 &lt;&lt; k) : 0;
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(15)">../src/torrent.cpp:5505</a></td><td>save the send_stats state instead of throwing them away it may pose an issue when downgrading though</td></tr><tr id="15" style="display: none;" colspan="3"><td colspan="3"><h2>save the send_stats state instead of throwing them away
it may pose an issue when downgrading though</h2><h4>../src/torrent.cpp:5505</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> ? (1 &lt;&lt; k) : 0;
bitmask.append(1, v);
TORRENT_ASSERT(bits == 8 || j == num_bitmask_bytes - 1);
}
@ -861,9 +863,9 @@ it may pose an issue when downgrading though</h2><h4>../src/torrent.cpp:5431</h4
// write have bitmask
// the pieces string has one byte per piece. Each
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(16)">../src/torrent.cpp:6338</a></td><td>should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces for all peers though</td></tr><tr id="16" style="display: none;" colspan="3"><td colspan="3"><h2>should disconnect all peers that have the pieces we have
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(16)">../src/torrent.cpp:6412</a></td><td>should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces for all peers though</td></tr><tr id="16" style="display: none;" colspan="3"><td colspan="3"><h2>should disconnect all peers that have the pieces we have
not just seeds. It would be pretty expensive to check all pieces
for all peers though</h2><h4>../src/torrent.cpp:6338</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> TORRENT_ASSERT(m_state != torrent_status::finished &amp;&amp; m_state != torrent_status::seeding);
for all peers though</h2><h4>../src/torrent.cpp:6412</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> TORRENT_ASSERT(m_state != torrent_status::finished &amp;&amp; m_state != torrent_status::seeding);
set_state(torrent_status::finished);
set_queue_position(-1);
@ -914,7 +916,7 @@ for all peers though</h2><h4>../src/torrent.cpp:6338</h4><pre style="background:
// under a different limit with the auto-manager. Make sure we
// update auto-manage torrents in that case
if (m_auto_managed)
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(17)">../src/torrent_info.cpp:183</a></td><td>we might save constructing a std::string if this would take a char const* instead</td></tr><tr id="17" style="display: none;" colspan="3"><td colspan="3"><h2>we might save constructing a std::string if this would take a char const* instead</h2><h4>../src/torrent_info.cpp:183</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(17)">../src/torrent_info.cpp:181</a></td><td>we might save constructing a std::string if this would take a char const* instead</td></tr><tr id="17" style="display: none;" colspan="3"><td colspan="3"><h2>we might save constructing a std::string if this would take a char const* instead</h2><h4>../src/torrent_info.cpp:181</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
tmp_path += i[0];
tmp_path += i[1];
tmp_path += i[2];
@ -965,9 +967,9 @@ for all peers though</h2><h4>../src/torrent.cpp:6338</h4><pre style="background:
path_element.resize(max_path_len);
}
else
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(18)">../src/torrent_info.cpp:403</a></td><td>this logic should be a separate step done once the torrent is loaded, and the original filenames should be preserved!</td></tr><tr id="18" style="display: none;" colspan="3"><td colspan="3"><h2>this logic should be a separate step
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(18)">../src/torrent_info.cpp:405</a></td><td>this logic should be a separate step done once the torrent is loaded, and the original filenames should be preserved!</td></tr><tr id="18" style="display: none;" colspan="3"><td colspan="3"><h2>this logic should be a separate step
done once the torrent is loaded, and the original
filenames should be preserved!</h2><h4>../src/torrent_info.cpp:403</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
filenames should be preserved!</h2><h4>../src/torrent_info.cpp:405</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
while (*s1 != 0 || *s2 != 0)
{
c1 = to_lower(*s1);
@ -1018,8 +1020,8 @@ filenames should be preserved!</h2><h4>../src/torrent_info.cpp:403</h4><pre styl
// This is a memory optimization! Instead of having
// each entry keep a string for its filename, make it
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(19)">../src/torrent_info.cpp:439</a></td><td>once the filename renaming is removed from here this check can be removed as well</td></tr><tr id="19" style="display: none;" colspan="3"><td colspan="3"><h2>once the filename renaming is removed from here
this check can be removed as well</h2><h4>../src/torrent_info.cpp:439</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // increase the counter
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(19)">../src/torrent_info.cpp:441</a></td><td>once the filename renaming is removed from here this check can be removed as well</td></tr><tr id="19" style="display: none;" colspan="3"><td colspan="3"><h2>once the filename renaming is removed from here
this check can be removed as well</h2><h4>../src/torrent_info.cpp:441</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // increase the counter
int cnt = 0;
if (!files.insert(e.path).second)
{
@ -1070,7 +1072,7 @@ this check can be removed as well</h2><h4>../src/torrent_info.cpp:439</h4><pre s
{
TORRENT_ASSERT(leafs &gt; 0);
return (leafs &lt;&lt; 1) - 1;
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(20)">../src/kademlia/node.cpp:812</a></td><td>find_node should write directly to the response entry</td></tr><tr id="20" style="display: none;" colspan="3"><td colspan="3"><h2>find_node should write directly to the response entry</h2><h4>../src/kademlia/node.cpp:812</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(20)">../src/kademlia/node.cpp:810</a></td><td>find_node should write directly to the response entry</td></tr><tr id="20" style="display: none;" colspan="3"><td colspan="3"><h2>find_node should write directly to the response entry</h2><h4>../src/kademlia/node.cpp:810</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
TORRENT_LOG(node) &lt;&lt; " values: " &lt;&lt; reply["values"].list().size();
}
#endif
@ -1148,11 +1150,9 @@ this check can be removed as well</h2><h4>../src/torrent_info.cpp:439</h4><pre s
#endif
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(22)">../include/libtorrent/web_peer_connection.hpp:126</a></td><td>if we make this be a disk_buffer_holder instead we would save a copy sometimes use allocate_disk_receive_buffer and release_disk_receive_buffer</td></tr><tr id="22" style="display: none;" colspan="3"><td colspan="3"><h2>if we make this be a disk_buffer_holder instead
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(22)">../include/libtorrent/web_peer_connection.hpp:130</a></td><td>if we make this be a disk_buffer_holder instead we would save a copy sometimes use allocate_disk_receive_buffer and release_disk_receive_buffer</td></tr><tr id="22" style="display: none;" colspan="3"><td colspan="3"><h2>if we make this be a disk_buffer_holder instead
we would save a copy sometimes
use allocate_disk_receive_buffer and release_disk_receive_buffer</h2><h4>../include/libtorrent/web_peer_connection.hpp:126</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
bool maybe_harvest_block();
use allocate_disk_receive_buffer and release_disk_receive_buffer</h2><h4>../include/libtorrent/web_peer_connection.hpp:130</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
// returns the block currently being
// downloaded. And the progress of that
// block. If the peer isn't downloading
@ -1160,6 +1160,8 @@ use allocate_disk_receive_buffer and release_disk_receive_buffer</h2><h4>../incl
// will be invalid.
boost::optional&lt;piece_block_progress&gt; downloading_piece_progress() const;
void handle_padfile(buffer::const_interval&amp; recv_buffer);
// this has one entry per http-request
// (might be more than the bt requests)
std::deque&lt;int&gt; m_file_requests;
@ -1201,7 +1203,7 @@ use allocate_disk_receive_buffer and release_disk_receive_buffer</h2><h4>../incl
};
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(23)">../src/bt_peer_connection.cpp:643</a></td><td>this could be optimized using knuth morris pratt</td></tr><tr id="23" style="display: none;" colspan="3"><td colspan="3"><h2>this could be optimized using knuth morris pratt</h2><h4>../src/bt_peer_connection.cpp:643</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(23)">../src/bt_peer_connection.cpp:641</a></td><td>this could be optimized using knuth morris pratt</td></tr><tr id="23" style="display: none;" colspan="3"><td colspan="3"><h2>this could be optimized using knuth morris pratt</h2><h4>../src/bt_peer_connection.cpp:641</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
disconnect(errors::no_memory);
return;
}
@ -1252,7 +1254,7 @@ use allocate_disk_receive_buffer and release_disk_receive_buffer</h2><h4>../incl
// }
// no complete sync
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(24)">../src/bt_peer_connection.cpp:2112</a></td><td>if we're finished, send upload_only message</td></tr><tr id="24" style="display: none;" colspan="3"><td colspan="3"><h2>if we're finished, send upload_only message</h2><h4>../src/bt_peer_connection.cpp:2112</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (msg[5 + k / 8] &amp; (0x80 &gt;&gt; (k % 8))) bitfield_string[k] = '1';
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(24)">../src/bt_peer_connection.cpp:2110</a></td><td>if we're finished, send upload_only message</td></tr><tr id="24" style="display: none;" colspan="3"><td colspan="3"><h2>if we're finished, send upload_only message</h2><h4>../src/bt_peer_connection.cpp:2110</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (msg[5 + k / 8] &amp; (0x80 &gt;&gt; (k % 8))) bitfield_string[k] = '1';
else bitfield_string[k] = '0';
}
peer_log("==&gt; BITFIELD [ %s ]", bitfield_string.c_str());
@ -1303,8 +1305,8 @@ use allocate_disk_receive_buffer and release_disk_receive_buffer</h2><h4>../incl
? m_ses.settings().user_agent : m_ses.settings().handshake_client_version;
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(25)">../src/bt_peer_connection.cpp:3364</a></td><td>move the erasing into the loop above remove all payload ranges that has been sent</td></tr><tr id="25" style="display: none;" colspan="3"><td colspan="3"><h2>move the erasing into the loop above
remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.cpp:3364</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> for (std::vector&lt;range&gt;::iterator i = m_payloads.begin();
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(25)">../src/bt_peer_connection.cpp:3362</a></td><td>move the erasing into the loop above remove all payload ranges that has been sent</td></tr><tr id="25" style="display: none;" colspan="3"><td colspan="3"><h2>move the erasing into the loop above
remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.cpp:3362</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> for (std::vector&lt;range&gt;::iterator i = m_payloads.begin();
i != m_payloads.end(); ++i)
{
i-&gt;start -= bytes_transferred;
@ -1355,7 +1357,7 @@ remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.c
TORRENT_ASSERT(m_sent_handshake);
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(26)">../src/file.cpp:1404</a></td><td>is there any way to pre-fetch data from a file on windows?</td></tr><tr id="26" style="display: none;" colspan="3"><td colspan="3"><h2>is there any way to pre-fetch data from a file on windows?</h2><h4>../src/file.cpp:1404</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(26)">../src/file.cpp:1403</a></td><td>is there any way to pre-fetch data from a file on windows?</td></tr><tr id="26" style="display: none;" colspan="3"><td colspan="3"><h2>is there any way to pre-fetch data from a file on windows?</h2><h4>../src/file.cpp:1403</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
void file::init_file()
{
if (m_page_size != 0) return;
@ -1406,7 +1408,7 @@ remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.c
#ifdef TORRENT_DEBUG
if (m_open_mode &amp; no_buffer)
{
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(27)">../src/http_tracker_connection.cpp:99</a></td><td>support authentication (i.e. user name and password) in the URL</td></tr><tr id="27" style="display: none;" colspan="3"><td colspan="3"><h2>support authentication (i.e. user name and password) in the URL</h2><h4>../src/http_tracker_connection.cpp:99</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> , aux::session_impl const&amp; ses
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(27)">../src/http_tracker_connection.cpp:97</a></td><td>support authentication (i.e. user name and password) in the URL</td></tr><tr id="27" style="display: none;" colspan="3"><td colspan="3"><h2>support authentication (i.e. user name and password) in the URL</h2><h4>../src/http_tracker_connection.cpp:97</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> , aux::session_impl const&amp; ses
, proxy_settings const&amp; ps
, std::string const&amp; auth
#if TORRENT_USE_I2P
@ -1559,7 +1561,7 @@ remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.c
if (m_storage[m_last &amp; mask]) break;
++m_last;
m_last &amp;= 0xffff;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(30)">../src/peer_connection.cpp:988</a></td><td>this should only be peers we're trying to download from</td></tr><tr id="30" style="display: none;" colspan="3"><td colspan="3"><h2>this should only be peers we're trying to download from</h2><h4>../src/peer_connection.cpp:988</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> time_duration peer_connection::download_queue_time(int extra_bytes) const
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(30)">../src/peer_connection.cpp:986</a></td><td>this should only be peers we're trying to download from</td></tr><tr id="30" style="display: none;" colspan="3"><td colspan="3"><h2>this should only be peers we're trying to download from</h2><h4>../src/peer_connection.cpp:986</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> time_duration peer_connection::download_queue_time(int extra_bytes) const
{
boost::shared_ptr&lt;torrent&gt; t = m_torrent.lock();
TORRENT_ASSERT(t);
@ -1588,8 +1590,7 @@ remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.c
else
{
// current download rate in bytes per seconds
rate = m_statistics.transfer_rate(stat::download_payload)
+ m_statistics.transfer_rate(stat::download_protocol);
rate = m_statistics.transfer_rate(stat::download_payload);
}
// avoid division by zero
@ -1610,9 +1611,10 @@ remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.c
{
return m_have_piece;
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(31)">../src/peer_connection.cpp:2744</a></td><td>this might need something more so that once we have the metadata we can construct a full bitfield</td></tr><tr id="31" style="display: none;" colspan="3"><td colspan="3"><h2>this might need something more
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(31)">../src/peer_connection.cpp:2750</a></td><td>this might need something more so that once we have the metadata we can construct a full bitfield</td></tr><tr id="31" style="display: none;" colspan="3"><td colspan="3"><h2>this might need something more
so that once we have the metadata
we can construct a full bitfield</h2><h4>../src/peer_connection.cpp:2744</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
we can construct a full bitfield</h2><h4>../src/peer_connection.cpp:2750</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
#ifdef TORRENT_VERBOSE_LOGGING
peer_log("*** THIS IS A SEED [ p: %p ]", m_peer_info);
#endif
@ -1663,7 +1665,7 @@ we can construct a full bitfield</h2><h4>../src/peer_connection.cpp:2744</h4><pr
boost::shared_ptr&lt;torrent&gt; t = m_torrent.lock();
TORRENT_ASSERT(t);
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(32)">../src/peer_connection.cpp:2875</a></td><td>sort the allowed fast set in priority order</td></tr><tr id="32" style="display: none;" colspan="3"><td colspan="3"><h2>sort the allowed fast set in priority order</h2><h4>../src/peer_connection.cpp:2875</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // this piece index later
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(32)">../src/peer_connection.cpp:2881</a></td><td>sort the allowed fast set in priority order</td></tr><tr id="32" style="display: none;" colspan="3"><td colspan="3"><h2>sort the allowed fast set in priority order</h2><h4>../src/peer_connection.cpp:2881</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // this piece index later
m_allowed_fast.push_back(index);
// if the peer has the piece and we want
@ -1714,8 +1716,8 @@ we can construct a full bitfield</h2><h4>../src/peer_connection.cpp:2744</h4><pr
TORRENT_ASSERT(t-&gt;has_picker());
TORRENT_ASSERT(t-&gt;picker().is_requested(block));
#endif
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(33)">../src/peer_connection.cpp:4539</a></td><td>peers should really be corked/uncorked outside of all completed disk operations</td></tr><tr id="33" style="display: none;" colspan="3"><td colspan="3"><h2>peers should really be corked/uncorked outside of
all completed disk operations</h2><h4>../src/peer_connection.cpp:4539</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // this means we're in seed mode and we haven't yet
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(33)">../src/peer_connection.cpp:4547</a></td><td>peers should really be corked/uncorked outside of all completed disk operations</td></tr><tr id="33" style="display: none;" colspan="3"><td colspan="3"><h2>peers should really be corked/uncorked outside of
all completed disk operations</h2><h4>../src/peer_connection.cpp:4547</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // this means we're in seed mode and we haven't yet
// verified this piece (r.piece)
t-&gt;filesystem().async_read_and_hash(r, boost::bind(&amp;peer_connection::on_disk_read_complete
, self(), _1, _2, r), cache.second);
@ -1766,8 +1768,8 @@ all completed disk operations</h2><h4>../src/peer_connection.cpp:4539</h4><pre s
#endif
write_reject_request(r);
if (t-&gt;seed_mode()) t-&gt;leave_seed_mode(false);
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(34)">../src/policy.cpp:888</a></td><td>only allow _one_ connection to use this override at a time</td></tr><tr id="34" style="display: none;" colspan="3"><td colspan="3"><h2>only allow _one_ connection to use this
override at a time</h2><h4>../src/policy.cpp:888</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> " external: " &lt;&lt; external.external_address(m_peers[candidate]-&gt;address()) &lt;&lt;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(34)">../src/policy.cpp:886</a></td><td>only allow _one_ connection to use this override at a time</td></tr><tr id="34" style="display: none;" colspan="3"><td colspan="3"><h2>only allow _one_ connection to use this
override at a time</h2><h4>../src/policy.cpp:886</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> " external: " &lt;&lt; external.external_address(m_peers[candidate]-&gt;address()) &lt;&lt;
" t: " &lt;&lt; (session_time - m_peers[candidate]-&gt;last_connected) &lt;&lt;
" ]\n";
}
@ -1818,7 +1820,7 @@ override at a time</h2><h4>../src/policy.cpp:888</h4><pre style="background: #f6
{
iter = std::lower_bound(
m_peers.begin(), m_peers.end()
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(35)">../src/session_impl.cpp:1767</a></td><td>recalculate all connect candidates for all torrents</td></tr><tr id="35" style="display: none;" colspan="3"><td colspan="3"><h2>recalculate all connect candidates for all torrents</h2><h4>../src/session_impl.cpp:1767</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // #error closing the udp socket here means that
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(35)">../src/session_impl.cpp:1765</a></td><td>recalculate all connect candidates for all torrents</td></tr><tr id="35" style="display: none;" colspan="3"><td colspan="3"><h2>recalculate all connect candidates for all torrents</h2><h4>../src/session_impl.cpp:1765</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // #error closing the udp socket here means that
// the uTP connections cannot be closed gracefully
m_udp_socket.close();
m_external_udp_port = 0;
@ -1869,7 +1871,7 @@ override at a time</h2><h4>../src/policy.cpp:888</h4><pre style="background: #f6
template &lt;class Socket&gt;
void static set_socket_buffer_size(Socket&amp; s, session_settings const&amp; sett, error_code&amp; ec)
{
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(36)">../src/session_impl.cpp:3236</a></td><td>have a separate list for these connections, instead of having to loop through all of them</td></tr><tr id="36" style="display: none;" colspan="3"><td colspan="3"><h2>have a separate list for these connections, instead of having to loop through all of them</h2><h4>../src/session_impl.cpp:3236</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // --------------------------------------------------------------
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(36)">../src/session_impl.cpp:3238</a></td><td>have a separate list for these connections, instead of having to loop through all of them</td></tr><tr id="36" style="display: none;" colspan="3"><td colspan="3"><h2>have a separate list for these connections, instead of having to loop through all of them</h2><h4>../src/session_impl.cpp:3238</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // --------------------------------------------------------------
if (!m_paused) m_auto_manage_time_scaler--;
if (m_auto_manage_time_scaler &lt; 0)
{
@ -1913,14 +1915,14 @@ override at a time</h2><h4>../src/policy.cpp:888</h4><pre style="background: #f6
int num_checking = 0;
int num_queued = 0;
#if TORRENT_DEBUG_STREAMING &gt; 0
printf("\033[2J\033[0;0H");
#endif
for (torrent_map::iterator i = m_torrents.begin();
i != m_torrents.end();)
{
torrent&amp; t = *i-&gt;second;
TORRENT_ASSERT(!t.is_aborted());
if (t.statistics().upload_rate() * 11 / 10 &gt; t.upload_limit())
++congested_torrents;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(37)">../src/session_impl.cpp:4299</a></td><td>allow extensions to sort torrents for queuing</td></tr><tr id="37" style="display: none;" colspan="3"><td colspan="3"><h2>allow extensions to sort torrents for queuing</h2><h4>../src/session_impl.cpp:4299</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (t-&gt;is_auto_managed() &amp;&amp; !t-&gt;has_error())
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(37)">../src/session_impl.cpp:4306</a></td><td>allow extensions to sort torrents for queuing</td></tr><tr id="37" style="display: none;" colspan="3"><td colspan="3"><h2>allow extensions to sort torrents for queuing</h2><h4>../src/session_impl.cpp:4306</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (t-&gt;is_auto_managed() &amp;&amp; !t-&gt;has_error())
{
TORRENT_ASSERT(t-&gt;m_resume_data_loaded || !t-&gt;valid_metadata());
// this torrent is auto managed, add it to
@ -1971,9 +1973,9 @@ override at a time</h2><h4>../src/policy.cpp:888</h4><pre style="background: #f6
void session_impl::recalculate_optimistic_unchoke_slots()
{
TORRENT_ASSERT(is_network_thread());
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(38)">../src/session_impl.cpp:4464</a></td><td>use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections</td></tr><tr id="38" style="display: none;" colspan="3"><td colspan="3"><h2>use a lower limit than m_settings.connections_limit
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(38)">../src/session_impl.cpp:4471</a></td><td>use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections</td></tr><tr id="38" style="display: none;" colspan="3"><td colspan="3"><h2>use a lower limit than m_settings.connections_limit
to allocate the to 10% or so of connection slots for incoming
connections</h2><h4>../src/session_impl.cpp:4464</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
connections</h2><h4>../src/session_impl.cpp:4471</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
if (m_boost_connections &gt; max_connections)
{
m_boost_connections -= max_connections;
@ -2024,7 +2026,7 @@ connections</h2><h4>../src/session_impl.cpp:4464</h4><pre style="background: #f6
int num_attempts = 1;
if (!t.is_finished())
{
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(39)">../src/session_impl.cpp:4498</a></td><td>make this bias configurable</td></tr><tr id="39" style="display: none;" colspan="3"><td colspan="3"><h2>make this bias configurable</h2><h4>../src/session_impl.cpp:4498</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"></pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(40)">../src/session_impl.cpp:4499</a></td><td>also take average_peers into account, to create a bias for downloading torrents with < average peers</td></tr><tr id="40" style="display: none;" colspan="3"><td colspan="3"><h2>also take average_peers into account, to create a bias for downloading torrents with < average peers</h2><h4>../src/session_impl.cpp:4499</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> average_peers = num_downloads_peers / num_downloads;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(39)">../src/session_impl.cpp:4505</a></td><td>make this bias configurable</td></tr><tr id="39" style="display: none;" colspan="3"><td colspan="3"><h2>make this bias configurable</h2><h4>../src/session_impl.cpp:4505</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"></pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(40)">../src/session_impl.cpp:4506</a></td><td>also take average_peers into account, to create a bias for downloading torrents with < average peers</td></tr><tr id="40" style="display: none;" colspan="3"><td colspan="3"><h2>also take average_peers into account, to create a bias for downloading torrents with < average peers</h2><h4>../src/session_impl.cpp:4506</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> average_peers = num_downloads_peers / num_downloads;
if (m_next_connect_torrent == m_torrents.end())
m_next_connect_torrent = m_torrents.begin();
@ -2075,8 +2077,8 @@ connections</h2><h4>../src/session_impl.cpp:4464</h4><pre style="background: #f6
if (max_connections == 0) return;
if (num_connections() &gt;= m_settings.connections_limit) return;
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(41)">../src/session_impl.cpp:4609</a></td><td>post a message to have this happen immediately instead of waiting for the next tick</td></tr><tr id="41" style="display: none;" colspan="3"><td colspan="3"><h2>post a message to have this happen
immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp:4609</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(41)">../src/session_impl.cpp:4616</a></td><td>post a message to have this happen immediately instead of waiting for the next tick</td></tr><tr id="41" style="display: none;" colspan="3"><td colspan="3"><h2>post a message to have this happen
immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp:4616</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
// we've unchoked this peer, and it hasn't reciprocated
// we may want to increase our estimated reciprocation rate
p-&gt;increase_est_reciprocation_rate();
@ -2127,7 +2129,7 @@ immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp
prev = i;
}
#endif
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(42)">../src/session_impl.cpp:4643</a></td><td>make configurable</td></tr><tr id="42" style="display: none;" colspan="3"><td colspan="3"><h2>make configurable</h2><h4>../src/session_impl.cpp:4643</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(42)">../src/session_impl.cpp:4650</a></td><td>make configurable</td></tr><tr id="42" style="display: none;" colspan="3"><td colspan="3"><h2>make configurable</h2><h4>../src/session_impl.cpp:4650</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
#ifdef TORRENT_DEBUG
for (std::vector&lt;peer_connection*&gt;::const_iterator i = peers.begin()
, end(peers.end()), prev(peers.end()); i != end; ++i)
@ -2160,7 +2162,7 @@ immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp
++m_allowed_upload_slots;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(43)">../src/session_impl.cpp:4657</a></td><td>make configurable</td></tr><tr id="43" style="display: none;" colspan="3"><td colspan="3"><h2>make configurable</h2><h4>../src/session_impl.cpp:4657</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> &gt;= (*i)-&gt;uploaded_in_last_round() * 1000
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(43)">../src/session_impl.cpp:4664</a></td><td>make configurable</td></tr><tr id="43" style="display: none;" colspan="3"><td colspan="3"><h2>make configurable</h2><h4>../src/session_impl.cpp:4664</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> &gt;= (*i)-&gt;uploaded_in_last_round() * 1000
* (1 + t2-&gt;priority()) / total_milliseconds(unchoke_interval));
}
prev = i;
@ -2211,7 +2213,7 @@ immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp
// if our current upload rate is less than 90% of our
// limit AND most torrents are not "congested", i.e.
// they are not holding back because of a per-torrent
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(44)">../src/storage.cpp:324</a></td><td>if the read fails, set error and exit immediately</td></tr><tr id="44" style="display: none;" colspan="3"><td colspan="3"><h2>if the read fails, set error and exit immediately</h2><h4>../src/storage.cpp:324</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (m_storage-&gt;disk_pool()) block_size = m_storage-&gt;disk_pool()-&gt;block_size();
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(44)">../src/storage.cpp:322</a></td><td>if the read fails, set error and exit immediately</td></tr><tr id="44" style="display: none;" colspan="3"><td colspan="3"><h2>if the read fails, set error and exit immediately</h2><h4>../src/storage.cpp:322</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (m_storage-&gt;disk_pool()) block_size = m_storage-&gt;disk_pool()-&gt;block_size();
int size = slot_size;
int num_blocks = (size + block_size - 1) / block_size;
@ -2262,7 +2264,7 @@ immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp
{
buf.iov_len = (std::min)(block_size, size);
// deliberately pass in 0 as flags, to disable random_access
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(45)">../src/storage.cpp:358</a></td><td>if the read fails, set error and exit immediately</td></tr><tr id="45" style="display: none;" colspan="3"><td colspan="3"><h2>if the read fails, set error and exit immediately</h2><h4>../src/storage.cpp:358</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(45)">../src/storage.cpp:356</a></td><td>if the read fails, set error and exit immediately</td></tr><tr id="45" style="display: none;" colspan="3"><td colspan="3"><h2>if the read fails, set error and exit immediately</h2><h4>../src/storage.cpp:356</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
ph.h.update((char const*)bufs[i].iov_base, bufs[i].iov_len);
small_piece_size -= bufs[i].iov_len;
}
@ -2313,9 +2315,9 @@ immediately instead of waiting for the next tick</h2><h4>../src/session_impl.cpp
, m_file_priority(file_prio)
, m_pool(fp)
, m_page_size(page_size())
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(46)">../src/storage.cpp:633</a></td><td>make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info</td></tr><tr id="46" style="display: none;" colspan="3"><td colspan="3"><h2>make this more generic to not just work if files have been
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(46)">../src/storage.cpp:645</a></td><td>make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info</td></tr><tr id="46" style="display: none;" colspan="3"><td colspan="3"><h2>make this more generic to not just work if files have been
renamed, but also if they have been merged into a single file for instance
maybe use the same format as .torrent files and reuse some code from torrent_info</h2><h4>../src/storage.cpp:633</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> for (;;)
maybe use the same format as .torrent files and reuse some code from torrent_info</h2><h4>../src/storage.cpp:645</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> for (;;)
{
if (file_offset &lt; files().file_size(file_index))
break;
@ -2366,9 +2368,9 @@ maybe use the same format as .torrent files and reuse some code from torrent_inf
for (int i = 0; i &lt; file_sizes_ent-&gt;list_size(); ++i)
{
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(47)">../src/storage.cpp:1269</a></td><td>what if file_base is used to merge several virtual files into a single physical file? We should probably disable this if file_base is used. This is not a widely used feature though</td></tr><tr id="47" style="display: none;" colspan="3"><td colspan="3"><h2>what if file_base is used to merge several virtual files
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(47)">../src/storage.cpp:1280</a></td><td>what if file_base is used to merge several virtual files into a single physical file? We should probably disable this if file_base is used. This is not a widely used feature though</td></tr><tr id="47" style="display: none;" colspan="3"><td colspan="3"><h2>what if file_base is used to merge several virtual files
into a single physical file? We should probably disable this
if file_base is used. This is not a widely used feature though</h2><h4>../src/storage.cpp:1269</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> int bytes_transferred = 0;
if file_base is used. This is not a widely used feature though</h2><h4>../src/storage.cpp:1280</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> int bytes_transferred = 0;
// if the file is opened in no_buffer mode, and the
// read is unaligned, we need to fall back on a slow
// special read that reads aligned buffers and copies
@ -2419,12 +2421,12 @@ if file_base is used. This is not a widely used feature though</h2><h4>../src/st
// makes unaligned requests (and the disk cache is disabled or fully utilized
// for write cache).
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(48)">../src/torrent.cpp:1234</a></td><td>is verify_peer_cert called once per certificate in the chain, and this function just tells us which depth we're at right now? If so, the comment makes sense. any certificate that isn't the leaf (i.e. the one presented by the peer) should be accepted automatically, given preverified is true. The leaf certificate need to be verified to make sure its DN matches the info-hash</td></tr><tr id="48" style="display: none;" colspan="3"><td colspan="3"><h2>is verify_peer_cert called once per certificate in the chain, and
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(48)">../src/torrent.cpp:1233</a></td><td>is verify_peer_cert called once per certificate in the chain, and this function just tells us which depth we're at right now? If so, the comment makes sense. any certificate that isn't the leaf (i.e. the one presented by the peer) should be accepted automatically, given preverified is true. The leaf certificate need to be verified to make sure its DN matches the info-hash</td></tr><tr id="48" style="display: none;" colspan="3"><td colspan="3"><h2>is verify_peer_cert called once per certificate in the chain, and
this function just tells us which depth we're at right now? If so, the comment
makes sense.
any certificate that isn't the leaf (i.e. the one presented by the peer)
should be accepted automatically, given preverified is true. The leaf certificate
need to be verified to make sure its DN matches the info-hash</h2><h4>../src/torrent.cpp:1234</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (pp) p-&gt;add_extension(pp);
need to be verified to make sure its DN matches the info-hash</h2><h4>../src/torrent.cpp:1233</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (pp) p-&gt;add_extension(pp);
}
// if files are checked for this torrent, call the extension
@ -2475,17 +2477,17 @@ need to be verified to make sure its DN matches the info-hash</h2><h4>../src/tor
{
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
match = true;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(49)">../src/torrent.cpp:5164</a></td><td>make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info The mapped_files needs to be read both in the network thread and in the disk thread, since they both have their own mapped files structures which are kept in sync</td></tr><tr id="49" style="display: none;" colspan="3"><td colspan="3"><h2>make this more generic to not just work if files have been
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(49)">../src/torrent.cpp:5236</a></td><td>make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance maybe use the same format as .torrent files and reuse some code from torrent_info The mapped_files needs to be read both in the network thread and in the disk thread, since they both have their own mapped files structures which are kept in sync</td></tr><tr id="49" style="display: none;" colspan="3"><td colspan="3"><h2>make this more generic to not just work if files have been
renamed, but also if they have been merged into a single file for instance
maybe use the same format as .torrent files and reuse some code from torrent_info
The mapped_files needs to be read both in the network thread
and in the disk thread, since they both have their own mapped files structures
which are kept in sync</h2><h4>../src/torrent.cpp:5164</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (m_seed_mode) m_verified.resize(m_torrent_file-&gt;num_pieces(), false);
super_seeding(rd.dict_find_int_value("super_seeding", 0));
m_last_scrape = rd.dict_find_int_value("last_scrape", 0);
m_last_download = rd.dict_find_int_value("last_download", 0);
m_last_upload = rd.dict_find_int_value("last_upload", 0);
which are kept in sync</h2><h4>../src/torrent.cpp:5236</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
if (!m_use_resume_save_path)
{
std::string p = rd.dict_find_string_value("save_path");
if (!p.empty()) m_save_path = p;
}
m_url = rd.dict_find_string_value("url");
m_uuid = rd.dict_find_string_value("uuid");
@ -2531,12 +2533,12 @@ which are kept in sync</h2><h4>../src/torrent.cpp:5164</h4><pre style="backgroun
{
char const* p = piece_priority-&gt;string_ptr();
for (int i = 0; i &lt; piece_priority-&gt;string_length(); ++i)
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(50)">../src/torrent.cpp:5300</a></td><td>if this is a merkle torrent and we can't restore the tree, we need to wipe all the bits in the have array, but not necessarily we might want to do a full check to see if we have all the pieces. This is low priority since almost no one uses merkle torrents</td></tr><tr id="50" style="display: none;" colspan="3"><td colspan="3"><h2>if this is a merkle torrent and we can't
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(50)">../src/torrent.cpp:5372</a></td><td>if this is a merkle torrent and we can't restore the tree, we need to wipe all the bits in the have array, but not necessarily we might want to do a full check to see if we have all the pieces. This is low priority since almost no one uses merkle torrents</td></tr><tr id="50" style="display: none;" colspan="3"><td colspan="3"><h2>if this is a merkle torrent and we can't
restore the tree, we need to wipe all the
bits in the have array, but not necessarily
we might want to do a full check to see if we have
all the pieces. This is low priority since almost
no one uses merkle torrents</h2><h4>../src/torrent.cpp:5300</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> add_web_seed(url, web_seed_entry::http_seed);
no one uses merkle torrents</h2><h4>../src/torrent.cpp:5372</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> add_web_seed(url, web_seed_entry::http_seed);
}
}
@ -2587,9 +2589,9 @@ no one uses merkle torrents</h2><h4>../src/torrent.cpp:5300</h4><pre style="back
ret["num_complete"] = m_complete;
ret["num_incomplete"] = m_incomplete;
ret["num_downloaded"] = m_downloaded;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(51)">../src/torrent.cpp:5488</a></td><td>make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance. using file_base</td></tr><tr id="51" style="display: none;" colspan="3"><td colspan="3"><h2>make this more generic to not just work if files have been
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(51)">../src/torrent.cpp:5562</a></td><td>make this more generic to not just work if files have been renamed, but also if they have been merged into a single file for instance. using file_base</td></tr><tr id="51" style="display: none;" colspan="3"><td colspan="3"><h2>make this more generic to not just work if files have been
renamed, but also if they have been merged into a single file for instance.
using file_base</h2><h4>../src/torrent.cpp:5488</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> entry::string_type&amp; pieces = ret["pieces"].string();
using file_base</h2><h4>../src/torrent.cpp:5562</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> entry::string_type&amp; pieces = ret["pieces"].string();
pieces.resize(m_torrent_file-&gt;num_pieces());
if (is_seed())
{
@ -2640,10 +2642,10 @@ using file_base</h2><h4>../src/torrent.cpp:5488</h4><pre style="background: #f6f
error_code ec;
policy::peer const* p = *i;
address addr = p-&gt;address();
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(52)">../src/torrent.cpp:8073</a></td><td>go through the pieces we have and count the total number of downloaders we have. Only count peers that are interested in us since some peers might not send have messages for pieces we have it num_interested == 0, we need to pick a new piece</td></tr><tr id="52" style="display: none;" colspan="3"><td colspan="3"><h2>go through the pieces we have and count the total number
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(52)">../src/torrent.cpp:8176</a></td><td>go through the pieces we have and count the total number of downloaders we have. Only count peers that are interested in us since some peers might not send have messages for pieces we have it num_interested == 0, we need to pick a new piece</td></tr><tr id="52" style="display: none;" colspan="3"><td colspan="3"><h2>go through the pieces we have and count the total number
of downloaders we have. Only count peers that are interested in us
since some peers might not send have messages for pieces we have
it num_interested == 0, we need to pick a new piece</h2><h4>../src/torrent.cpp:8073</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> }
it num_interested == 0, we need to pick a new piece</h2><h4>../src/torrent.cpp:8176</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> }
rarest_pieces.clear();
rarest_rarity = pp.peer_count;
@ -2694,7 +2696,59 @@ it num_interested == 0, we need to pick a new piece</h2><h4>../src/torrent.cpp:8
{
m_picker-&gt;get_availability(avail_vec);
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(53)">../src/udp_socket.cpp:292</a></td><td>it would be nice to detect this on posix systems also</td></tr><tr id="53" style="display: none;" colspan="3"><td colspan="3"><h2>it would be nice to detect this on posix systems also</h2><h4>../src/udp_socket.cpp:292</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> --m_v6_outstanding;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(53)">../src/torrent.cpp:8821</a></td><td>instead of resorting the whole list, insert the peers directly into the right place</td></tr><tr id="53" style="display: none;" colspan="3"><td colspan="3"><h2>instead of resorting the whole list, insert the peers
directly into the right place</h2><h4>../src/torrent.cpp:8821</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> printf("timed out [average-piece-time: %d ms ]\n"
, m_average_piece_time);
#endif
}
// pick all blocks for this piece. the peers list is kept up to date
// and sorted. when we issue a request to a peer, its download queue
// time will increase and it may need to be bumped in the peers list,
// since it's ordered by download queue time
pick_time_critical_block(peers, ignore_peers
, peers_with_requests
, pi, &amp;*i, m_picker.get()
, blocks_in_piece, timed_out);
// put back the peers we ignored into the peer list for the next piece
if (!ignore_peers.empty())
{
peers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end());
ignore_peers.clear();
<div style="background: #ffff00" width="100%"> std::sort(peers.begin(), peers.end()
</div> , boost::bind(&amp;peer_connection::download_queue_time, _1, 16*1024)
&lt; boost::bind(&amp;peer_connection::download_queue_time, _2, 16*1024));
}
// if this peer's download time exceeds 2 seconds, we're done.
// We don't want to build unreasonably long request queues
if (!peers.empty() &amp;&amp; peers[0]-&gt;download_queue_time() &gt; milliseconds(2000))
break;
}
// commit all the time critical requests
for (std::set&lt;peer_connection*&gt;::iterator i = peers_with_requests.begin()
, end(peers_with_requests.end()); i != end; ++i)
{
(*i)-&gt;send_block_requests();
}
}
std::set&lt;std::string&gt; torrent::web_seeds(web_seed_entry::type_t type) const
{
TORRENT_ASSERT(m_ses.is_network_thread());
std::set&lt;std::string&gt; ret;
for (std::list&lt;web_seed_entry&gt;::const_iterator i = m_web_seeds.begin()
, end(m_web_seeds.end()); i != end; ++i)
{
if (i-&gt;peer_info.banned) continue;
if (i-&gt;type != type) continue;
ret.insert(i-&gt;url);
}
return ret;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(54)">../src/udp_socket.cpp:292</a></td><td>it would be nice to detect this on posix systems also</td></tr><tr id="54" style="display: none;" colspan="3"><td colspan="3"><h2>it would be nice to detect this on posix systems also</h2><h4>../src/udp_socket.cpp:292</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> --m_v6_outstanding;
}
else
#endif
@ -2745,9 +2799,9 @@ void udp_socket::call_handler(error_code const&amp; ec, udp::endpoint const&amp;
ret = (*i)-&gt;incoming_packet(ec, ep, buf, size);
} TORRENT_CATCH (std::exception&amp;) {}
if (*i == NULL) i = m_observers.erase(i);
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(54)">../src/udp_tracker_connection.cpp:550</a></td><td>it would be more efficient to not use a string here. however, the problem is that some trackers will respond with actual strings. For example i2p trackers</td></tr><tr id="54" style="display: none;" colspan="3"><td colspan="3"><h2>it would be more efficient to not use a string here.
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(55)">../src/udp_tracker_connection.cpp:548</a></td><td>it would be more efficient to not use a string here. however, the problem is that some trackers will respond with actual strings. For example i2p trackers</td></tr><tr id="55" style="display: none;" colspan="3"><td colspan="3"><h2>it would be more efficient to not use a string here.
however, the problem is that some trackers will respond
with actual strings. For example i2p trackers</h2><h4>../src/udp_tracker_connection.cpp:550</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> }
with actual strings. For example i2p trackers</h2><h4>../src/udp_tracker_connection.cpp:548</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> }
boost::shared_ptr&lt;request_callback&gt; cb = requester();
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
@ -2798,7 +2852,7 @@ with actual strings. For example i2p trackers</h2><h4>../src/udp_tracker_connect
{
restart_read_timeout();
int action = detail::read_int32(buf);
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(55)">../src/upnp.cpp:65</a></td><td>listen_interface is not used. It's meant to bind the broadcast socket</td></tr><tr id="55" style="display: none;" colspan="3"><td colspan="3"><h2>listen_interface is not used. It's meant to bind the broadcast socket</h2><h4>../src/upnp.cpp:65</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(56)">../src/upnp.cpp:63</a></td><td>listen_interface is not used. It's meant to bind the broadcast socket</td></tr><tr id="56" style="display: none;" colspan="3"><td colspan="3"><h2>listen_interface is not used. It's meant to bind the broadcast socket</h2><h4>../src/upnp.cpp:63</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
#if defined TORRENT_ASIO_DEBUGGING
#include "libtorrent/debug.hpp"
#endif
@ -2849,7 +2903,7 @@ static error_code ec;
m_mappings.swap(s-&gt;mappings);
delete s;
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(56)">../src/utp_stream.cpp:1606</a></td><td>this loop may not be very efficient</td></tr><tr id="56" style="display: none;" colspan="3"><td colspan="3"><h2>this loop may not be very efficient</h2><h4>../src/utp_stream.cpp:1606</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(57)">../src/utp_stream.cpp:1606</a></td><td>this loop may not be very efficient</td></tr><tr id="57" style="display: none;" colspan="3"><td colspan="3"><h2>this loop may not be very efficient</h2><h4>../src/utp_stream.cpp:1606</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
char* m_buf;
};
@ -2900,8 +2954,8 @@ bool utp_socket_impl::send_pkt(int flags)
if (sack &gt; 32) sack = 32;
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(57)">../src/kademlia/dht_tracker.cpp:428</a></td><td>ideally this function would be called when the put completes</td></tr><tr id="57" style="display: none;" colspan="3"><td colspan="3"><h2>ideally this function would be called when the
put completes</h2><h4>../src/kademlia/dht_tracker.cpp:428</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // since it controls whether we re-put the content
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(58)">../src/kademlia/dht_tracker.cpp:426</a></td><td>ideally this function would be called when the put completes</td></tr><tr id="58" style="display: none;" colspan="3"><td colspan="3"><h2>ideally this function would be called when the
put completes</h2><h4>../src/kademlia/dht_tracker.cpp:426</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // since it controls whether we re-put the content
TORRENT_ASSERT(!it.is_mutable());
f(it);
return false;
@ -2952,8 +3006,8 @@ put completes</h2><h4>../src/kademlia/dht_tracker.cpp:428</h4><pre style="backgr
std::string flat_data;
bencode(std::back_inserter(flat_data), data);
sha1_hash target = item_target_id(
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(58)">../src/kademlia/routing_table.cpp:293</a></td><td>instad of refreshing a bucket by using find_nodes, ping each node periodically</td></tr><tr id="58" style="display: none;" colspan="3"><td colspan="3"><h2>instad of refreshing a bucket by using find_nodes,
ping each node periodically</h2><h4>../src/kademlia/routing_table.cpp:293</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> os &lt;&lt; "]\n";
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(59)">../src/kademlia/routing_table.cpp:291</a></td><td>instad of refreshing a bucket by using find_nodes, ping each node periodically</td></tr><tr id="59" style="display: none;" colspan="3"><td colspan="3"><h2>instad of refreshing a bucket by using find_nodes,
ping each node periodically</h2><h4>../src/kademlia/routing_table.cpp:291</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> os &lt;&lt; "]\n";
}
}
@ -3004,7 +3058,7 @@ bool compare_bucket_refresh(routing_table_node const&amp; lhs, routing_table_nod
node_id mask = generate_prefix_mask(num_bits);
// target = (target &amp; ~mask) | (root &amp; mask)
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(59)">../include/libtorrent/config.hpp:333</a></td><td>Make this count Unicode characters instead of bytes on windows</td></tr><tr id="59" style="display: none;" colspan="3"><td colspan="3"><h2>Make this count Unicode characters instead of bytes on windows</h2><h4>../include/libtorrent/config.hpp:333</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(60)">../include/libtorrent/config.hpp:333</a></td><td>Make this count Unicode characters instead of bytes on windows</td></tr><tr id="60" style="display: none;" colspan="3"><td colspan="3"><h2>Make this count Unicode characters instead of bytes on windows</h2><h4>../include/libtorrent/config.hpp:333</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
// ==== eCS(OS/2) ===
#elif defined __OS2__
#define TORRENT_OS2
@ -3055,7 +3109,7 @@ bool compare_bucket_refresh(routing_table_node const&amp; lhs, routing_table_nod
#include &lt;stdarg.h&gt;
// internal
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(60)">../include/libtorrent/peer_connection.hpp:725</a></td><td>make this private</td></tr><tr id="60" style="display: none;" colspan="3"><td colspan="3"><h2>make this private</h2><h4>../include/libtorrent/peer_connection.hpp:725</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> void set_soft_packet_size(int size) { m_soft_packet_size = size; }
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(61)">../include/libtorrent/peer_connection.hpp:725</a></td><td>make this private</td></tr><tr id="61" style="display: none;" colspan="3"><td colspan="3"><h2>make this private</h2><h4>../include/libtorrent/peer_connection.hpp:725</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> void set_soft_packet_size(int size) { m_soft_packet_size = size; }
// if allow_encrypted is false, and the torrent 'ih' turns out
// to be an encrypted torrent (AES-256 encrypted) the peer will
@ -3106,7 +3160,7 @@ bool compare_bucket_refresh(routing_table_node const&amp; lhs, routing_table_nod
// we have choked the upload to the peer
bool m_choked:1;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(61)">../include/libtorrent/peer_connection.hpp:806</a></td><td>make these private as well</td></tr><tr id="61" style="display: none;" colspan="3"><td colspan="3"><h2>make these private as well</h2><h4>../include/libtorrent/peer_connection.hpp:806</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(62)">../include/libtorrent/peer_connection.hpp:806</a></td><td>make these private as well</td></tr><tr id="62" style="display: none;" colspan="3"><td colspan="3"><h2>make these private as well</h2><h4>../include/libtorrent/peer_connection.hpp:806</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
// when this is set, the peer_connection socket is
// corked, similar to the linux TCP feature TCP_CORK.
// we won't send anything to the actual socket, just
@ -3157,7 +3211,7 @@ bool compare_bucket_refresh(routing_table_node const&amp; lhs, routing_table_nod
sliding_average&lt;20&gt; m_send_rate;
private:
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(62)">../include/libtorrent/proxy_base.hpp:166</a></td><td>it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);</td></tr><tr id="62" style="display: none;" colspan="3"><td colspan="3"><h2>it would be nice to remember the bind port and bind once we know where the proxy is
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(63)">../include/libtorrent/proxy_base.hpp:166</a></td><td>it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);</td></tr><tr id="63" style="display: none;" colspan="3"><td colspan="3"><h2>it would be nice to remember the bind port and bind once we know where the proxy is
m_sock.bind(endpoint, ec);</h2><h4>../include/libtorrent/proxy_base.hpp:166</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
return m_sock.get_option(opt, ec);
}
@ -3209,7 +3263,7 @@ m_sock.bind(endpoint, ec);</h2><h4>../include/libtorrent/proxy_base.hpp:166</h4>
m_sock.close(ec);
m_resolver.cancel();
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(63)">../include/libtorrent/stat.hpp:113</a></td><td>this is 4 bytes of padding!</td></tr><tr id="63" style="display: none;" colspan="3"><td colspan="3"><h2>this is 4 bytes of padding!</h2><h4>../include/libtorrent/stat.hpp:113</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(64)">../include/libtorrent/stat.hpp:113</a></td><td>this is 4 bytes of padding!</td></tr><tr id="64" style="display: none;" colspan="3"><td colspan="3"><h2>this is 4 bytes of padding!</h2><h4>../include/libtorrent/stat.hpp:113</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
int counter() const { return m_counter; }
void clear()
@ -3260,7 +3314,7 @@ m_sock.bind(endpoint, ec);</h2><h4>../include/libtorrent/proxy_base.hpp:166</h4>
#endif
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(64)">../include/libtorrent/torrent_info.hpp:123</a></td><td>include the number of peers received from this tracker, at last announce</td></tr><tr id="64" style="display: none;" colspan="3"><td colspan="3"><h2>include the number of peers received from this tracker, at last announce</h2><h4>../include/libtorrent/torrent_info.hpp:123</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(65)">../include/libtorrent/torrent_info.hpp:123</a></td><td>include the number of peers received from this tracker, at last announce</td></tr><tr id="65" style="display: none;" colspan="3"><td colspan="3"><h2>include the number of peers received from this tracker, at last announce</h2><h4>../include/libtorrent/torrent_info.hpp:123</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
// if this tracker failed the last time it was contacted
// this error code specifies what error occurred
error_code last_error;
@ -3311,7 +3365,7 @@ m_sock.bind(endpoint, ec);</h2><h4>../include/libtorrent/proxy_base.hpp:166</h4>
// flags for the source bitmask, each indicating where
// we heard about this tracker
enum tracker_source
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(65)">../include/libtorrent/upnp.hpp:108</a></td><td>support using the windows API for UPnP operations as well</td></tr><tr id="65" style="display: none;" colspan="3"><td colspan="3"><h2>support using the windows API for UPnP operations as well</h2><h4>../include/libtorrent/upnp.hpp:108</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // specific IP addres or DNS name
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(66)">../include/libtorrent/upnp.hpp:108</a></td><td>support using the windows API for UPnP operations as well</td></tr><tr id="66" style="display: none;" colspan="3"><td colspan="3"><h2>support using the windows API for UPnP operations as well</h2><h4>../include/libtorrent/upnp.hpp:108</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // specific IP addres or DNS name
remote_host_must_be_wildcard = 726,
// ExternalPort must be a wildcard and cannot be a
// specific port
@ -3362,7 +3416,7 @@ public:
// is -1, which means failure. There will not be any error alert notification for
// mappings that fail with a -1 return value.
int add_mapping(protocol_type p, int external_port, int local_port);
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(66)">../include/libtorrent/utp_stream.hpp:378</a></td><td>implement blocking write. Low priority since it's not used (yet)</td></tr><tr id="66" style="display: none;" colspan="3"><td colspan="3"><h2>implement blocking write. Low priority since it's not used (yet)</h2><h4>../include/libtorrent/utp_stream.hpp:378</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> for (typename Mutable_Buffers::const_iterator i = buffers.begin()
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(67)">../include/libtorrent/utp_stream.hpp:378</a></td><td>implement blocking write. Low priority since it's not used (yet)</td></tr><tr id="67" style="display: none;" colspan="3"><td colspan="3"><h2>implement blocking write. Low priority since it's not used (yet)</h2><h4>../include/libtorrent/utp_stream.hpp:378</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> for (typename Mutable_Buffers::const_iterator i = buffers.begin()
, end(buffers.end()); i != end; ++i)
{
using asio::buffer_cast;
@ -3413,7 +3467,7 @@ public:
TORRENT_ASSERT(false);
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(67)">../include/libtorrent/kademlia/item.hpp:61</a></td><td>since this is a public function, it should probably be moved out of this header and into one with other public functions.</td></tr><tr id="67" style="display: none;" colspan="3"><td colspan="3"><h2>since this is a public function, it should probably be moved
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(68)">../include/libtorrent/kademlia/item.hpp:61</a></td><td>since this is a public function, it should probably be moved out of this header and into one with other public functions.</td></tr><tr id="68" style="display: none;" colspan="3"><td colspan="3"><h2>since this is a public function, it should probably be moved
out of this header and into one with other public functions.</h2><h4>../include/libtorrent/kademlia/item.hpp:61</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">#include &lt;boost/array.hpp&gt;
namespace libtorrent { namespace dht

View File

@ -66,7 +66,8 @@ namespace libtorrent
// the type of proxy to use. Assign one of these to the
// proxy_settings::type field.
enum proxy_type {
enum proxy_type
{
// This is the default, no proxy server is used, all other fields are
// ignored.
none,
@ -98,8 +99,7 @@ namespace libtorrent
// proxy will suffice. The proxy is assumed to not require
// authorization. The username and password will not be used.
//
// .. _CONNECT:
// http://tools.ietf.org/html/draft-luotonen-web-proxy-tunneling-01
// .. _CONNECT: http://tools.ietf.org/html/draft-luotonen-web-proxy-tunneling-01
http,
// The server is assumed to be an HTTP proxy that requires user
@ -324,13 +324,15 @@ namespace libtorrent
int allowed_fast_set_size;
// options for session_settings::suggest_mode.
enum suggest_mode_t {
enum suggest_mode_t
{
// the default. will not send out suggest messages.
no_piece_suggestions = 0,
// send out suggest messages for the most recent pieces that are in
// the read cache.
suggest_read_cache = 1 };
suggest_read_cache = 1
};
// this determines which pieces will be suggested to peers suggest read
// cache will make libtorrent suggest pieces that are fresh in the disk
@ -433,7 +435,8 @@ namespace libtorrent
// the different choking algorithms available. Set
// session_settings::choking_algorithm to one of these
enum choking_algorithm_t {
enum choking_algorithm_t
{
// the traditional choker with a fixed number of unchoke slots, as
// specified by session::set_max_uploads()..
fixed_slots_choker,
@ -457,7 +460,8 @@ namespace libtorrent
// this choker, see the paper_.
//
// .. _paper: http://bittyrant.cs.washington.edu/#papers
bittyrant_choker };
bittyrant_choker
};
// specifies which algorithm to use to determine which peers to unchoke.
// This setting replaces the deprecated settings ``auto_upload_slots``
@ -467,7 +471,8 @@ namespace libtorrent
// the different choking algorithms available when seeding. Set
// session_settings::seed_choking_algorithm to one of these
enum seed_choking_algorithm_t {
enum seed_choking_algorithm_t
{
// round-robins the peers that are unchoked when seeding. This
// distributes the upload bandwidht uniformly and fairly. It minimizes
// the ability for a peer to download everything without
@ -481,7 +486,8 @@ namespace libtorrent
// prioritizes peers who have just started or are just about to finish
// the download. The intention is to force peers in the middle of the
// download to trade with each other.
anti_leech };
anti_leech
};
// controls the seeding unchoke behavior. For options, see
// seed_choking_algorithm_t.
@ -1219,7 +1225,6 @@ namespace libtorrent
// does not throttle uTP, throttles TCP to the same proportion
// of throughput as there are TCP connections
peer_proportional = 1
};
// determines how to treat TCP connections when there are uTP