regenerated html

This commit is contained in:
Arvid Norberg 2014-04-06 19:11:24 +00:00
parent 1afa9db689
commit a364d6ea09
19 changed files with 848 additions and 266 deletions

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>BitTorrent extension for arbitrary DHT store</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
@ -107,7 +107,7 @@ structure of the DHT network.</p>
<p>The <tt class="docutils literal">token</tt> field also has the same semantics as the standard DHT message
<tt class="docutils literal">get_peers</tt> and <tt class="docutils literal">announce_peer</tt>, when requesting an item and to write an
item respectively.</p>
<p>The <tt class="docutils literal">k</tt> field is the 32 byte curve25519 public key, which the signature can be
<p>The <tt class="docutils literal">k</tt> field is the 32 byte ed25519 public key, which the signature can be
authenticated with. When looking up a mutable item, the <tt class="docutils literal">target</tt> field MUST be
the SHA-1 hash of this key concatenated with the <tt class="docutils literal">salt</tt>, if present.</p>
<p>The distinction between storing mutable and immutable items is the inclusion of
@ -174,7 +174,7 @@ verify that its hash matches the target that was looked up.</p>
<p>Response:</p>
<pre class="literal-block">
{
&quot;r&quot;:
&quot;r&quot;:
{
&quot;id&quot;: <em>&lt;20 byte id of sending node (string)&gt;</em>,
&quot;token&quot;: <em>&lt;write token (string)&gt;</em>,
@ -202,7 +202,7 @@ higher sequence number to a lower one, only upgrade. The sequence number SHOULD
not exceed <tt class="docutils literal">MAX_INT64</tt>, (i.e. <tt class="docutils literal">0x7fffffffffffffff</tt>. A client MAY reject any
message with a sequence number exceeding this. A client MAY also reject any
message with a negative sequence number.</p>
<p>The signature is a 64 byte curve25519 signature of the bencoded sequence number
<p>The signature is a 64 byte ed25519 signature of the bencoded sequence number
concatenated with the <tt class="docutils literal">v</tt> key. e.g. something like this:</p>
<pre class="literal-block">
3:seqi4e1:v12:Hello world!
@ -226,10 +226,10 @@ the buffer to be signed is:</p>
{
&quot;cas&quot;: <em>&lt;optional 20 byte hash (string)&gt;</em>,
&quot;id&quot;: <em>&lt;20 byte id of sending node (string)&gt;</em>,
&quot;k&quot;: <em>&lt;curve25519 public key (32 bytes string)&gt;</em>,
&quot;k&quot;: <em>&lt;ed25519 public key (32 bytes string)&gt;</em>,
&quot;salt&quot;: <em>&lt;optional salt to be appended to &quot;k&quot; when hashing (string)&gt;</em>
&quot;seq&quot;: <em>&lt;monotonically increasing sequence number (integer)&gt;</em>,
&quot;sig&quot;: <em>&lt;curve25519 signature (64 bytes string)&gt;</em>,
&quot;sig&quot;: <em>&lt;ed25519 signature (64 bytes string)&gt;</em>,
&quot;token&quot;: <em>&lt;write-token (string)&gt;</em>,
&quot;v&quot;: <em>&lt;any bencoded type, whose encoded size &lt; 1000&gt;</em>
},
@ -358,11 +358,11 @@ item.</p>
&quot;r&quot;:
{
&quot;id&quot;: <em>&lt;20 byte id of sending node (string)&gt;</em>,
&quot;k&quot;: <em>&lt;curve25519 public key (32 bytes string)&gt;</em>,
&quot;k&quot;: <em>&lt;ed25519 public key (32 bytes string)&gt;</em>,
&quot;nodes&quot;: <em>&lt;IPv4 nodes close to 'target'&gt;</em>,
&quot;nodes6&quot;: <em>&lt;IPv6 nodes close to 'target'&gt;</em>,
&quot;seq&quot;: <em>&lt;monotonically increasing sequence number (integer)&gt;</em>,
&quot;sig&quot;: <em>&lt;curve25519 signature (64 bytes string)&gt;</em>,
&quot;sig&quot;: <em>&lt;ed25519 signature (64 bytes string)&gt;</em>,
&quot;token&quot;: <em>&lt;write-token (string)&gt;</em>,
&quot;v&quot;: <em>&lt;any bencoded type, whose encoded size &lt;= 1000&gt;</em>
},
@ -482,7 +482,7 @@ e5f96f6f38320f0f33959cb4d3d656452117aadb
</div>
<div class="section" id="resources">
<h1>resources</h1>
<p>Libraries that implement curve25519 DSA:</p>
<p>Libraries that implement ed25519 DSA:</p>
<ul class="simple">
<li><a class="reference external" href="http://nacl.cr.yp.to/">NaCl</a></li>
<li><a class="reference external" href="https://github.com/jedisct1/libsodium">libsodium</a></li>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>libtorrent API Documentation</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Alerts</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
@ -55,79 +55,83 @@
<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="#alert" id="id228">alert</a></li>
<li><a class="reference internal" href="#torrent-alert" id="id229">torrent_alert</a></li>
<li><a class="reference internal" href="#peer-alert" id="id230">peer_alert</a></li>
<li><a class="reference internal" href="#tracker-alert" id="id231">tracker_alert</a></li>
<li><a class="reference internal" href="#torrent-added-alert" id="id232">torrent_added_alert</a></li>
<li><a class="reference internal" href="#torrent-removed-alert" id="id233">torrent_removed_alert</a></li>
<li><a class="reference internal" href="#read-piece-alert" id="id234">read_piece_alert</a></li>
<li><a class="reference internal" href="#file-completed-alert" id="id235">file_completed_alert</a></li>
<li><a class="reference internal" href="#file-renamed-alert" id="id236">file_renamed_alert</a></li>
<li><a class="reference internal" href="#file-rename-failed-alert" id="id237">file_rename_failed_alert</a></li>
<li><a class="reference internal" href="#performance-alert" id="id238">performance_alert</a></li>
<li><a class="reference internal" href="#state-changed-alert" id="id239">state_changed_alert</a></li>
<li><a class="reference internal" href="#tracker-error-alert" id="id240">tracker_error_alert</a></li>
<li><a class="reference internal" href="#tracker-warning-alert" id="id241">tracker_warning_alert</a></li>
<li><a class="reference internal" href="#scrape-reply-alert" id="id242">scrape_reply_alert</a></li>
<li><a class="reference internal" href="#scrape-failed-alert" id="id243">scrape_failed_alert</a></li>
<li><a class="reference internal" href="#tracker-reply-alert" id="id244">tracker_reply_alert</a></li>
<li><a class="reference internal" href="#dht-reply-alert" id="id245">dht_reply_alert</a></li>
<li><a class="reference internal" href="#tracker-announce-alert" id="id246">tracker_announce_alert</a></li>
<li><a class="reference internal" href="#hash-failed-alert" id="id247">hash_failed_alert</a></li>
<li><a class="reference internal" href="#peer-ban-alert" id="id248">peer_ban_alert</a></li>
<li><a class="reference internal" href="#peer-unsnubbed-alert" id="id249">peer_unsnubbed_alert</a></li>
<li><a class="reference internal" href="#peer-snubbed-alert" id="id250">peer_snubbed_alert</a></li>
<li><a class="reference internal" href="#peer-error-alert" id="id251">peer_error_alert</a></li>
<li><a class="reference internal" href="#peer-connect-alert" id="id252">peer_connect_alert</a></li>
<li><a class="reference internal" href="#peer-disconnected-alert" id="id253">peer_disconnected_alert</a></li>
<li><a class="reference internal" href="#invalid-request-alert" id="id254">invalid_request_alert</a></li>
<li><a class="reference internal" href="#torrent-finished-alert" id="id255">torrent_finished_alert</a></li>
<li><a class="reference internal" href="#piece-finished-alert" id="id256">piece_finished_alert</a></li>
<li><a class="reference internal" href="#request-dropped-alert" id="id257">request_dropped_alert</a></li>
<li><a class="reference internal" href="#block-timeout-alert" id="id258">block_timeout_alert</a></li>
<li><a class="reference internal" href="#block-finished-alert" id="id259">block_finished_alert</a></li>
<li><a class="reference internal" href="#block-downloading-alert" id="id260">block_downloading_alert</a></li>
<li><a class="reference internal" href="#unwanted-block-alert" id="id261">unwanted_block_alert</a></li>
<li><a class="reference internal" href="#storage-moved-alert" id="id262">storage_moved_alert</a></li>
<li><a class="reference internal" href="#storage-moved-failed-alert" id="id263">storage_moved_failed_alert</a></li>
<li><a class="reference internal" href="#torrent-deleted-alert" id="id264">torrent_deleted_alert</a></li>
<li><a class="reference internal" href="#torrent-delete-failed-alert" id="id265">torrent_delete_failed_alert</a></li>
<li><a class="reference internal" href="#save-resume-data-alert" id="id266">save_resume_data_alert</a></li>
<li><a class="reference internal" href="#save-resume-data-failed-alert" id="id267">save_resume_data_failed_alert</a></li>
<li><a class="reference internal" href="#torrent-paused-alert" id="id268">torrent_paused_alert</a></li>
<li><a class="reference internal" href="#torrent-resumed-alert" id="id269">torrent_resumed_alert</a></li>
<li><a class="reference internal" href="#torrent-checked-alert" id="id270">torrent_checked_alert</a></li>
<li><a class="reference internal" href="#url-seed-alert" id="id271">url_seed_alert</a></li>
<li><a class="reference internal" href="#file-error-alert" id="id272">file_error_alert</a></li>
<li><a class="reference internal" href="#metadata-failed-alert" id="id273">metadata_failed_alert</a></li>
<li><a class="reference internal" href="#metadata-received-alert" id="id274">metadata_received_alert</a></li>
<li><a class="reference internal" href="#udp-error-alert" id="id275">udp_error_alert</a></li>
<li><a class="reference internal" href="#external-ip-alert" id="id276">external_ip_alert</a></li>
<li><a class="reference internal" href="#listen-failed-alert" id="id277">listen_failed_alert</a></li>
<li><a class="reference internal" href="#listen-succeeded-alert" id="id278">listen_succeeded_alert</a></li>
<li><a class="reference internal" href="#portmap-error-alert" id="id279">portmap_error_alert</a></li>
<li><a class="reference internal" href="#portmap-alert" id="id280">portmap_alert</a></li>
<li><a class="reference internal" href="#portmap-log-alert" id="id281">portmap_log_alert</a></li>
<li><a class="reference internal" href="#fastresume-rejected-alert" id="id282">fastresume_rejected_alert</a></li>
<li><a class="reference internal" href="#peer-blocked-alert" id="id283">peer_blocked_alert</a></li>
<li><a class="reference internal" href="#dht-announce-alert" id="id284">dht_announce_alert</a></li>
<li><a class="reference internal" href="#dht-get-peers-alert" id="id285">dht_get_peers_alert</a></li>
<li><a class="reference internal" href="#stats-alert" id="id286">stats_alert</a></li>
<li><a class="reference internal" href="#cache-flushed-alert" id="id287">cache_flushed_alert</a></li>
<li><a class="reference internal" href="#anonymous-mode-alert" id="id288">anonymous_mode_alert</a></li>
<li><a class="reference internal" href="#lsd-peer-alert" id="id289">lsd_peer_alert</a></li>
<li><a class="reference internal" href="#trackerid-alert" id="id290">trackerid_alert</a></li>
<li><a class="reference internal" href="#dht-bootstrap-alert" id="id291">dht_bootstrap_alert</a></li>
<li><a class="reference internal" href="#rss-alert" id="id292">rss_alert</a></li>
<li><a class="reference internal" href="#torrent-error-alert" id="id293">torrent_error_alert</a></li>
<li><a class="reference internal" href="#torrent-need-cert-alert" id="id294">torrent_need_cert_alert</a></li>
<li><a class="reference internal" href="#incoming-connection-alert" id="id295">incoming_connection_alert</a></li>
<li><a class="reference internal" href="#add-torrent-alert" id="id296">add_torrent_alert</a></li>
<li><a class="reference internal" href="#state-update-alert" id="id297">state_update_alert</a></li>
<li><a class="reference internal" href="#torrent-update-alert" id="id298">torrent_update_alert</a></li>
<li><a class="reference internal" href="#rss-item-alert" id="id299">rss_item_alert</a></li>
<li><a class="reference internal" href="#dht-error-alert" id="id300">dht_error_alert</a></li>
<li><a class="reference internal" href="#alert" id="id236">alert</a></li>
<li><a class="reference internal" href="#torrent-alert" id="id237">torrent_alert</a></li>
<li><a class="reference internal" href="#peer-alert" id="id238">peer_alert</a></li>
<li><a class="reference internal" href="#tracker-alert" id="id239">tracker_alert</a></li>
<li><a class="reference internal" href="#torrent-added-alert" id="id240">torrent_added_alert</a></li>
<li><a class="reference internal" href="#torrent-removed-alert" id="id241">torrent_removed_alert</a></li>
<li><a class="reference internal" href="#read-piece-alert" id="id242">read_piece_alert</a></li>
<li><a class="reference internal" href="#file-completed-alert" id="id243">file_completed_alert</a></li>
<li><a class="reference internal" href="#file-renamed-alert" id="id244">file_renamed_alert</a></li>
<li><a class="reference internal" href="#file-rename-failed-alert" id="id245">file_rename_failed_alert</a></li>
<li><a class="reference internal" href="#performance-alert" id="id246">performance_alert</a></li>
<li><a class="reference internal" href="#state-changed-alert" id="id247">state_changed_alert</a></li>
<li><a class="reference internal" href="#tracker-error-alert" id="id248">tracker_error_alert</a></li>
<li><a class="reference internal" href="#tracker-warning-alert" id="id249">tracker_warning_alert</a></li>
<li><a class="reference internal" href="#scrape-reply-alert" id="id250">scrape_reply_alert</a></li>
<li><a class="reference internal" href="#scrape-failed-alert" id="id251">scrape_failed_alert</a></li>
<li><a class="reference internal" href="#tracker-reply-alert" id="id252">tracker_reply_alert</a></li>
<li><a class="reference internal" href="#dht-reply-alert" id="id253">dht_reply_alert</a></li>
<li><a class="reference internal" href="#tracker-announce-alert" id="id254">tracker_announce_alert</a></li>
<li><a class="reference internal" href="#hash-failed-alert" id="id255">hash_failed_alert</a></li>
<li><a class="reference internal" href="#peer-ban-alert" id="id256">peer_ban_alert</a></li>
<li><a class="reference internal" href="#peer-unsnubbed-alert" id="id257">peer_unsnubbed_alert</a></li>
<li><a class="reference internal" href="#peer-snubbed-alert" id="id258">peer_snubbed_alert</a></li>
<li><a class="reference internal" href="#peer-error-alert" id="id259">peer_error_alert</a></li>
<li><a class="reference internal" href="#peer-connect-alert" id="id260">peer_connect_alert</a></li>
<li><a class="reference internal" href="#peer-disconnected-alert" id="id261">peer_disconnected_alert</a></li>
<li><a class="reference internal" href="#invalid-request-alert" id="id262">invalid_request_alert</a></li>
<li><a class="reference internal" href="#torrent-finished-alert" id="id263">torrent_finished_alert</a></li>
<li><a class="reference internal" href="#piece-finished-alert" id="id264">piece_finished_alert</a></li>
<li><a class="reference internal" href="#request-dropped-alert" id="id265">request_dropped_alert</a></li>
<li><a class="reference internal" href="#block-timeout-alert" id="id266">block_timeout_alert</a></li>
<li><a class="reference internal" href="#block-finished-alert" id="id267">block_finished_alert</a></li>
<li><a class="reference internal" href="#block-downloading-alert" id="id268">block_downloading_alert</a></li>
<li><a class="reference internal" href="#unwanted-block-alert" id="id269">unwanted_block_alert</a></li>
<li><a class="reference internal" href="#storage-moved-alert" id="id270">storage_moved_alert</a></li>
<li><a class="reference internal" href="#storage-moved-failed-alert" id="id271">storage_moved_failed_alert</a></li>
<li><a class="reference internal" href="#torrent-deleted-alert" id="id272">torrent_deleted_alert</a></li>
<li><a class="reference internal" href="#torrent-delete-failed-alert" id="id273">torrent_delete_failed_alert</a></li>
<li><a class="reference internal" href="#save-resume-data-alert" id="id274">save_resume_data_alert</a></li>
<li><a class="reference internal" href="#save-resume-data-failed-alert" id="id275">save_resume_data_failed_alert</a></li>
<li><a class="reference internal" href="#torrent-paused-alert" id="id276">torrent_paused_alert</a></li>
<li><a class="reference internal" href="#torrent-resumed-alert" id="id277">torrent_resumed_alert</a></li>
<li><a class="reference internal" href="#torrent-checked-alert" id="id278">torrent_checked_alert</a></li>
<li><a class="reference internal" href="#url-seed-alert" id="id279">url_seed_alert</a></li>
<li><a class="reference internal" href="#file-error-alert" id="id280">file_error_alert</a></li>
<li><a class="reference internal" href="#metadata-failed-alert" id="id281">metadata_failed_alert</a></li>
<li><a class="reference internal" href="#metadata-received-alert" id="id282">metadata_received_alert</a></li>
<li><a class="reference internal" href="#udp-error-alert" id="id283">udp_error_alert</a></li>
<li><a class="reference internal" href="#external-ip-alert" id="id284">external_ip_alert</a></li>
<li><a class="reference internal" href="#listen-failed-alert" id="id285">listen_failed_alert</a></li>
<li><a class="reference internal" href="#listen-succeeded-alert" id="id286">listen_succeeded_alert</a></li>
<li><a class="reference internal" href="#portmap-error-alert" id="id287">portmap_error_alert</a></li>
<li><a class="reference internal" href="#portmap-alert" id="id288">portmap_alert</a></li>
<li><a class="reference internal" href="#portmap-log-alert" id="id289">portmap_log_alert</a></li>
<li><a class="reference internal" href="#fastresume-rejected-alert" id="id290">fastresume_rejected_alert</a></li>
<li><a class="reference internal" href="#peer-blocked-alert" id="id291">peer_blocked_alert</a></li>
<li><a class="reference internal" href="#dht-announce-alert" id="id292">dht_announce_alert</a></li>
<li><a class="reference internal" href="#dht-get-peers-alert" id="id293">dht_get_peers_alert</a></li>
<li><a class="reference internal" href="#stats-alert" id="id294">stats_alert</a></li>
<li><a class="reference internal" href="#cache-flushed-alert" id="id295">cache_flushed_alert</a></li>
<li><a class="reference internal" href="#anonymous-mode-alert" id="id296">anonymous_mode_alert</a></li>
<li><a class="reference internal" href="#lsd-peer-alert" id="id297">lsd_peer_alert</a></li>
<li><a class="reference internal" href="#trackerid-alert" id="id298">trackerid_alert</a></li>
<li><a class="reference internal" href="#dht-bootstrap-alert" id="id299">dht_bootstrap_alert</a></li>
<li><a class="reference internal" href="#rss-alert" id="id300">rss_alert</a></li>
<li><a class="reference internal" href="#torrent-error-alert" id="id301">torrent_error_alert</a></li>
<li><a class="reference internal" href="#torrent-need-cert-alert" id="id302">torrent_need_cert_alert</a></li>
<li><a class="reference internal" href="#incoming-connection-alert" id="id303">incoming_connection_alert</a></li>
<li><a class="reference internal" href="#add-torrent-alert" id="id304">add_torrent_alert</a></li>
<li><a class="reference internal" href="#state-update-alert" id="id305">state_update_alert</a></li>
<li><a class="reference internal" href="#torrent-update-alert" id="id306">torrent_update_alert</a></li>
<li><a class="reference internal" href="#rss-item-alert" id="id307">rss_item_alert</a></li>
<li><a class="reference internal" href="#dht-error-alert" id="id308">dht_error_alert</a></li>
<li><a class="reference internal" href="#dht-immutable-item-alert" id="id309">dht_immutable_item_alert</a></li>
<li><a class="reference internal" href="#dht-mutable-item-alert" id="id310">dht_mutable_item_alert</a></li>
<li><a class="reference internal" href="#dht-put-alert" id="id311">dht_put_alert</a></li>
<li><a class="reference internal" href="#i2p-alert" id="id312">i2p_alert</a></li>
</ul>
</div>
<p>The <a class="reference external" href="reference-Session.html#pop_alert()">pop_alert()</a> function on <a class="reference external" href="reference-Session.html#session">session</a> is the interface for retrieving
@ -1724,20 +1728,74 @@ struct peer_blocked_alert: torrent_alert
{
virtual std::string <strong>message</strong> () const;
enum reason_t
{
ip_filter,
port_filter,
i2p_mixed,
privileged_ports,
utp_disabled,
tcp_disabled,
};
const static int static_category = alert::ip_block_notification;
address ip;
int reason;
};
</pre>
<a name="reason_t"></a><div class="section" id="enum-reason-t">
<h2>enum reason_t</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<table border="1" class="docutils">
<colgroup>
<col width="47%" />
<col width="18%" />
<col width="34%" />
</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>ip_filter</td>
<td>0</td>
<td>&nbsp;</td>
</tr>
<tr><td>port_filter</td>
<td>1</td>
<td>&nbsp;</td>
</tr>
<tr><td>i2p_mixed</td>
<td>2</td>
<td>&nbsp;</td>
</tr>
<tr><td>privileged_ports</td>
<td>3</td>
<td>&nbsp;</td>
</tr>
<tr><td>utp_disabled</td>
<td>4</td>
<td>&nbsp;</td>
</tr>
<tr><td>tcp_disabled</td>
<td>5</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<a name="ip"></a><dl class="docutils">
<dt>ip</dt>
<dd>the address that was blocked.</dd>
</dl>
<a name="dht_announce_alert"></a></div>
</div>
<div class="section" id="dht-announce-alert">
<h1>dht_announce_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is generated when a DHT node announces to an info-hash on our DHT node. It belongs
to the <tt class="docutils literal">dht_notification</tt> category.</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is generated when a DHT node announces to an info-hash on our
DHT node. It belongs to the <tt class="docutils literal">dht_notification</tt> category.</p>
<pre class="literal-block">
struct dht_announce_alert: alert
{
@ -1753,8 +1811,8 @@ struct dht_announce_alert: alert
<div class="section" id="dht-get-peers-alert">
<h1>dht_get_peers_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is generated when a DHT node sends a <tt class="docutils literal">get_peers</tt> message to our DHT node.
It belongs to the <tt class="docutils literal">dht_notification</tt> category.</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is generated when a DHT node sends a <tt class="docutils literal">get_peers</tt> message to
our DHT node. It belongs to the <tt class="docutils literal">dht_notification</tt> category.</p>
<pre class="literal-block">
struct dht_get_peers_alert: alert
{
@ -1860,25 +1918,26 @@ struct stats_alert: torrent_alert
</table>
<a name="transferred[num_channels]"></a><dl class="docutils">
<dt>transferred[num_channels]</dt>
<dd>an array of samples. The enum describes what each
sample is a measurement of. All of these are raw, and not smoothing is performed.</dd>
<dd>an array of samples. The enum describes what each sample is a
measurement of. All of these are raw, and not smoothing is performed.</dd>
</dl>
<a name="interval"></a><dl class="docutils">
<dt>interval</dt>
<dd>the number of milliseconds during which these stats
were collected. This is typically just above 1000, but if CPU is
limited, it may be higher than that.</dd>
<dd>the number of milliseconds during which these stats were collected.
This is typically just above 1000, but if CPU is limited, it may be
higher than that.</dd>
</dl>
<a name="cache_flushed_alert"></a></div>
</div>
<div class="section" id="cache-flushed-alert">
<h1>cache_flushed_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is posted when the disk cache has been flushed for a specific torrent
as a result of a call to <a class="reference external" href="reference-Core.html#flush_cache()">torrent_handle::flush_cache()</a>. This <a class="reference external" href="reference-Alerts.html#alert">alert</a> belongs to the
<tt class="docutils literal">storage_notification</tt> category, which must be enabled to let this <a class="reference external" href="reference-Alerts.html#alert">alert</a> through.
The <a class="reference external" href="reference-Alerts.html#alert">alert</a> is also posted when removing a torrent from the <a class="reference external" href="reference-Session.html#session">session</a>, once the outstanding
cache flush is complete and the torrent does no longer have any files open.</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is posted when the disk cache has been flushed for a specific
torrent as a result of a call to <a class="reference external" href="reference-Core.html#flush_cache()">torrent_handle::flush_cache()</a>. This
<a class="reference external" href="reference-Alerts.html#alert">alert</a> belongs to the <tt class="docutils literal">storage_notification</tt> category, which must be
enabled to let this <a class="reference external" href="reference-Alerts.html#alert">alert</a> through. The <a class="reference external" href="reference-Alerts.html#alert">alert</a> is also posted when removing
a torrent from the <a class="reference external" href="reference-Session.html#session">session</a>, once the outstanding cache flush is complete
and the torrent does no longer have any files open.</p>
<pre class="literal-block">
struct cache_flushed_alert: torrent_alert
{
@ -1942,8 +2001,8 @@ The tracker which this failed for is specified in the <tt class="docutils litera
<div class="section" id="lsd-peer-alert">
<h1>lsd_peer_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is generated when we receive a local service discovery message from a peer
for a torrent we're currently participating in.</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is generated when we receive a local service discovery message
from a peer for a torrent we're currently participating in.</p>
<pre class="literal-block">
struct lsd_peer_alert: peer_alert
{
@ -1956,9 +2015,9 @@ struct lsd_peer_alert: peer_alert
<div class="section" id="trackerid-alert">
<h1>trackerid_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is posted whenever a tracker responds with a <tt class="docutils literal">trackerid</tt>. The tracker ID
is like a cookie. The libtorrent will store the tracker ID for this tracker and
repeat it in subsequent announces.</p>
<p>This <a class="reference external" href="reference-Alerts.html#alert">alert</a> is posted whenever a tracker responds with a <tt class="docutils literal">trackerid</tt>.
The tracker ID is like a cookie. The libtorrent will store the tracker ID
for this tracker and repeat it in subsequent announces.</p>
<pre class="literal-block">
struct trackerid_alert: tracker_alert
{
@ -2260,7 +2319,7 @@ struct dht_error_alert: alert
op_t operation;
};
</pre>
<a name="op_t"></a><div class="section" id="id226">
<a name="op_t"></a><div class="section" id="id227">
<h2>enum op_t</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<table border="1" class="docutils">
@ -2294,7 +2353,135 @@ struct dht_error_alert: alert
<dt>operation</dt>
<dd>the operation that failed</dd>
</dl>
<a name="dht_immutable_item_alert"></a></div>
</div>
<div class="section" id="dht-immutable-item-alert">
<h1>dht_immutable_item_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>this <a class="reference external" href="reference-Alerts.html#alert">alert</a> is posted as a response to a call to session::get_item(),
specifically the overload for looking up immutable items in the DHT.</p>
<pre class="literal-block">
struct dht_immutable_item_alert: alert
{
virtual bool <strong>discardable</strong> () const;
<strong>dht_immutable_item_alert</strong> (sha1_hash const&amp; t, entry const&amp; i);
virtual std::string <strong>message</strong> () const;
| alert::dht_notification;
sha1_hash target;
entry item;
};
</pre>
<a name="target"></a><dl class="docutils">
<dt>target</dt>
<dd>the target hash of the immutable item. This must
match the sha-1 hash of the bencoded form of <tt class="docutils literal">item</tt>.</dd>
</dl>
<a name="item"></a><dl class="docutils">
<dt>item</dt>
<dd>the data for this item</dd>
</dl>
<a name="dht_mutable_item_alert"></a></div>
<div class="section" id="dht-mutable-item-alert">
<h1>dht_mutable_item_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>this <a class="reference external" href="reference-Alerts.html#alert">alert</a> is posted as a response to a call to session::get_item(),
specifically the overload for looking up mutable items in the DHT.</p>
<pre class="literal-block">
struct dht_mutable_item_alert: alert
{
<strong>dht_mutable_item_alert</strong> (boost::array&lt;char, 32&gt; k
, boost::array&lt;char, 64&gt; sig
, boost::uint64_t sequence
, std::string const&amp; s
, entry const&amp; i);
virtual bool <strong>discardable</strong> () const;
virtual std::string <strong>message</strong> () const;
| alert::dht_notification;
boost::array&lt;char, 32&gt; key;
boost::array&lt;char, 64&gt; signature;
boost::uint64_t seq;
std::string salt;
entry item;
};
</pre>
<a name="key"></a><dl class="docutils">
<dt>key</dt>
<dd>the public key that was looked up</dd>
</dl>
<a name="signature"></a><dl class="docutils">
<dt>signature</dt>
<dd>the signature of the data. This is not the signature of the
plain encoded form of the item, but it includes the sequence number
and possibly the hash as well. See the dht_store document for more
information. This is primarily useful for echoing back in a store
request.</dd>
</dl>
<a name="seq"></a><dl class="docutils">
<dt>seq</dt>
<dd>the sequence number of this item</dd>
</dl>
<a name="salt"></a><dl class="docutils">
<dt>salt</dt>
<dd>the salf, if any, used to lookup and store this item. If no
salt was used, this is an empty string</dd>
</dl>
<a name="item"></a><dl class="docutils">
<dt>item</dt>
<dd>the data for this item</dd>
</dl>
<a name="dht_put_alert"></a></div>
<div class="section" id="dht-put-alert">
<h1>dht_put_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>this is posted when a DHT put operation completes. This is useful if the
client is waiting for a put to complete before shutting down for instance.</p>
<pre class="literal-block">
struct dht_put_alert: alert
{
virtual std::string <strong>message</strong> () const;
const static int static_category = alert::dht_notification;
sha1_hash target;
boost::array&lt;char, 32&gt; public_key;
boost::array&lt;char, 64&gt; signature;
std::string salt;
boost::uint64_t seq;
};
</pre>
<a name="target"></a><dl class="docutils">
<dt>target</dt>
<dd>the target hash the item was stored under if this was an <em>immutable</em>
item.</dd>
</dl>
<a name="public_key"></a>
<a name="signature"></a>
<a name="salt"></a>
<a name="seq"></a><dl class="docutils">
<dt>public_key signature salt seq</dt>
<dd>if a mutable item was stored, these are the public key, signature,
salt and sequence number the item was stored under.</dd>
</dl>
<a name="i2p_alert"></a></div>
<div class="section" id="i2p-alert">
<h1>i2p_alert</h1>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/alert_types.hpp">libtorrent/alert_types.hpp</a>&quot;</p>
<p>this <a class="reference external" href="reference-Alerts.html#alert">alert</a> is used to report errors in the i2p SAM connection</p>
<pre class="literal-block">
struct i2p_alert : alert
{
<strong>i2p_alert</strong> (error_code const&amp; ec);
virtual std::string <strong>message</strong> () const;
const static int static_category = alert::error_notification;
error_code error;
};
</pre>
<a name="error"></a><dl class="docutils">
<dt>error</dt>
<dd>the error that occurred in the i2p SAM connection</dd>
</dl>
</div>
</div>
<div id="footer">

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Bencoding</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
@ -227,14 +227,16 @@ integer_type&amp; <strong>integer</strong> ();
const list_type&amp; <strong>list</strong> () const;
</pre>
<p>The <tt class="docutils literal">integer()</tt>, <tt class="docutils literal">string()</tt>, <tt class="docutils literal">list()</tt> and <tt class="docutils literal">dict()</tt> functions
are accessors that return the respective type. If the <tt class="docutils literal">entry</tt> object isn't of the
type you request, the accessor will throw <a class="reference external" href="reference-Error_Codes.html#libtorrent_exception">libtorrent_exception</a> (which derives from
<tt class="docutils literal"><span class="pre">std::runtime_error</span></tt>). You can ask an <tt class="docutils literal">entry</tt> for its type through the
<tt class="docutils literal">type()</tt> function.</p>
<p>If you want to create an <tt class="docutils literal">entry</tt> you give it the type you want it to have in its
constructor, and then use one of the non-const accessors to get a reference which you then
can assign the value you want it to have.</p>
<p>The typical code to get info from a torrent file will then look like this:</p>
are accessors that return the respective type. If the <tt class="docutils literal">entry</tt> object
isn't of the type you request, the accessor will throw
<a class="reference external" href="reference-Error_Codes.html#libtorrent_exception">libtorrent_exception</a> (which derives from <tt class="docutils literal"><span class="pre">std::runtime_error</span></tt>). You
can ask an <tt class="docutils literal">entry</tt> for its type through the <tt class="docutils literal">type()</tt> function.</p>
<p>If you want to create an <tt class="docutils literal">entry</tt> you give it the type you want it to
have in its constructor, and then use one of the non-const accessors
to get a reference which you then can assign the value you want it to
have.</p>
<p>The typical code to get info from a torrent file will then look like
this:</p>
<pre class="literal-block">
entry torrent_file;
// ...
@ -261,8 +263,8 @@ if (entry* i = torrent_file.find_key(&quot;announce&quot;))
std::cout &lt;&lt; tracker_url &lt;&lt; &quot;\n&quot;;
}
</pre>
<p>To make it easier to extract information from a torrent file, the class <a class="reference external" href="reference-Core.html#torrent_info">torrent_info</a>
exists.</p>
<p>To make it easier to extract information from a torrent file, the
class <a class="reference external" href="reference-Core.html#torrent_info">torrent_info</a> exists.</p>
<a name="swap()"></a></div>
<div class="section" id="swap">
<h2>swap()</h2>
@ -279,14 +281,15 @@ const entry&amp; <strong>operator[]</strong> (std::string const&amp; key) const;
entry&amp; <strong>operator[]</strong> (char const* key);
const entry&amp; <strong>operator[]</strong> (char const* key) const;
</pre>
<p>All of these functions requires the <a class="reference external" href="reference-Bencoding.html#entry">entry</a> to be a dictionary, if it isn't they
will throw <tt class="docutils literal"><span class="pre">libtorrent::type_error</span></tt>.</p>
<p>The non-const versions of the <tt class="docutils literal">operator[]</tt> will return a reference to either
the existing element at the given key or, if there is no element with the
given key, a reference to a newly inserted element at that key.</p>
<p>All of these functions requires the <a class="reference external" href="reference-Bencoding.html#entry">entry</a> to be a dictionary, if it
isn't they will throw <tt class="docutils literal"><span class="pre">libtorrent::type_error</span></tt>.</p>
<p>The non-const versions of the <tt class="docutils literal">operator[]</tt> will return a reference
to either the existing element at the given key or, if there is no
element with the given key, a reference to a newly inserted element at
that key.</p>
<p>The const version of <tt class="docutils literal">operator[]</tt> will only return a reference to an
existing element at the given key. If the key is not found, it will throw
<tt class="docutils literal"><span class="pre">libtorrent::type_error</span></tt>.</p>
existing element at the given key. If the key is not found, it will
throw <tt class="docutils literal"><span class="pre">libtorrent::type_error</span></tt>.</p>
<a name="find_key()"></a></div>
<div class="section" id="find-key">
<h2>find_key()</h2>
@ -296,11 +299,11 @@ entry* <strong>find_key</strong> (char const* key);
entry* <strong>find_key</strong> (std::string const&amp; key);
entry const* <strong>find_key</strong> (std::string const&amp; key) const;
</pre>
<p>These functions requires the <a class="reference external" href="reference-Bencoding.html#entry">entry</a> to be a dictionary, if it isn't they
will throw <tt class="docutils literal"><span class="pre">libtorrent::type_error</span></tt>.</p>
<p>They will look for an element at the given key in the dictionary, if the
element cannot be found, they will return 0. If an element with the given
key is found, the return a pointer to it.</p>
<p>These functions requires the <a class="reference external" href="reference-Bencoding.html#entry">entry</a> to be a dictionary, if it isn't
they will throw <tt class="docutils literal"><span class="pre">libtorrent::type_error</span></tt>.</p>
<p>They will look for an element at the given key in the dictionary, if
the element cannot be found, they will return 0. If an element with
the given key is found, the return a pointer to it.</p>
<a name="to_string()"></a></div>
<div class="section" id="to-string">
<h2>to_string()</h2>
@ -350,12 +353,10 @@ of the bencoded structure, with JSON-style syntax</p>
</table>
<a name="m_type_queried"></a><dl class="docutils">
<dt>m_type_queried</dt>
<dd>in debug mode this is set to false by bdecode
to indicate that the program has not yet queried
the type of this <a class="reference external" href="reference-Bencoding.html#entry">entry</a>, and sould not assume
that it has a certain type. This is asserted in
the accessor functions. This does not apply if
exceptions are used.</dd>
<dd>in debug mode this is set to false by bdecode to indicate that the
program has not yet queried the type of this <a class="reference external" href="reference-Bencoding.html#entry">entry</a>, and sould not
assume that it has a certain type. This is asserted in the accessor
functions. This does not apply if exceptions are used.</dd>
</dl>
<a name="pascal_string"></a></div>
</div>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Core</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
@ -55,15 +55,15 @@
<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="#disk-buffer-holder" id="id166">disk_buffer_holder</a></li>
<li><a class="reference internal" href="#peer-info" id="id167">peer_info</a></li>
<li><a class="reference internal" href="#peer-request" id="id168">peer_request</a></li>
<li><a class="reference internal" href="#block-info" id="id169">block_info</a></li>
<li><a class="reference internal" href="#partial-piece-info" id="id170">partial_piece_info</a></li>
<li><a class="reference internal" href="#torrent-handle" id="id171">torrent_handle</a></li>
<li><a class="reference internal" href="#torrent-status" id="id172">torrent_status</a></li>
<li><a class="reference internal" href="#announce-entry" id="id173">announce_entry</a></li>
<li><a class="reference internal" href="#torrent-info" id="id174">torrent_info</a></li>
<li><a class="reference internal" href="#disk-buffer-holder" id="id167">disk_buffer_holder</a></li>
<li><a class="reference internal" href="#peer-info" id="id168">peer_info</a></li>
<li><a class="reference internal" href="#peer-request" id="id169">peer_request</a></li>
<li><a class="reference internal" href="#block-info" id="id170">block_info</a></li>
<li><a class="reference internal" href="#partial-piece-info" id="id171">partial_piece_info</a></li>
<li><a class="reference internal" href="#torrent-handle" id="id172">torrent_handle</a></li>
<li><a class="reference internal" href="#torrent-status" id="id173">torrent_status</a></li>
<li><a class="reference internal" href="#announce-entry" id="id174">announce_entry</a></li>
<li><a class="reference internal" href="#torrent-info" id="id175">torrent_info</a></li>
</ul>
</div>
<a name="disk_buffer_holder"></a><div class="section" id="disk-buffer-holder">
@ -1884,7 +1884,9 @@ void <strong>set_sequential_download</strong> (bool sd) const;
</pre>
<p><tt class="docutils literal">set_sequential_download()</tt> enables or disables <em>sequential
download</em>. When enabled, the piece picker will pick pieces in sequence
instead of rarest first.</p>
instead of rarest first. In this mode, piece priorities are ignored,
with the exception of priority 7, which are still preferred over the
sequential piece order.</p>
<p>Enabling sequential download will affect the piece distribution
negatively in the swarm. It should be used sparingly.</p>
<a name="connect_peer()"></a></div>
@ -3452,6 +3454,25 @@ void <strong>parse_magnet_uri</strong> (std::string const&amp; uri, add_torrent_
std::size_t <strong>hash_value</strong> (torrent_status const&amp; ts);
</pre>
<p>allows <a class="reference external" href="reference-Core.html#torrent_handle">torrent_handle</a> to be used in unordered_map and unordered_set.</p>
<a name="sign_mutable_item()"></a></div>
<div class="section" id="sign-mutable-item">
<h2>sign_mutable_item()</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/kademlia/item.hpp">libtorrent/kademlia/item.hpp</a>&quot;</p>
<pre class="literal-block">
void <strong>sign_mutable_item</strong> (
std::pair&lt;char const*, int&gt; v
, std::pair&lt;char const*, int&gt; salt
, boost::uint64_t seq
, char const* pk
, char const* sk
, char* sig);
</pre>
<p>given a byte range <tt class="docutils literal">v</tt> and an optional byte range <tt class="docutils literal">salt</tt>, a
sequence number, public key <tt class="docutils literal">pk</tt> (must be 32 bytes) and a secret key
<tt class="docutils literal">sk</tt> (must be 64 bytes), this function produces a signature which
is written into a 64 byte buffer pointed to by <tt class="docutils literal">sig</tt>. The caller
is responsible for allocating the destination buffer that's passed in
as the <tt class="docutils literal">sig</tt> argument. Typically it would be allocated on the stack.</p>
</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Create Torrents</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Custom Storage</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
@ -67,6 +67,7 @@ basics of implementing a custom storage.</p>
struct temp_storage : storage_interface
{
temp_storage(file_storage const&amp; fs) : m_files(fs) {}
void set_file_priority(std::vector&lt;boost::uint8_t&gt; const&amp; prio) {}
virtual bool initialize(bool allocate_files) { return false; }
virtual bool has_any_file() { return false; }
virtual int read(char* buf, int slot, int offset, int size)
@ -223,6 +224,7 @@ struct storage_interface
{
virtual bool <strong>initialize</strong> (bool allocate_files) = 0;
virtual bool <strong>has_any_file</strong> () = 0;
virtual void <strong>set_file_priority</strong> (std::vector&lt;boost::uint8_t&gt; const&amp; prio) = 0;
virtual int <strong>writev</strong> (<a class="reference external" href="file::iovec_t">file::iovec_t</a> const* bufs, int slot, int offset, int num_bufs, int flags = <a class="reference external" href="file::random_access">file::random_access</a>);
virtual int <strong>readv</strong> (<a class="reference external" href="file::iovec_t">file::iovec_t</a> const* bufs, int slot, int offset, int num_bufs, int flags = <a class="reference external" href="file::random_access">file::random_access</a>);
virtual void <strong>hint_read</strong> (int, int, int);
@ -265,6 +267,13 @@ virtual bool <strong>has_any_file</strong> () = 0;
<p>This function is called when first checking (or re-checking) the storage for a torrent.
It should return true if any of the files that is used in this storage exists on disk.
If so, the storage will be checked for existing pieces before starting the download.</p>
<a name="set_file_priority()"></a></div>
<div class="section" id="set-file-priority">
<h2>set_file_priority()</h2>
<pre class="literal-block">
virtual void <strong>set_file_priority</strong> (std::vector&lt;boost::uint8_t&gt; const&amp; prio) = 0;
</pre>
<p>change the priorities of files.</p>
<a name="writev()"></a>
<a name="readv()"></a></div>
<div class="section" id="writev-readv">
@ -501,8 +510,9 @@ class default_storage : public storage_interface, boost::noncopyable
, std::string const&amp; path, file_pool&amp; fp
, std::vector&lt;boost::uint8_t&gt; const&amp; file_prio);
bool <strong>move_slot</strong> (int src_slot, int dst_slot);
void <strong>hint_read</strong> (int slot, int offset, int len);
bool <strong>rename_file</strong> (int index, std::string const&amp; new_filename);
int <strong>read</strong> (char* buf, int slot, int offset, int size);
void <strong>set_file_priority</strong> (std::vector&lt;boost::uint8_t&gt; const&amp; prio);
bool <strong>has_any_file</strong> ();
int <strong>move_storage</strong> (std::string const&amp; save_path, int flags);
bool <strong>write_resume_data</strong> (entry&amp; rd) const;
@ -515,7 +525,7 @@ class default_storage : public storage_interface, boost::noncopyable
int <strong>readv</strong> (<a class="reference external" href="file::iovec_t">file::iovec_t</a> const* bufs, int slot, int offset, int num_bufs, int flags = <a class="reference external" href="file::random_access">file::random_access</a>);
bool <strong>swap_slots3</strong> (int slot1, int slot2, int slot3);
bool <strong>initialize</strong> (bool allocate_files);
void <strong>hint_read</strong> (int slot, int offset, int len);
int <strong>read</strong> (char* buf, int slot, int offset, int size);
bool <strong>swap_slots</strong> (int slot1, int slot2);
int <strong>sparse_end</strong> (int start) const;
file_storage const&amp; <strong>files</strong> () const;

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Error Codes</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
@ -55,7 +55,7 @@
<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="#libtorrent-exception" id="id36">libtorrent_exception</a></li>
<li><a class="reference internal" href="#libtorrent-exception" id="id37">libtorrent_exception</a></li>
</ul>
</div>
<a name="libtorrent_exception"></a><div class="section" id="libtorrent-exception">
@ -110,6 +110,13 @@ boost::system::error_category&amp; <strong>get_bdecode_category</strong> ();
boost::system::error_category&amp; <strong>get_socks_category</strong> ();
</pre>
<p>returns the error_category for SOCKS5 errors</p>
<a name="get_upnp_category()"></a></div>
<div class="section" id="get-upnp-category">
<h2>get_upnp_category()</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/upnp.hpp">libtorrent/upnp.hpp</a>&quot;</p>
<pre class="literal-block">
boost::system::error_category&amp; <strong>get_upnp_category</strong> ();
</pre>
<a name="error_code_enum"></a></div>
<div class="section" id="enum-error-code-enum">
<h2>enum error_code_enum</h2>
@ -911,7 +918,7 @@ URL. i.e. it doesn't contain &quot;announce.</td>
</tbody>
</table>
<a name="error_code_enum"></a></div>
<div class="section" id="id30">
<div class="section" id="id31">
<h2>enum error_code_enum</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/lazy_entry.hpp">libtorrent/lazy_entry.hpp</a>&quot;</p>
<table border="1" class="docutils">
@ -955,8 +962,12 @@ URL. i.e. it doesn't contain &quot;announce.</td>
<td>6</td>
<td>bencoded item count limit exceeded</td>
</tr>
<tr><td>error_code_max</td>
<tr><td>overflow</td>
<td>7</td>
<td>integer overflow</td>
</tr>
<tr><td>error_code_max</td>
<td>8</td>
<td>the number of error codes</td>
</tr>
</tbody>
@ -1025,7 +1036,7 @@ URL. i.e. it doesn't contain &quot;announce.</td>
</tbody>
</table>
<a name="error_code_enum"></a></div>
<div class="section" id="id33">
<div class="section" id="id34">
<h2>enum error_code_enum</h2>
<p>Declared in &quot;<a class="reference external" href="../include/libtorrent/upnp.hpp">libtorrent/upnp.hpp</a>&quot;</p>
<table border="1" class="docutils">

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Filter</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title></title>
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
<link rel="stylesheet" type="text/css" href="../../css/rst.css" />
@ -172,7 +172,7 @@ and can add its own torrent_plugins.</p>
struct plugin
{
virtual boost::shared_ptr&lt;torrent_plugin&gt; <strong>new_torrent</strong> (torrent*, void*);
virtual void <strong>added</strong> (boost::weak_ptr&lt;aux::session_impl&gt;);
virtual void <strong>added</strong> (aux::session_impl*);
virtual void <strong>on_alert</strong> (alert const*);
virtual void <strong>on_tick</strong> ();
virtual void <strong>save_state</strong> (entry&amp;) const;
@ -195,7 +195,7 @@ to the new torrent. Otherwise, return an empty shared_ptr to a
<div class="section" id="added">
<h3>added()</h3>
<pre class="literal-block">
virtual void <strong>added</strong> (boost::weak_ptr&lt;aux::session_impl&gt;);
virtual void <strong>added</strong> (aux::session_impl*);
</pre>
<p>called when <a class="reference external" href="reference-Plugins.html#plugin">plugin</a> is added to a <a class="reference external" href="reference-Session.html#session">session</a></p>
<a name="on_alert()"></a></div>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>RSS</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Session</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
@ -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="id164">add_torrent_params</a></li>
<li><a class="reference internal" href="#cache-status" id="id165">cache_status</a></li>
<li><a class="reference internal" href="#session-proxy" id="id166">session_proxy</a></li>
<li><a class="reference internal" href="#id36" id="id167">session</a></li>
<li><a class="reference internal" href="#dht-lookup" id="id168">dht_lookup</a></li>
<li><a class="reference internal" href="#dht-routing-bucket" id="id169">dht_routing_bucket</a></li>
<li><a class="reference internal" href="#utp-status" id="id170">utp_status</a></li>
<li><a class="reference internal" href="#session-status" id="id171">session_status</a></li>
<li><a class="reference internal" href="#add-torrent-params" id="id168">add_torrent_params</a></li>
<li><a class="reference internal" href="#cache-status" id="id169">cache_status</a></li>
<li><a class="reference internal" href="#session-proxy" id="id170">session_proxy</a></li>
<li><a class="reference internal" href="#id36" id="id171">session</a></li>
<li><a class="reference internal" href="#dht-lookup" id="id172">dht_lookup</a></li>
<li><a class="reference internal" href="#dht-routing-bucket" id="id173">dht_routing_bucket</a></li>
<li><a class="reference internal" href="#utp-status" id="id174">utp_status</a></li>
<li><a class="reference internal" href="#session-status" id="id175">session_status</a></li>
</ul>
</div>
<a name="add_torrent_params"></a><div class="section" id="add-torrent-params">
@ -504,7 +504,7 @@ since the start of the <a class="reference external" href="reference-Session.htm
</dl>
<a name="total_read_back"></a><dl class="docutils">
<dt>total_read_back</dt>
<dd>the number of bytes that had to be read back from disk because
<dd>the number of blocks that had to be read back from disk because
they were flushed before the SHA-1 hash got to hash them. If this
is large, a larger cache could significantly improve performance</dd>
</dl>
@ -591,6 +591,14 @@ class session: public boost::noncopyable
void <strong>set_dht_settings</strong> (dht_settings const&amp; settings);
void <strong>add_dht_router</strong> (std::pair&lt;std::string, int&gt; const&amp; node);
void <strong>add_dht_node</strong> (std::pair&lt;std::string, int&gt; const&amp; node);
void <strong>dht_get_item</strong> (sha1_hash const&amp; target);
void <strong>dht_get_item</strong> (boost::array&lt;char, 32&gt; key
, std::string salt = std::string());
sha1_hash <strong>dht_put_item</strong> (entry data);
void <strong>dht_put_item</strong> (boost::array&lt;char, 32&gt; key
, boost::function&lt;void(entry&amp;, boost::array&lt;char,64&gt;&amp;
, boost::uint64_t&amp;, std::string const&amp;)&gt; cb
, std::string salt = std::string());
void <strong>add_extension</strong> (boost::function&lt;boost::shared_ptr&lt;torrent_plugin&gt;(
torrent*, void*)&gt; ext);
void <strong>add_extension</strong> (boost::shared_ptr&lt;plugin&gt; ext);
@ -976,6 +984,81 @@ to the regular routing table, which effectively means they are only used
for bootstrapping, to keep the load off them.</p>
<p>An example routing node that you could typically add is
<tt class="docutils literal">router.bittorrent.com</tt>.</p>
<a name="dht_get_item()"></a></div>
<div class="section" id="dht-get-item">
<h2>dht_get_item()</h2>
<pre class="literal-block">
void <strong>dht_get_item</strong> (sha1_hash const&amp; target);
</pre>
<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="id97">
<h2>dht_get_item()</h2>
<pre class="literal-block">
void <strong>dht_get_item</strong> (boost::array&lt;char, 32&gt; key
, std::string salt = std::string());
</pre>
<p>query the DHT for a mutable item under the public key <tt class="docutils literal">key</tt>.
this is an ed25519 key. <tt class="docutils literal">salt</tt> is optional and may be left
as an empty string if no salt is to be used.
if the item is found in the DHT, a <a class="reference external" href="reference-Alerts.html#dht_mutable_item_alert">dht_mutable_item_alert</a> is
posted.</p>
<a name="dht_put_item()"></a></div>
<div class="section" id="dht-put-item">
<h2>dht_put_item()</h2>
<pre class="literal-block">
sha1_hash <strong>dht_put_item</strong> (entry data);
</pre>
<p>store the given bencoded data as an immutable item in the DHT.
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="id99">
<h2>dht_put_item()</h2>
<pre class="literal-block">
void <strong>dht_put_item</strong> (boost::array&lt;char, 32&gt; key
, boost::function&lt;void(entry&amp;, boost::array&lt;char,64&gt;&amp;
, boost::uint64_t&amp;, std::string const&amp;)&gt; cb
, std::string salt = std::string());
</pre>
<p>store an immutable item. The <tt class="docutils literal">key</tt> is the public key the blob is
to be stored under. The optional <tt class="docutils literal">salt</tt> argument is a string that
is to be mixed in with the key when determining where in the DHT
the value is to be stored. The callback function is called from within
the libtorrent network thread once we've found where to store the blob,
possibly with the current value stored under the key.
The values passed to the callback functions are:</p>
<dl class="docutils">
<dt>entry&amp; value</dt>
<dd>the current value stored under the key (may be empty). Also expected
to be set to the value to be stored by the function.</dd>
<dt>boost::array&lt;char,64&gt;&amp; signature</dt>
<dd>the signature authenticating the current value. This may be zeroes
if there is currently no value stored. The functon is expected to
fill in this buffer with the signature of the new value to store.
To generate the signature, you may want to use the
<tt class="docutils literal">sign_mutable_item</tt> function.</dd>
<dt>boost::uint64_t&amp; seq</dt>
<dd>current sequence number. May be zero if there is no current value.
The function is expected to set this to the new sequence number of
the value that is to be stored. Sequence numbers must be monotonically
increasing. Attempting to overwrite a value with a lower or equal
sequence number will fail, even if the signature is correct.</dd>
<dt>std::string const&amp; salt</dt>
<dd>this is the salt that was used for this put call.</dd>
</dl>
<p>Since the callback function <tt class="docutils literal">cb</tt> is called from within libtorrent,
it is critical to not perform any blocking operations. Ideally not
even locking a mutex. Pass any data required for this function along
with the function object's context and make the function entirely
self-contained. The only reason data blobs' values are computed
via a function instead of just passing in the new value is to avoid
race conditions. If you want to <em>update</em> the value in the DHT, you
must first retrieve it, then modify it, then write it back. The way
the DHT works, it is natural to always do a lookup before storing and
calling the callback in between is convenient.</p>
<a name="add_extension()"></a></div>
<div class="section" id="add-extension">
<h2>add_extension()</h2>
@ -1261,6 +1344,13 @@ same pointer until the <a class="reference external" href="reference-Alerts.html
is useful for leaving any <a class="reference external" href="reference-Alerts.html#alert">alert</a> dispatching mechanism independent of
this blocking call, the dispatcher can be called and it can pop the
<a class="reference external" href="reference-Alerts.html#alert">alert</a> independently.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Although these functions are all thread-safe, popping alerts from
multiple separate threads may introduce race conditions in that
the thread issuing an asynchronous operation may not be the one
receiving the alert with the result.</p>
</div>
<p>In the python binding, <tt class="docutils literal">wait_for_alert</tt> takes the number of
milliseconds to wait as an integer.</p>
<p>To control the max number of alerts that's queued by the <a class="reference external" href="reference-Session.html#session">session</a>, see

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Settings</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
@ -1153,9 +1153,8 @@ as they leave disk I/O time for other processes.</dd>
</dl>
<a name="disk_cache_algorithm"></a><dl class="docutils">
<dt>disk_cache_algorithm</dt>
<dd>tells the disk I/O thread which cache flush algorithm to use. The
default algorithm is largest_contiguous. This is specified by the
<a class="reference external" href="reference-Settings.html#disk_cache_algo_t">disk_cache_algo_t</a> enum.</dd>
<dd>tells the disk I/O thread which cache flush algorithm to use.
This is specified by the <a class="reference external" href="reference-Settings.html#disk_cache_algo_t">disk_cache_algo_t</a> enum.</dd>
</dl>
<a name="read_cache_line_size"></a><dl class="docutils">
<dt>read_cache_line_size</dt>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Storage</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>String</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Time</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>Utility</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" type="text/css" href="../../css/base.css" />

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.10: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
<title>libtorrent reference documentation</title>
<link rel="stylesheet" type="text/css" href="../../css/base.css" />
<link rel="stylesheet" type="text/css" href="../../css/rst.css" />
@ -67,6 +67,7 @@
<div class="line"><a class="reference external" href="reference-Core.html#make_magnet_uri()">make_magnet_uri()</a></div>
<div class="line"><a class="reference external" href="reference-Core.html#parse_magnet_uri()">parse_magnet_uri()</a></div>
<div class="line"><a class="reference external" href="reference-Core.html#hash_value()">hash_value()</a></div>
<div class="line"><a class="reference external" href="reference-Core.html#sign_mutable_item()">sign_mutable_item()</a></div>
</div>
</div>
<div class="section" id="time">
@ -227,6 +228,10 @@
<div class="line"><a class="reference external" href="reference-Alerts.html#torrent_update_alert">torrent_update_alert</a></div>
<div class="line"><a class="reference external" href="reference-Alerts.html#rss_item_alert">rss_item_alert</a></div>
<div class="line"><a class="reference external" href="reference-Alerts.html#dht_error_alert">dht_error_alert</a></div>
<div class="line"><a class="reference external" href="reference-Alerts.html#dht_immutable_item_alert">dht_immutable_item_alert</a></div>
<div class="line"><a class="reference external" href="reference-Alerts.html#dht_mutable_item_alert">dht_mutable_item_alert</a></div>
<div class="line"><a class="reference external" href="reference-Alerts.html#dht_put_alert">dht_put_alert</a></div>
<div class="line"><a class="reference external" href="reference-Alerts.html#i2p_alert">i2p_alert</a></div>
</div>
</div>
<div class="section" id="storage">
@ -278,6 +283,7 @@
<div class="line"><a class="reference external" href="reference-Error_Codes.html#get_i2p_category()">get_i2p_category()</a></div>
<div class="line"><a class="reference external" href="reference-Error_Codes.html#get_bdecode_category()">get_bdecode_category()</a></div>
<div class="line"><a class="reference external" href="reference-Error_Codes.html#get_socks_category()">get_socks_category()</a></div>
<div class="line"><a class="reference external" href="reference-Error_Codes.html#get_upnp_category()">get_upnp_category()</a></div>
<div class="line"><a class="reference external" href="reference-Error_Codes.html#error_code_enum">error_code_enum</a></div>
<div class="line"><a class="reference external" href="reference-Error_Codes.html#http_errors">http_errors</a></div>
<div class="line"><a class="reference external" href="reference-Error_Codes.html#i2p_error_code">i2p_error_code</a></div>

View File

@ -22,14 +22,14 @@
</head><body>
<h1>libtorrent todo-list</h1>
<span style="color: #f77">2 important</span>
<span style="color: #3c3">4 relevant</span>
<span style="color: #3c3">6 relevant</span>
<span style="color: #77f">13 feasible</span>
<span style="color: #999">40 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:663</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">43 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
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:663</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:666</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:6093</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:6093</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:6178</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:6178</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> return false;
}
TORRENT_ASSERT(m_connections.find(p) == m_connections.end());
m_connections.insert(p);
@ -235,7 +235,58 @@ when it doesn't have any of the file do the following</h2><h4>../src/web_peer_co
{
// we should not try this server again.
t-&gt;remove_web_seed(this);
</pre></td></tr><tr style="background: #cfc"><td>relevance&nbsp;2</td><td><a href="javascript:expand(4)">../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="4" 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(4)">../src/gzip.cpp:132</a></td><td>it would be nice to use proper error handling here</td></tr><tr id="4" style="display: none;" colspan="3"><td colspan="3"><h2>it would be nice to use proper error handling here</h2><h4>../src/gzip.cpp:132</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> --size;
++buffer;
}
if (!size || *buffer) return -1;
--size;
++buffer;
}
if (flags &amp; FHCRC)
{
if (size &lt; 2) return -1;
size -= 2;
// buffer += 2;
}
return total_size - size;
}
<div style="background: #ffff00" width="100%"> bool inflate_gzip(
</div> char const* in
, int size
, std::vector&lt;char&gt;&amp; buffer
, int maximum_size
, std::string&amp; error)
{
TORRENT_ASSERT(maximum_size &gt; 0);
int header_len = gzip_header(in, size);
if (header_len &lt; 0)
{
error = "invalid gzip header";
return true;
}
// start off with 4 kilobytes and grow
// if needed
boost::uint32_t destlen = 4096;
int ret = 0;
do
{
TORRENT_TRY {
buffer.resize(destlen);
} TORRENT_CATCH(std::exception&amp; e) {
error = "out of memory";
return true;
}
boost::uint32_t srclen = size - header_len;
in += header_len;
</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
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
// ordered, lowest first.
@ -288,7 +339,58 @@ 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(5)">../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="5" 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(6)">../src/torrent.cpp:694</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:694</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> state_updated();
set_state(torrent_status::downloading);
m_override_resume_data = true;
init();
}
#endif // if 0
void torrent::leave_seed_mode(bool seed)
{
if (!m_seed_mode) return;
if (!seed)
{
// this means the user promised we had all the
// files, but it turned out we didn't. This is
// an error.
<div style="background: #ffff00" width="100%">
</div>#if defined TORRENT_ERROR_LOGGING
debug_log("*** FAILED SEED MODE, rechecking");
#endif
}
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
debug_log("*** LEAVING SEED MODE (%s)", seed ? "as seed" : "as non-seed");
#endif
m_seed_mode = false;
// seed is false if we turned out not
// to be a seed after all
if (!seed)
{
set_state(torrent_status::downloading);
force_recheck();
}
m_num_verified = 0;
m_verified.clear();
}
void torrent::verified(int piece)
{
TORRENT_ASSERT(piece &lt; int(m_verified.size()));
TORRENT_ASSERT(piece &gt;= 0);
TORRENT_ASSERT(m_verified.get_bit(piece) == false);
++m_num_verified;
m_verified.set_bit(piece);
}
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);
disconnect(errors::missing_location, 2);
#ifdef TORRENT_DEBUG
TORRENT_ASSERT(m_statistics.last_payload_downloaded()
@ -339,7 +441,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(6)">../src/kademlia/node.cpp:68</a></td><td>make this configurable in dht_settings</td></tr><tr id="6" 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: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"
#include "libtorrent/kademlia/routing_table.hpp"
#include "libtorrent/kademlia/node.hpp"
#include "libtorrent/kademlia/dht_observer.hpp"
@ -390,7 +492,7 @@ 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(7)">../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="7" 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: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
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();
ip = &amp;b6[0];
@ -421,8 +523,8 @@ that we have a fixed length</h2><h4>../src/kademlia/node_id.cpp:137</h4><pre sty
id[1] = (c &gt;&gt; 16) &amp; 0xff;
id[2] = ((c &gt;&gt; 8) &amp; 0xf8) | (random() &amp; 0x7);
for (int i = 3; i &lt; 19; ++i) id[i] = random();
id[19] = r;
for (int i = 3; i &lt; 19; ++i) id[i] = random() &amp; 0xff;
id[19] = r &amp; 0xff;
return id;
}
@ -430,7 +532,7 @@ that we have a fixed length</h2><h4>../src/kademlia/node_id.cpp:137</h4><pre sty
node_id generate_random_id()
{
char r[20];
for (int i = 0; i &lt; 20; ++i) r[i] = random();
for (int i = 0; i &lt; 20; ++i) r[i] = random() &amp; 0xff;
return hasher(r, 20).final();
}
@ -443,7 +545,7 @@ 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(8)">../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="8" style="display: none;" colspan="3"><td colspan="3"><h2>in chunked encoding mode, this assert won't hold.
</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;
http_seed_connection::downloading_piece_progress() const
{
@ -495,8 +597,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(9)">../src/peer_connection.cpp:2596</a></td><td>peers should really be corked/uncorked outside of all completed disk operations</td></tr><tr id="9" 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:2596</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:2585</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:2585</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> }
if (is_disconnecting()) return;
@ -547,8 +649,8 @@ all completed disk operations</h2><h4>../src/peer_connection.cpp:2596</h4><pre s
return;
}
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(10)">../src/session_impl.cpp:5543</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="10" 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:5543</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:5552</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:5552</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());
@ -599,9 +701,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(11)">../src/session_impl.cpp:6253</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="11" 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:6341</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:6253</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:6341</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">#endif
if (!m_external_ip.cast_vote(ip, source_type, source)) return;
@ -652,11 +754,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(12)">../src/torrent.cpp:1043</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="12" 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:1091</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:1043</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:1091</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (c) c-&gt;disconnect(errors::no_memory);
return;
}
@ -707,8 +809,8 @@ up to the highest written piece in each file</h2><h4>../src/torrent.cpp:1043</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(13)">../src/torrent.cpp:5355</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="13" 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:5355</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:5439</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:5439</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);
}
@ -759,9 +861,9 @@ it may pose an issue when downgrading though</h2><h4>../src/torrent.cpp:5355</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(14)">../src/torrent.cpp:6261</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="14" 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:6346</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:6261</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:6346</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);
@ -812,7 +914,7 @@ for all peers though</h2><h4>../src/torrent.cpp:6261</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(15)">../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="15" 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: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;"> {
tmp_path += i[0];
tmp_path += i[1];
tmp_path += i[2];
@ -863,7 +965,7 @@ for all peers though</h2><h4>../src/torrent.cpp:6261</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(16)">../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="16" 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: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
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;">
while (*s1 != 0 || *s2 != 0)
@ -916,7 +1018,7 @@ 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(17)">../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="17" style="display: none;" colspan="3"><td colspan="3"><h2>once the filename renaming is removed from here
</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
int cnt = 0;
if (!files.insert(e.path).second)
@ -968,7 +1070,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(18)">../src/kademlia/node.cpp:797</a></td><td>find_node should write directly to the response entry</td></tr><tr id="18" style="display: none;" colspan="3"><td colspan="3"><h2>find_node should write directly to the response entry</h2><h4>../src/kademlia/node.cpp:797</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: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;"> {
TORRENT_LOG(node) &lt;&lt; " values: " &lt;&lt; reply["values"].list().size();
}
#endif
@ -1019,9 +1121,9 @@ this check can be removed as well</h2><h4>../src/torrent_info.cpp:439</h4><pre s
// listen port and instead use the source port of the packet?
if (msg_keys[5] &amp;&amp; msg_keys[5]-&gt;int_value() != 0)
port = m.addr.port();
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(19)">../include/libtorrent/ip_voter.hpp:100</a></td><td>instead, have one instance per possible subnet, global IPv4, global IPv6, loopback, 192.168.x.x, 10.x.x.x, etc.</td></tr><tr id="19" style="display: none;" colspan="3"><td colspan="3"><h2>instead, have one instance per possible subnet, global IPv4, global IPv6, loopback, 192.168.x.x, 10.x.x.x, etc.</h2><h4>../include/libtorrent/ip_voter.hpp:100</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> bloom_filter&lt;32&gt; m_external_address_voters;
std::vector&lt;external_ip_t&gt; m_external_addresses;
address m_external_address;
</pre></td></tr><tr style="background: #ccf"><td>relevance&nbsp;1</td><td><a href="javascript:expand(21)">../include/libtorrent/ip_voter.hpp:122</a></td><td>instead, have one instance per possible subnet, global IPv4, global IPv6, loopback, 192.168.x.x, 10.x.x.x, etc.</td></tr><tr id="21" style="display: none;" colspan="3"><td colspan="3"><h2>instead, have one instance per possible subnet, global IPv4, global IPv6, loopback, 192.168.x.x, 10.x.x.x, etc.</h2><h4>../include/libtorrent/ip_voter.hpp:122</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> // away all the votes and started from scratch, in case
// our IP has changed
ptime m_last_rotate;
};
// this keeps track of multiple external IPs (for now, just IPv6 and IPv4, but
@ -1046,7 +1148,7 @@ 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(20)">../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="20" 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: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
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();
@ -1099,7 +1201,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(21)">../src/bt_peer_connection.cpp:638</a></td><td>this could be optimized using knuth morris pratt</td></tr><tr id="21" style="display: none;" colspan="3"><td colspan="3"><h2>this could be optimized using knuth morris pratt</h2><h4>../src/bt_peer_connection.cpp:638</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;
}
@ -1150,7 +1252,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(22)">../src/bt_peer_connection.cpp:2107</a></td><td>if we're finished, send upload_only message</td></tr><tr id="22" style="display: none;" colspan="3"><td colspan="3"><h2>if we're finished, send upload_only message</h2><h4>../src/bt_peer_connection.cpp:2107</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: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';
else bitfield_string[k] = '0';
}
peer_log("==&gt; BITFIELD [ %s ]", bitfield_string.c_str());
@ -1201,8 +1303,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(23)">../src/bt_peer_connection.cpp:3351</a></td><td>move the erasing into the loop above remove all payload ranges that has been sent</td></tr><tr id="23" 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:3351</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:3356</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:3356</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;
@ -1253,7 +1355,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(24)">../src/file.cpp:1381</a></td><td>is there any way to pre-fetch data from a file on windows?</td></tr><tr id="24" 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:1381</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:1415</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:1415</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
void file::init_file()
{
if (m_page_size != 0) return;
@ -1304,7 +1406,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(25)">../src/http_tracker_connection.cpp:99</a></td><td>support authentication (i.e. user name and password) in the URL</td></tr><tr id="25" 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: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
, proxy_settings const&amp; ps
, std::string const&amp; auth
#if TORRENT_USE_I2P
@ -1355,7 +1457,7 @@ remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.c
if (arguments_start != std::string::npos)
url += "&amp;";
else
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(26)">../src/i2p_stream.cpp:210</a></td><td>move this to proxy_base and use it in all proxies</td></tr><tr id="26" style="display: none;" colspan="3"><td colspan="3"><h2>move this to proxy_base and use it in all proxies</h2><h4>../src/i2p_stream.cpp:210</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(28)">../src/i2p_stream.cpp:209</a></td><td>move this to proxy_base and use it in all proxies</td></tr><tr id="28" style="display: none;" colspan="3"><td colspan="3"><h2>move this to proxy_base and use it in all proxies</h2><h4>../src/i2p_stream.cpp:209</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
i2p_stream::i2p_stream(io_service&amp; io_service)
: proxy_base(io_service)
, m_id(0)
@ -1406,7 +1508,7 @@ remove all payload ranges that has been sent</h2><h4>../src/bt_peer_connection.c
void i2p_stream::connected(error_code const&amp; e, boost::shared_ptr&lt;handler_type&gt; h)
{
TORRENT_ASSERT(m_magic == 0x1337);
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(27)">../src/packet_buffer.cpp:176</a></td><td>use compare_less_wrap for this comparison as well</td></tr><tr id="27" style="display: none;" colspan="3"><td colspan="3"><h2>use compare_less_wrap for this comparison as well</h2><h4>../src/packet_buffer.cpp:176</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> while (new_size &lt; size)
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(29)">../src/packet_buffer.cpp:176</a></td><td>use compare_less_wrap for this comparison as well</td></tr><tr id="29" style="display: none;" colspan="3"><td colspan="3"><h2>use compare_less_wrap for this comparison as well</h2><h4>../src/packet_buffer.cpp:176</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> while (new_size &lt; size)
new_size &lt;&lt;= 1;
void** new_storage = (void**)malloc(sizeof(void*) * new_size);
@ -1457,9 +1559,9 @@ 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(28)">../src/peer_connection.cpp:2759</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="28" 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(30)">../src/peer_connection.cpp:2748</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="30" 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:2759</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
we can construct a full bitfield</h2><h4>../src/peer_connection.cpp:2748</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
@ -1510,7 +1612,7 @@ we can construct a full bitfield</h2><h4>../src/peer_connection.cpp:2759</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(29)">../src/peer_connection.cpp:2890</a></td><td>sort the allowed fast set in priority order</td></tr><tr id="29" style="display: none;" colspan="3"><td colspan="3"><h2>sort the allowed fast set in priority order</h2><h4>../src/peer_connection.cpp:2890</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(31)">../src/peer_connection.cpp:2879</a></td><td>sort the allowed fast set in priority order</td></tr><tr id="31" style="display: none;" colspan="3"><td colspan="3"><h2>sort the allowed fast set in priority order</h2><h4>../src/peer_connection.cpp:2879</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
@ -1561,8 +1663,8 @@ we can construct a full bitfield</h2><h4>../src/peer_connection.cpp:2759</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(30)">../src/peer_connection.cpp:4610</a></td><td>peers should really be corked/uncorked outside of all completed disk operations</td></tr><tr id="30" 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:4610</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(32)">../src/peer_connection.cpp:4599</a></td><td>peers should really be corked/uncorked outside of all completed disk operations</td></tr><tr id="32" 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:4599</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);
@ -1613,8 +1715,8 @@ all completed disk operations</h2><h4>../src/peer_connection.cpp:4610</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(31)">../src/policy.cpp:868</a></td><td>only allow _one_ connection to use this override at a time</td></tr><tr id="31" 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:868</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(33)">../src/policy.cpp:869</a></td><td>only allow _one_ connection to use this override at a time</td></tr><tr id="33" 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:869</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";
}
@ -1665,7 +1767,7 @@ override at a time</h2><h4>../src/policy.cpp:868</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(32)">../src/session_impl.cpp:1764</a></td><td>recalculate all connect candidates for all torrents</td></tr><tr id="32" style="display: none;" colspan="3"><td colspan="3"><h2>recalculate all connect candidates for all torrents</h2><h4>../src/session_impl.cpp:1764</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(34)">../src/session_impl.cpp:1767</a></td><td>recalculate all connect candidates for all torrents</td></tr><tr id="34" 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
// the uTP connections cannot be closed gracefully
m_udp_socket.close();
m_external_udp_port = 0;
@ -1716,7 +1818,7 @@ override at a time</h2><h4>../src/policy.cpp:868</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(33)">../src/session_impl.cpp:3227</a></td><td>have a separate list for these connections, instead of having to loop through all of them</td></tr><tr id="33" 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:3227</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(35)">../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="35" 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;"> // --------------------------------------------------------------
if (!m_paused) m_auto_manage_time_scaler--;
if (m_auto_manage_time_scaler &lt; 0)
{
@ -1767,7 +1869,7 @@ override at a time</h2><h4>../src/policy.cpp:868</h4><pre style="background: #f6
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(34)">../src/session_impl.cpp:4307</a></td><td>allow extensions to sort torrents for queuing</td></tr><tr id="34" style="display: none;" colspan="3"><td colspan="3"><h2>allow extensions to sort torrents for queuing</h2><h4>../src/session_impl.cpp:4307</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(36)">../src/session_impl.cpp:4316</a></td><td>allow extensions to sort torrents for queuing</td></tr><tr id="36" style="display: none;" colspan="3"><td colspan="3"><h2>allow extensions to sort torrents for queuing</h2><h4>../src/session_impl.cpp:4316</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
@ -1818,9 +1920,9 @@ override at a time</h2><h4>../src/policy.cpp:868</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(35)">../src/session_impl.cpp:4463</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="35" 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(37)">../src/session_impl.cpp:4472</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="37" 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:4463</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
connections</h2><h4>../src/session_impl.cpp:4472</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> {
if (m_boost_connections &gt; max_connections)
{
m_boost_connections -= max_connections;
@ -1871,7 +1973,7 @@ connections</h2><h4>../src/session_impl.cpp:4463</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(36)">../src/session_impl.cpp:4497</a></td><td>make this bias configurable</td></tr><tr id="36" style="display: none;" colspan="3"><td colspan="3"><h2>make this bias configurable</h2><h4>../src/session_impl.cpp:4497</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(37)">../src/session_impl.cpp:4498</a></td><td>also take average_peers into account, to create a bias for downloading torrents with < average peers</td></tr><tr id="37" 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:4498</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(38)">../src/session_impl.cpp:4506</a></td><td>make this bias configurable</td></tr><tr id="38" style="display: none;" colspan="3"><td colspan="3"><h2>make this bias configurable</h2><h4>../src/session_impl.cpp:4506</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(39)">../src/session_impl.cpp:4507</a></td><td>also take average_peers into account, to create a bias for downloading torrents with < average peers</td></tr><tr id="39" 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:4507</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();
@ -1922,7 +2024,7 @@ connections</h2><h4>../src/session_impl.cpp:4463</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(38)">../src/session_impl.cpp:4642</a></td><td>make configurable</td></tr><tr id="38" style="display: none;" colspan="3"><td colspan="3"><h2>make configurable</h2><h4>../src/session_impl.cpp:4642</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:4651</a></td><td>make configurable</td></tr><tr id="40" style="display: none;" colspan="3"><td colspan="3"><h2>make configurable</h2><h4>../src/session_impl.cpp:4651</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)
@ -1955,7 +2057,7 @@ connections</h2><h4>../src/session_impl.cpp:4463</h4><pre style="background: #f6
++m_allowed_upload_slots;
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(39)">../src/session_impl.cpp:4656</a></td><td>make configurable</td></tr><tr id="39" style="display: none;" colspan="3"><td colspan="3"><h2>make configurable</h2><h4>../src/session_impl.cpp:4656</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(41)">../src/session_impl.cpp:4665</a></td><td>make configurable</td></tr><tr id="41" style="display: none;" colspan="3"><td colspan="3"><h2>make configurable</h2><h4>../src/session_impl.cpp:4665</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;
@ -2006,7 +2108,7 @@ connections</h2><h4>../src/session_impl.cpp:4463</h4><pre style="background: #f6
// 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(40)">../src/storage.cpp:324</a></td><td>if the read fails, set error and exit immediately</td></tr><tr id="40" 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(42)">../src/storage.cpp:324</a></td><td>if the read fails, set error and exit immediately</td></tr><tr id="42" 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();
int size = slot_size;
int num_blocks = (size + block_size - 1) / block_size;
@ -2057,7 +2159,7 @@ connections</h2><h4>../src/session_impl.cpp:4463</h4><pre style="background: #f6
{
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(41)">../src/storage.cpp:358</a></td><td>if the read fails, set error and exit immediately</td></tr><tr id="41" 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(43)">../src/storage.cpp:358</a></td><td>if the read fails, set error and exit immediately</td></tr><tr id="43" 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;"> {
ph.h.update((char const*)bufs[i].iov_base, bufs[i].iov_len);
small_piece_size -= bufs[i].iov_len;
}
@ -2108,14 +2210,14 @@ connections</h2><h4>../src/session_impl.cpp:4463</h4><pre style="background: #f6
, 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(42)">../src/storage.cpp:629</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="42" 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(44)">../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="44" 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:629</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:633</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> for (;;)
{
if (file_offset &lt; m_files.file_size(file_index))
if (file_offset &lt; files().file_size(file_index))
break;
file_offset -= m_files.file_size(file_index);
file_offset -= files().file_size(file_index);
++file_index;
TORRENT_ASSERT(file_index != files().num_files());
}
@ -2125,7 +2227,7 @@ maybe use the same format as .torrent files and reuse some code from torrent_inf
if (!file_handle || ec) return slot;
size_type data_start = file_handle-&gt;sparse_end(file_offset);
return int((data_start + m_files.piece_length() - 1) / m_files.piece_length());
return int((data_start + files().piece_length() - 1) / files().piece_length());
}
bool default_storage::verify_resume_data(lazy_entry const&amp; rd, error_code&amp; error)
@ -2161,9 +2263,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(43)">../src/storage.cpp:1265</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="43" 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(45)">../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="45" 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:1265</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:1269</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
@ -2214,12 +2316,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(44)">../src/torrent.cpp:1245</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="44" 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(46)">../src/torrent.cpp:1293</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="46" 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:1245</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:1293</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
@ -2270,12 +2372,12 @@ 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(45)">../src/torrent.cpp:5088</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="45" 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(47)">../src/torrent.cpp:5172</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="47" 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:5088</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> if (m_seed_mode) m_verified.resize(m_torrent_file-&gt;num_pieces(), false);
which are kept in sync</h2><h4>../src/torrent.cpp:5172</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);
@ -2326,12 +2428,12 @@ which are kept in sync</h2><h4>../src/torrent.cpp:5088</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(46)">../src/torrent.cpp:5224</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="46" 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(48)">../src/torrent.cpp:5308</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="48" 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:5224</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:5308</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> add_web_seed(url, web_seed_entry::http_seed);
}
}
@ -2382,9 +2484,9 @@ no one uses merkle torrents</h2><h4>../src/torrent.cpp:5224</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(47)">../src/torrent.cpp:5412</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="47" 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:5496</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="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.
using file_base</h2><h4>../src/torrent.cpp:5412</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:5496</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())
{
@ -2435,10 +2537,10 @@ using file_base</h2><h4>../src/torrent.cpp:5412</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(48)">../src/torrent.cpp:7974</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="48" 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(50)">../src/torrent.cpp:8059</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="50" 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:7974</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:8059</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;"> }
rarest_pieces.clear();
rarest_rarity = pp.peer_count;
@ -2489,7 +2591,7 @@ it num_interested == 0, we need to pick a new piece</h2><h4>../src/torrent.cpp:7
{
m_picker-&gt;get_availability(avail_vec);
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(49)">../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="49" 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(51)">../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="51" 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;"> }
@ -2542,9 +2644,58 @@ 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(50)">../src/utp_stream.cpp:1604</a></td><td>this loop may not be very efficient</td></tr><tr id="50" style="display: none;" colspan="3"><td colspan="3"><h2>this loop may not be very efficient</h2><h4>../src/utp_stream.cpp:1604</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
private:
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(52)">../src/upnp.cpp:65</a></td><td>listen_interface is not used. It's meant to bind the broadcast socket</td></tr><tr id="52" 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;">
#if defined TORRENT_ASIO_DEBUGGING
#include "libtorrent/debug.hpp"
#endif
#include &lt;boost/bind.hpp&gt;
#include &lt;boost/ref.hpp&gt;
#if BOOST_VERSION &lt; 103500
#include &lt;asio/ip/host_name.hpp&gt;
#include &lt;asio/ip/multicast.hpp&gt;
#else
#include &lt;boost/asio/ip/host_name.hpp&gt;
#include &lt;boost/asio/ip/multicast.hpp&gt;
#endif
#include &lt;cstdlib&gt;
namespace libtorrent {
static error_code ec;
<div style="background: #ffff00" width="100%">upnp::upnp(io_service&amp; ios, connection_queue&amp; cc
</div> , address const&amp; listen_interface, std::string const&amp; user_agent
, portmap_callback_t const&amp; cb, log_callback_t const&amp; lcb
, bool ignore_nonrouters, void* state)
: m_user_agent(user_agent)
, m_callback(cb)
, m_log_callback(lcb)
, m_retry_count(0)
, m_io_service(ios)
, m_socket(udp::endpoint(address_v4::from_string("239.255.255.250", ec), 1900)
, boost::bind(&amp;upnp::on_reply, self(), _1, _2, _3))
, m_broadcast_timer(ios)
, m_refresh_timer(ios)
, m_map_timer(ios)
, m_disabled(false)
, m_closing(false)
, m_ignore_non_routers(ignore_nonrouters)
, m_cc(cc)
{
TORRENT_ASSERT(cb);
error_code ec;
m_socket.open(ios, ec);
if (state)
{
upnp_state_t* s = (upnp_state_t*)state;
m_devices.swap(s-&gt;devices);
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(53)">../src/utp_stream.cpp:1606</a></td><td>this loop may not be very efficient</td></tr><tr id="53" 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;
};
@ -2552,6 +2703,8 @@ private:
// if ack is true, we need to send a packet regardless of if there's
// any data. Returns true if we could send more data (i.e. call
// send_pkt() again)
// returns true if there is more space for payload in our
// congestion window, false if there is no more space.
bool utp_socket_impl::send_pkt(int flags)
{
INVARIANT_CHECK;
@ -2593,7 +2746,59 @@ 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(51)">../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="51" style="display: none;" colspan="3"><td colspan="3"><h2>instad of refreshing a bucket by using find_nodes,
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(54)">../src/kademlia/dht_tracker.cpp:451</a></td><td>ideally this function would be called when the put completes</td></tr><tr id="54" 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:451</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;
}
bool get_mutable_item_callback(item&amp; it, boost::function&lt;void(item const&amp;)&gt; f)
{
// the reason to wrap here is to control the return value
// since it controls whether we re-put the content
TORRENT_ASSERT(it.is_mutable());
f(it);
return false;
}
bool put_immutable_item_callback(item&amp; it, boost::function&lt;void()&gt; f
, entry data)
{
TORRENT_ASSERT(!it.is_mutable());
it.assign(data);
<div style="background: #ffff00" width="100%"> f();
</div> return true;
}
bool put_mutable_item_callback(item&amp; it, boost::function&lt;void(item&amp;)&gt; cb)
{
cb(it);
return true;
}
void dht_tracker::get_item(sha1_hash const&amp; target
, boost::function&lt;void(item const&amp;)&gt; cb)
{
m_dht.get_item(target, boost::bind(&amp;get_immutable_item_callback, _1, cb));
}
// key is a 32-byte binary string, the public key to look up.
// the salt is optional
void dht_tracker::get_item(char const* key
, boost::function&lt;void(item const&amp;)&gt; cb
, std::string salt)
{
m_dht.get_item(key, salt, boost::bind(&amp;get_mutable_item_callback, _1, cb));
}
void dht_tracker::put_item(entry data
, boost::function&lt;void()&gt; cb)
{
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(55)">../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="55" 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";
}
}
@ -2645,7 +2850,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(52)">../include/libtorrent/config.hpp:326</a></td><td>Make this count Unicode characters instead of bytes on windows</td></tr><tr id="52" 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:326</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)">../include/libtorrent/config.hpp:326</a></td><td>Make this count Unicode characters instead of bytes on windows</td></tr><tr id="56" 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:326</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
// ==== eCS(OS/2) ===
#elif defined __OS2__
#define TORRENT_OS2
@ -2696,7 +2901,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(53)">../include/libtorrent/peer_connection.hpp:729</a></td><td>make this private</td></tr><tr id="53" style="display: none;" colspan="3"><td colspan="3"><h2>make this private</h2><h4>../include/libtorrent/peer_connection.hpp:729</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(57)">../include/libtorrent/peer_connection.hpp:729</a></td><td>make this private</td></tr><tr id="57" style="display: none;" colspan="3"><td colspan="3"><h2>make this private</h2><h4>../include/libtorrent/peer_connection.hpp:729</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
@ -2747,7 +2952,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(54)">../include/libtorrent/peer_connection.hpp:810</a></td><td>make these private as well</td></tr><tr id="54" style="display: none;" colspan="3"><td colspan="3"><h2>make these private as well</h2><h4>../include/libtorrent/peer_connection.hpp:810</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(58)">../include/libtorrent/peer_connection.hpp:810</a></td><td>make these private as well</td></tr><tr id="58" style="display: none;" colspan="3"><td colspan="3"><h2>make these private as well</h2><h4>../include/libtorrent/peer_connection.hpp:810</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
@ -2798,7 +3003,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(55)">../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="55" 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(59)">../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="59" 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);
}
@ -2850,7 +3055,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(56)">../include/libtorrent/stat.hpp:113</a></td><td>this is 4 bytes of padding!</td></tr><tr id="56" 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(60)">../include/libtorrent/stat.hpp:113</a></td><td>this is 4 bytes of padding!</td></tr><tr id="60" 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()
@ -2901,7 +3106,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(57)">../include/libtorrent/torrent.hpp:1357</a></td><td>there's space for another bit here</td></tr><tr id="57" style="display: none;" colspan="3"><td colspan="3"><h2>there's space for another bit here</h2><h4>../include/libtorrent/torrent.hpp:1357</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(61)">../include/libtorrent/torrent.hpp:1347</a></td><td>there's space for another bit here</td></tr><tr id="61" style="display: none;" colspan="3"><td colspan="3"><h2>there's space for another bit here</h2><h4>../include/libtorrent/torrent.hpp:1347</h4><pre style="background: #f6f6f6; border: solid 1px #ddd;">
// these represent whether or not this torrent is counted
// in the total counters of active seeds and downloads
// in the session.
@ -2952,7 +3157,7 @@ m_sock.bind(endpoint, ec);</h2><h4>../include/libtorrent/proxy_base.hpp:166</h4>
// if this is true, libtorrent may pause and resume
// this torrent depending on queuing rules. Torrents
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(58)">../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="58" 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(62)">../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="62" 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;
@ -3003,7 +3208,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(59)">../include/libtorrent/upnp.hpp:108</a></td><td>support using the windows API for UPnP operations as well</td></tr><tr id="59" 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(63)">../include/libtorrent/upnp.hpp:108</a></td><td>support using the windows API for UPnP operations as well</td></tr><tr id="63" 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
@ -3011,7 +3216,7 @@ m_sock.bind(endpoint, ec);</h2><h4>../include/libtorrent/proxy_base.hpp:166</h4>
};
}
boost::system::error_category&amp; get_upnp_category();
TORRENT_EXPORT boost::system::error_category&amp; get_upnp_category();
// int: port-mapping index
// address: external address as queried from router
@ -3054,7 +3259,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(60)">../include/libtorrent/utp_stream.hpp:378</a></td><td>implement blocking write. Low priority since it's not used (yet)</td></tr><tr id="60" 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(64)">../include/libtorrent/utp_stream.hpp:378</a></td><td>implement blocking write. Low priority since it's not used (yet)</td></tr><tr id="64" 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;
@ -3105,4 +3310,56 @@ public:
TORRENT_ASSERT(false);
}
</pre></td></tr><tr style="background: #ccc"><td>relevance&nbsp;0</td><td><a href="javascript:expand(65)">../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="65" 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
{
// calculate the target hash for an immutable item.
sha1_hash TORRENT_EXTRA_EXPORT item_target_id(
std::pair&lt;char const*, int&gt; v);
// calculate the target hash for a mutable item.
sha1_hash TORRENT_EXTRA_EXPORT item_target_id(std::pair&lt;char const*, int&gt; salt
, char const* pk);
bool TORRENT_EXTRA_EXPORT verify_mutable_item(
std::pair&lt;char const*, int&gt; v
, std::pair&lt;char const*, int&gt; salt
, boost::uint64_t seq
, char const* pk
, char const* sig);
<div style="background: #ffff00" width="100%">
</div>// given a byte range ``v`` and an optional byte range ``salt``, a
// sequence number, public key ``pk`` (must be 32 bytes) and a secret key
// ``sk`` (must be 64 bytes), this function produces a signature which
// is written into a 64 byte buffer pointed to by ``sig``. The caller
// is responsible for allocating the destination buffer that's passed in
// as the ``sig`` argument. Typically it would be allocated on the stack.
void TORRENT_EXPORT sign_mutable_item(
std::pair&lt;char const*, int&gt; v
, std::pair&lt;char const*, int&gt; salt
, boost::uint64_t seq
, char const* pk
, char const* sk
, char* sig);
sha1_hash TORRENT_EXTRA_EXPORT mutable_item_cas(
std::pair&lt;char const*, int&gt; v
, std::pair&lt;char const*, int&gt; salt
, boost::uint64_t seq);
struct TORRENT_EXTRA_EXPORT invalid_item : std::exception
{
virtual const char* what() const throw() { return "invalid DHT item"; }
};
enum
{
item_pk_len = 32,
item_sk_len = 64,
item_sig_len = 64
};
</pre></td></tr></table></body></html>