merged fixes from RC_1_0 and regenerated documentation

This commit is contained in:
Arvid Norberg 2015-05-12 06:23:14 +00:00
parent 72e0e331a5
commit a44731aabb
25 changed files with 920 additions and 809 deletions

View File

@ -70,6 +70,8 @@
* almost completely changed the storage interface (for custom storage) * almost completely changed the storage interface (for custom storage)
* added support for hashing pieces in multiple threads * added support for hashing pieces in multiple threads
1.0.5 release
* improve ip_voter to avoid flapping * improve ip_voter to avoid flapping
* fixed bug when max_peerlist_size was set to 0 * fixed bug when max_peerlist_size was set to 0
* fix issues with missing exported symbols when building dll * fix issues with missing exported symbols when building dll

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title> <title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -276,10 +277,10 @@ libraries.</li>
</tr> </tr>
<tr><td><tt class="docutils literal">logging</tt></td> <tr><td><tt class="docutils literal">logging</tt></td>
<td><ul class="first last simple"> <td><ul class="first last simple">
<li><tt class="docutils literal">off</tt> - default. logging disabled.</li> <li><tt class="docutils literal">off</tt> - logging alerts disabled.</li>
<li><tt class="docutils literal">on</tt> - logging alerts available, still need to <li><tt class="docutils literal">on</tt> - default. logging alerts available,
be enabled by the alert mask. The reason logging still need to be enabled by the alert mask. The
is disabled by default is to keep the binary reason to disable logging is to keep the binary
size down.</li> size down.</li>
</ul> </ul>
</td> </td>
@ -294,16 +295,6 @@ logging of the DHT protocol traffic.</li>
</ul> </ul>
</td> </td>
</tr> </tr>
<tr><td><tt class="docutils literal"><span class="pre">need-librt</span></tt></td>
<td><ul class="first last simple">
<li><tt class="docutils literal">no</tt> - this platform does not need to link
against librt to have POSIX time functions.</li>
<li><tt class="docutils literal">yes</tt> - specify this if your linux system
requires you to link against librt.a. This is
typically the case on x86 64 bit systems.</li>
</ul>
</td>
</tr>
<tr><td><tt class="docutils literal">asserts</tt></td> <tr><td><tt class="docutils literal">asserts</tt></td>
<td><ul class="first last simple"> <td><ul class="first last simple">
<li><tt class="docutils literal">auto</tt> - asserts are on if in debug mode</li> <li><tt class="docutils literal">auto</tt> - asserts are on if in debug mode</li>
@ -320,14 +311,6 @@ filename.</li>
</ul> </ul>
</td> </td>
</tr> </tr>
<tr><td><tt class="docutils literal"><span class="pre">upnp-logging</span></tt></td>
<td><ul class="first last simple">
<li><tt class="docutils literal">off</tt> - default. Does not log UPnP traffic.</li>
<li><tt class="docutils literal">on</tt> - creates &quot;upnp.log&quot; with the messages
sent to and received from UPnP devices.</li>
</ul>
</td>
</tr>
<tr><td><tt class="docutils literal">encryption</tt></td> <tr><td><tt class="docutils literal">encryption</tt></td>
<td><ul class="first last simple"> <td><ul class="first last simple">
<li><tt class="docutils literal">on</tt> - encrypted bittorrent connections <li><tt class="docutils literal">on</tt> - encrypted bittorrent connections
@ -338,6 +321,14 @@ implementation is used.</li>
</ul> </ul>
</td> </td>
</tr> </tr>
<tr><td><tt class="docutils literal"><span class="pre">mutable-torrents</span></tt></td>
<td><ul class="first last simple">
<li><tt class="docutils literal">on</tt> - mutable torrents are supported
(<a class="reference external" href="http://www.bittorrent.org/beps/bep_0038.html">BEP 38</a>) (default).</li>
<li><tt class="docutils literal">off</tt> - mutable torrents are not supported.</li>
</ul>
</td>
</tr>
<tr><td><tt class="docutils literal">crypto</tt></td> <tr><td><tt class="docutils literal">crypto</tt></td>
<td><ul class="first last simple"> <td><ul class="first last simple">
<li><tt class="docutils literal"><span class="pre">built-in</span></tt> - (default) uses built-in SHA-1 <li><tt class="docutils literal"><span class="pre">built-in</span></tt> - (default) uses built-in SHA-1
@ -435,16 +426,6 @@ functions are used.</li>
</ul> </ul>
</td> </td>
</tr> </tr>
<tr><td><tt class="docutils literal"><span class="pre">full-stats</span></tt></td>
<td><ul class="first last simple">
<li><tt class="docutils literal">on</tt> - default, collects stats for IP overhead
and DHT and trackers. This uses a little bit
extra memory for each peer and torrent.</li>
<li><tt class="docutils literal">off</tt> - only collects the standard stats for
upload and download rate.</li>
</ul>
</td>
</tr>
<tr><td><tt class="docutils literal">iconv</tt></td> <tr><td><tt class="docutils literal">iconv</tt></td>
<td><ul class="first last simple"> <td><ul class="first last simple">
<li><tt class="docutils literal">auto</tt> - use iconv for string conversions for <li><tt class="docutils literal">auto</tt> - use iconv for string conversions for
@ -462,28 +443,6 @@ awareness except on windows).</li>
</ul> </ul>
</td> </td>
</tr> </tr>
<tr><td><tt class="docutils literal"><span class="pre">boost-date-time</span></tt></td>
<td><ul class="first last simple">
<li><tt class="docutils literal">off</tt> - don't build asio types that depend
on boost.date_time. libtorrent doesn't use them
but if the client does, you need these to be
built.</li>
<li><tt class="docutils literal">on</tt> - build asio types that depend on
boost.date_time.</li>
</ul>
</td>
</tr>
<tr><td><tt class="docutils literal">statistics</tt></td>
<td><ul class="first last simple">
<li><tt class="docutils literal">off</tt> - default. No logging of additional
stats.</li>
<li><tt class="docutils literal">on</tt> - log session statistics in current
working directory session_stats&lt;pid&gt;. The log
is rotated every hour. It can be parsed by the
parse_session_stats.py script (requires gnuplot)</li>
</ul>
</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">profile-calls</span></tt></td> <tr><td><tt class="docutils literal"><span class="pre">profile-calls</span></tt></td>
<td><ul class="first last simple"> <td><ul class="first last simple">
<li><tt class="docutils literal">off</tt> - default. No additional call profiling.</li> <li><tt class="docutils literal">off</tt> - default. No additional call profiling.</li>
@ -647,10 +606,10 @@ files. Potential problems is different
compilation units having different views of compilation units having different views of
structs and class layouts and sizes.</td> structs and class layouts and sizes.</td>
</tr> </tr>
<tr><td><tt class="docutils literal">TORRENT_LOGGING</tt></td> <tr><td><tt class="docutils literal">TORRENT_DISABLE_LOGGING</tt></td>
<td>This macro will enable support for logging <td>This macro will disable support for logging
alerts, like log_alert, torrent_log_alert and alerts, like log_alert, torrent_log_alert and
peer_log_alert. Without this build flag, you peer_log_alert. With this build flag, you
cannot enable those alerts.</td> cannot enable those alerts.</td>
</tr> </tr>
<tr><td><tt class="docutils literal">TORRENT_STORAGE_DEBUG</tt></td> <tr><td><tt class="docutils literal">TORRENT_STORAGE_DEBUG</tt></td>
@ -658,12 +617,6 @@ cannot enable those alerts.</td>
checks in the storage, including logging of checks in the storage, including logging of
piece sorting.</td> piece sorting.</td>
</tr> </tr>
<tr><td><tt class="docutils literal">TORRENT_UPNP_LOGGING</tt></td>
<td>Generates a &quot;upnp.log&quot; file with the UPnP
traffic. This is very useful when debugging
support for various UPnP routers.
support for various UPnP routers.</td>
</tr>
<tr><td><tt class="docutils literal">TORRENT_DISK_STATS</tt></td> <tr><td><tt class="docutils literal">TORRENT_DISK_STATS</tt></td>
<td>This will create a log of all disk activity <td>This will create a log of all disk activity
which later can parsed and graphed using which later can parsed and graphed using
@ -678,6 +631,9 @@ operations.</td>
<tr><td><tt class="docutils literal">TORRENT_DISABLE_POOL_ALLOCATOR</tt></td> <tr><td><tt class="docutils literal">TORRENT_DISABLE_POOL_ALLOCATOR</tt></td>
<td>Disables use of <tt class="docutils literal"><span class="pre">boost::pool&lt;&gt;</span></tt>.</td> <td>Disables use of <tt class="docutils literal"><span class="pre">boost::pool&lt;&gt;</span></tt>.</td>
</tr> </tr>
<tr><td><tt class="docutils literal">TORRENT_DISABLE_MUTABLE_TORRENTS</tt></td>
<td>Disables mutable torrent support (<a class="reference external" href="http://www.bittorrent.org/beps/bep_0038.html">BEP 38</a>)</td>
</tr>
<tr><td><tt class="docutils literal">TORRENT_LINKING_SHARED</tt></td> <tr><td><tt class="docutils literal">TORRENT_LINKING_SHARED</tt></td>
<td>If this is defined when including the <td>If this is defined when including the
libtorrent headers, the classes and functions libtorrent headers, the classes and functions
@ -813,7 +769,7 @@ be picked up by libtorrent.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>client_test example program</title> <title>client_test example program</title>
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -18,6 +18,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -104,7 +105,7 @@ which peer that sent the corrupt data if a piece fails the hash test.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title> <title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -125,7 +126,7 @@ algorithms, seeding policies, ports to new platforms etc.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title></title> <title></title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -140,7 +141,7 @@ only IPv4 nodes present.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>BitTorrent extension for DHT RSS feeds</title> <title>BitTorrent extension for DHT RSS feeds</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -427,7 +428,7 @@ in both C and Java.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>BitTorrent DHT security extension</title> <title>BitTorrent DHT security extension</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -297,7 +298,7 @@ are accepted.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>BitTorrent extension for arbitrary DHT store</title> <title>BitTorrent extension for arbitrary DHT store</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -530,7 +531,7 @@ e5f96f6f38320f0f33959cb4d3d656452117aadb
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>libtorrent Examples</title> <title>libtorrent Examples</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -127,9 +128,14 @@ instructions for how to use it <a class="reference external" href="client_test.h
#include &quot;libtorrent/create_torrent.hpp&quot; #include &quot;libtorrent/create_torrent.hpp&quot;
#include &quot;libtorrent/file.hpp&quot; #include &quot;libtorrent/file.hpp&quot;
#include &quot;libtorrent/file_pool.hpp&quot; #include &quot;libtorrent/file_pool.hpp&quot;
#include &quot;libtorrent/hex.hpp&quot; </span><span class="comment single">// for from_hex
</span> </span>
<span class="comment preproc">#include &lt;boost/bind.hpp&gt; <span class="comment preproc">#include &lt;boost/bind.hpp&gt;
</span> </span>
<span class="comment preproc">#ifdef TORRENT_WINDOWS
#include &lt;direct.h&gt; </span><span class="comment single">// for _getcwd
</span><span class="comment preproc">#endif
</span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="name">libtorrent</span><span class="punctuation">;</span> <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="name">libtorrent</span><span class="punctuation">;</span>
<span class="keyword type">int</span> <span class="name function">load_file</span><span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="keyword">const</span><span class="operator">&amp;</span> <span class="name">filename</span><span class="punctuation">,</span> <span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="keyword type">char</span><span class="operator">&gt;&amp;</span> <span class="name">v</span><span class="punctuation">,</span> <span class="name">libtorrent</span><span class="operator">::</span><span class="name">error_code</span><span class="operator">&amp;</span> <span class="name">ec</span><span class="punctuation">,</span> <span class="keyword type">int</span> <span class="name">limit</span> <span class="operator">=</span> <span class="literal number integer">8000000</span><span class="punctuation">)</span> <span class="keyword type">int</span> <span class="name function">load_file</span><span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="keyword">const</span><span class="operator">&amp;</span> <span class="name">filename</span><span class="punctuation">,</span> <span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="keyword type">char</span><span class="operator">&gt;&amp;</span> <span class="name">v</span><span class="punctuation">,</span> <span class="name">libtorrent</span><span class="operator">::</span><span class="name">error_code</span><span class="operator">&amp;</span> <span class="name">ec</span><span class="punctuation">,</span> <span class="keyword type">int</span> <span class="name">limit</span> <span class="operator">=</span> <span class="literal number integer">8000000</span><span class="punctuation">)</span>
@ -193,21 +199,60 @@ instructions for how to use it <a class="reference external" href="client_test.h
<span class="keyword">return</span> <span class="literal number integer">0</span><span class="punctuation">;</span> <span class="keyword">return</span> <span class="literal number integer">0</span><span class="punctuation">;</span>
<span class="punctuation">}</span> <span class="punctuation">}</span>
<span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="name">branch_path</span><span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="keyword">const</span><span class="operator">&amp;</span> <span class="name">f</span><span class="punctuation">)</span>
<span class="punctuation">{</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">f</span><span class="punctuation">.</span><span class="name">empty</span><span class="punctuation">())</span> <span class="keyword">return</span> <span class="name">f</span><span class="punctuation">;</span>
<span class="comment preproc">#ifdef TORRENT_WINDOWS
</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">f</span> <span class="operator">==</span> <span class="literal string">&quot;</span><span class="literal string escape">\\\\</span><span class="literal string">&quot;</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="literal string">&quot;&quot;</span><span class="punctuation">;</span>
<span class="comment preproc">#endif
</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">f</span> <span class="operator">==</span> <span class="literal string">&quot;/&quot;</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="literal string">&quot;&quot;</span><span class="punctuation">;</span>
<span class="keyword type">int</span> <span class="name">len</span> <span class="operator">=</span> <span class="name">f</span><span class="punctuation">.</span><span class="name">size</span><span class="punctuation">();</span>
<span class="comment single">// if the last character is / or \ ignore it
</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">f</span><span class="punctuation">[</span><span class="name">len</span><span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">]</span> <span class="operator">==</span> <span class="literal string char">'/'</span> <span class="operator">||</span> <span class="name">f</span><span class="punctuation">[</span><span class="name">len</span><span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">]</span> <span class="operator">==</span> <span class="literal string char">'\\'</span><span class="punctuation">)</span> <span class="operator">--</span><span class="name">len</span><span class="punctuation">;</span>
<span class="keyword">while</span> <span class="punctuation">(</span><span class="name">len</span> <span class="operator">&gt;</span> <span class="literal number integer">0</span><span class="punctuation">)</span>
<span class="punctuation">{</span>
<span class="operator">--</span><span class="name">len</span><span class="punctuation">;</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">f</span><span class="punctuation">[</span><span class="name">len</span><span class="punctuation">]</span> <span class="operator">==</span> <span class="literal string char">'/'</span> <span class="operator">||</span> <span class="name">f</span><span class="punctuation">[</span><span class="name">len</span><span class="punctuation">]</span> <span class="operator">==</span> <span class="literal string char">'\\'</span><span class="punctuation">)</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">f</span><span class="punctuation">[</span><span class="name">len</span><span class="punctuation">]</span> <span class="operator">==</span> <span class="literal string char">'/'</span> <span class="operator">||</span> <span class="name">f</span><span class="punctuation">[</span><span class="name">len</span><span class="punctuation">]</span> <span class="operator">==</span> <span class="literal string char">'\\'</span><span class="punctuation">)</span> <span class="operator">++</span><span class="name">len</span><span class="punctuation">;</span>
<span class="keyword">return</span> <span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="punctuation">(</span><span class="name">f</span><span class="punctuation">.</span><span class="name">c_str</span><span class="punctuation">(),</span> <span class="name">len</span><span class="punctuation">);</span>
<span class="punctuation">}</span>
<span class="comment single">// do not include files and folders whose <span class="comment single">// do not include files and folders whose
// name starts with a . // name starts with a .
</span><span class="keyword type">bool</span> <span class="name function">file_filter</span><span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="keyword">const</span><span class="operator">&amp;</span> <span class="name">f</span><span class="punctuation">)</span> </span><span class="keyword type">bool</span> <span class="name">file_filter</span><span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="keyword">const</span><span class="operator">&amp;</span> <span class="name">f</span><span class="punctuation">)</span>
<span class="punctuation">{</span> <span class="punctuation">{</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">filename</span><span class="punctuation">(</span><span class="name">f</span><span class="punctuation">)[</span><span class="literal number integer">0</span><span class="punctuation">]</span> <span class="operator">==</span> <span class="literal string char">'.'</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="name builtin">false</span><span class="punctuation">;</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">f</span><span class="punctuation">.</span><span class="name">empty</span><span class="punctuation">())</span> <span class="keyword">return</span> <span class="name builtin">false</span><span class="punctuation">;</span>
<span class="keyword type">char</span> <span class="keyword">const</span><span class="operator">*</span> <span class="name">first</span> <span class="operator">=</span> <span class="name">f</span><span class="punctuation">.</span><span class="name">c_str</span><span class="punctuation">();</span>
<span class="keyword type">char</span> <span class="keyword">const</span><span class="operator">*</span> <span class="name">sep</span> <span class="operator">=</span> <span class="name">strrchr</span><span class="punctuation">(</span><span class="name">first</span><span class="punctuation">,</span> <span class="literal string char">'/'</span><span class="punctuation">);</span>
<span class="comment preproc">#if defined(TORRENT_WINDOWS) || defined(TORRENT_OS2)
</span> <span class="keyword type">char</span> <span class="keyword">const</span><span class="operator">*</span> <span class="name">altsep</span> <span class="operator">=</span> <span class="name">strrchr</span><span class="punctuation">(</span><span class="name">first</span><span class="punctuation">,</span> <span class="literal string char">'\\'</span><span class="punctuation">);</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">sep</span> <span class="operator">==</span> <span class="name builtin">NULL</span> <span class="operator">||</span> <span class="name">altsep</span> <span class="operator">&gt;</span> <span class="name">sep</span><span class="punctuation">)</span> <span class="name">sep</span> <span class="operator">=</span> <span class="name">altsep</span><span class="punctuation">;</span>
<span class="comment preproc">#endif
</span> <span class="comment single">// if there is no parent path, just set 'sep'
</span> <span class="comment single">// to point to the filename.
</span> <span class="comment single">// if there is a parent path, skip the '/' character
</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">sep</span> <span class="operator">==</span> <span class="name builtin">NULL</span><span class="punctuation">)</span> <span class="name">sep</span> <span class="operator">=</span> <span class="name">first</span><span class="punctuation">;</span>
<span class="keyword">else</span> <span class="operator">++</span><span class="name">sep</span><span class="punctuation">;</span>
<span class="comment single">// return false if the first character of the filename is a .
</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">sep</span><span class="punctuation">[</span><span class="literal number integer">0</span><span class="punctuation">]</span> <span class="operator">==</span> <span class="literal string char">'.'</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="name builtin">false</span><span class="punctuation">;</span>
<span class="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">&quot;%s</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span><span class="punctuation">,</span> <span class="name">f</span><span class="punctuation">.</span><span class="name">c_str</span><span class="punctuation">());</span> <span class="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">&quot;%s</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span><span class="punctuation">,</span> <span class="name">f</span><span class="punctuation">.</span><span class="name">c_str</span><span class="punctuation">());</span>
<span class="keyword">return</span> <span class="name builtin">true</span><span class="punctuation">;</span> <span class="keyword">return</span> <span class="name builtin">true</span><span class="punctuation">;</span>
<span class="punctuation">}</span> <span class="punctuation">}</span>
<span class="keyword type">void</span> <span class="name function">print_progress</span><span class="punctuation">(</span><span class="keyword type">int</span> <span class="name">i</span><span class="punctuation">,</span> <span class="keyword type">int</span> <span class="name">num</span><span class="punctuation">)</span> <span class="keyword type">void</span> <span class="name">print_progress</span><span class="punctuation">(</span><span class="keyword type">int</span> <span class="name">i</span><span class="punctuation">,</span> <span class="keyword type">int</span> <span class="name">num</span><span class="punctuation">)</span>
<span class="punctuation">{</span> <span class="punctuation">{</span>
<span class="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">&quot;</span><span class="literal string escape">\r</span><span class="literal string">%d/%d&quot;</span><span class="punctuation">,</span> <span class="name">i</span><span class="operator">+</span><span class="literal number integer">1</span><span class="punctuation">,</span> <span class="name">num</span><span class="punctuation">);</span> <span class="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">&quot;</span><span class="literal string escape">\r</span><span class="literal string">%d/%d&quot;</span><span class="punctuation">,</span> <span class="name">i</span><span class="operator">+</span><span class="literal number integer">1</span><span class="punctuation">,</span> <span class="name">num</span><span class="punctuation">);</span>
<span class="punctuation">}</span> <span class="punctuation">}</span>
<span class="keyword type">void</span> <span class="name function">print_usage</span><span class="punctuation">()</span> <span class="keyword type">void</span> <span class="name">print_usage</span><span class="punctuation">()</span>
<span class="punctuation">{</span> <span class="punctuation">{</span>
<span class="name">fputs</span><span class="punctuation">(</span><span class="literal string">&quot;usage: make_torrent FILE [OPTIONS]</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span> <span class="name">fputs</span><span class="punctuation">(</span><span class="literal string">&quot;usage: make_torrent FILE [OPTIONS]</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot;</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span> <span class="literal string">&quot;</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
@ -237,10 +282,19 @@ instructions for how to use it <a class="reference external" href="client_test.h
<span class="literal string">&quot; where the filename defaults to a.torrent</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span> <span class="literal string">&quot; where the filename defaults to a.torrent</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot;-r file add root certificate to the torrent, to verify</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span> <span class="literal string">&quot;-r file add root certificate to the torrent, to verify</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot; the HTTPS tracker</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span> <span class="literal string">&quot; the HTTPS tracker</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot;-S info-hash add a similar torrent by info-hash. The similar</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot; torrent is expected to share some files with this one</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot;-L collection add a collection name to this torrent. Other torrents</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot; in the same collection is expected to share files</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot; with this one.</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot;-M make the torrent compatible with mutable torrents</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot; this means aligning large files and pad them in order</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot; for piece hashes to uniquely indentify a file without</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="literal string">&quot; overlap</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="punctuation">,</span> <span class="name">stderr</span><span class="punctuation">);</span> <span class="punctuation">,</span> <span class="name">stderr</span><span class="punctuation">);</span>
<span class="punctuation">}</span> <span class="punctuation">}</span>
<span class="keyword type">int</span> <span class="name function">main</span><span class="punctuation">(</span><span class="keyword type">int</span> <span class="name">argc</span><span class="punctuation">,</span> <span class="keyword type">char</span><span class="operator">*</span> <span class="name">argv</span><span class="punctuation">[])</span> <span class="keyword type">int</span> <span class="name">main</span><span class="punctuation">(</span><span class="keyword type">int</span> <span class="name">argc</span><span class="punctuation">,</span> <span class="keyword type">char</span><span class="operator">*</span> <span class="name">argv</span><span class="punctuation">[])</span>
<span class="punctuation">{</span> <span class="punctuation">{</span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="name">libtorrent</span><span class="punctuation">;</span> <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="name">libtorrent</span><span class="punctuation">;</span>
@ -259,6 +313,8 @@ instructions for how to use it <a class="reference external" href="client_test.h
<span class="comment preproc">#endif <span class="comment preproc">#endif
</span> <span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">&gt;</span> <span class="name">web_seeds</span><span class="punctuation">;</span> </span> <span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">&gt;</span> <span class="name">web_seeds</span><span class="punctuation">;</span>
<span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">&gt;</span> <span class="name">trackers</span><span class="punctuation">;</span> <span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">&gt;</span> <span class="name">trackers</span><span class="punctuation">;</span>
<span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">&gt;</span> <span class="name">collections</span><span class="punctuation">;</span>
<span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="name">sha1_hash</span><span class="operator">&gt;</span> <span class="name">similar</span><span class="punctuation">;</span>
<span class="keyword type">int</span> <span class="name">pad_file_limit</span> <span class="operator">=</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span> <span class="keyword type">int</span> <span class="name">pad_file_limit</span> <span class="operator">=</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="keyword type">int</span> <span class="name">piece_size</span> <span class="operator">=</span> <span class="literal number integer">0</span><span class="punctuation">;</span> <span class="keyword type">int</span> <span class="name">piece_size</span> <span class="operator">=</span> <span class="literal number integer">0</span><span class="punctuation">;</span>
<span class="keyword type">int</span> <span class="name">flags</span> <span class="operator">=</span> <span class="literal number integer">0</span><span class="punctuation">;</span> <span class="keyword type">int</span> <span class="name">flags</span> <span class="operator">=</span> <span class="literal number integer">0</span><span class="punctuation">;</span>
@ -290,6 +346,10 @@ instructions for how to use it <a class="reference external" href="client_test.h
<span class="operator">++</span><span class="name">i</span><span class="punctuation">;</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">;</span>
<span class="name">trackers</span><span class="punctuation">.</span><span class="name">push_back</span><span class="punctuation">(</span><span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">]);</span> <span class="name">trackers</span><span class="punctuation">.</span><span class="name">push_back</span><span class="punctuation">(</span><span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">]);</span>
<span class="keyword">break</span><span class="punctuation">;</span> <span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">case</span> <span class="literal string char">'M'</span><span class="operator">:</span>
<span class="name">flags</span> <span class="operator">|=</span> <span class="name">create_torrent</span><span class="operator">::</span><span class="name">mutable_torrent_support</span><span class="punctuation">;</span>
<span class="name">pad_file_limit</span> <span class="operator">=</span> <span class="literal number hex">0x4000</span><span class="punctuation">;</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">case</span> <span class="literal string char">'p'</span><span class="operator">:</span> <span class="keyword">case</span> <span class="literal string char">'p'</span><span class="operator">:</span>
<span class="operator">++</span><span class="name">i</span><span class="punctuation">;</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">;</span>
<span class="name">pad_file_limit</span> <span class="operator">=</span> <span class="name">atoi</span><span class="punctuation">(</span><span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">]);</span> <span class="name">pad_file_limit</span> <span class="operator">=</span> <span class="name">atoi</span><span class="punctuation">(</span><span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">]);</span>
@ -323,6 +383,30 @@ instructions for how to use it <a class="reference external" href="client_test.h
<span class="operator">++</span><span class="name">i</span><span class="punctuation">;</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">;</span>
<span class="name">root_cert</span> <span class="operator">=</span> <span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">];</span> <span class="name">root_cert</span> <span class="operator">=</span> <span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">];</span>
<span class="keyword">break</span><span class="punctuation">;</span> <span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">case</span> <span class="literal string char">'S'</span><span class="operator">:</span>
<span class="punctuation">{</span>
<span class="operator">++</span><span class="name">i</span><span class="punctuation">;</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">strlen</span><span class="punctuation">(</span><span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">])</span> <span class="operator">!=</span> <span class="literal number integer">40</span><span class="punctuation">)</span>
<span class="punctuation">{</span>
<span class="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">&quot;invalid info-hash for -S. &quot;</span>
<span class="literal string">&quot;Expected 40 hex characters</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span><span class="punctuation">);</span>
<span class="name">print_usage</span><span class="punctuation">();</span>
<span class="keyword">return</span> <span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="name">sha1_hash</span> <span class="name">ih</span><span class="punctuation">;</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="operator">!</span><span class="name">from_hex</span><span class="punctuation">(</span><span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">],</span> <span class="literal number integer">40</span><span class="punctuation">,</span> <span class="punctuation">(</span><span class="keyword type">char</span><span class="operator">*</span><span class="punctuation">)</span><span class="operator">&amp;</span><span class="name">ih</span><span class="punctuation">[</span><span class="literal number integer">0</span><span class="punctuation">]))</span>
<span class="punctuation">{</span>
<span class="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">&quot;invalid info-hash for -S</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span><span class="punctuation">);</span>
<span class="name">print_usage</span><span class="punctuation">();</span>
<span class="keyword">return</span> <span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="name">similar</span><span class="punctuation">.</span><span class="name">push_back</span><span class="punctuation">(</span><span class="name">ih</span><span class="punctuation">);</span>
<span class="punctuation">}</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">case</span> <span class="literal string char">'L'</span><span class="operator">:</span>
<span class="operator">++</span><span class="name">i</span><span class="punctuation">;</span>
<span class="name">collections</span><span class="punctuation">.</span><span class="name">push_back</span><span class="punctuation">(</span><span class="name">argv</span><span class="punctuation">[</span><span class="name">i</span><span class="punctuation">]);</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">default</span><span class="operator">:</span> <span class="keyword">default</span><span class="operator">:</span>
<span class="name">print_usage</span><span class="punctuation">();</span> <span class="name">print_usage</span><span class="punctuation">();</span>
<span class="keyword">return</span> <span class="literal number integer">1</span><span class="punctuation">;</span> <span class="keyword">return</span> <span class="literal number integer">1</span><span class="punctuation">;</span>
@ -330,7 +414,22 @@ instructions for how to use it <a class="reference external" href="client_test.h
<span class="punctuation">}</span> <span class="punctuation">}</span>
<span class="name">file_storage</span> <span class="name">fs</span><span class="punctuation">;</span> <span class="name">file_storage</span> <span class="name">fs</span><span class="punctuation">;</span>
<span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="name">full_path</span> <span class="operator">=</span> <span class="name">libtorrent</span><span class="operator">::</span><span class="name">complete</span><span class="punctuation">(</span><span class="name">argv</span><span class="punctuation">[</span><span class="literal number integer">1</span><span class="punctuation">]);</span> <span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="name">full_path</span> <span class="operator">=</span> <span class="name">argv</span><span class="punctuation">[</span><span class="literal number integer">1</span><span class="punctuation">];</span>
<span class="comment preproc">#ifdef TORRENT_WINDOWS
</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">full_path</span><span class="punctuation">[</span><span class="literal number integer">1</span><span class="punctuation">]</span> <span class="operator">!=</span> <span class="literal string char">':'</span><span class="punctuation">)</span>
<span class="comment preproc">#else
</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">full_path</span><span class="punctuation">[</span><span class="literal number integer">0</span><span class="punctuation">]</span> <span class="operator">!=</span> <span class="literal string char">'/'</span><span class="punctuation">)</span>
<span class="comment preproc">#endif
</span> <span class="punctuation">{</span>
<span class="keyword type">char</span> <span class="name">cwd</span><span class="punctuation">[</span><span class="name">TORRENT_MAX_PATH</span><span class="punctuation">];</span>
<span class="comment preproc">#ifdef TORRENT_WINDOWS
</span> <span class="name">_getcwd</span><span class="punctuation">(</span><span class="name">cwd</span><span class="punctuation">,</span> <span class="keyword">sizeof</span><span class="punctuation">(</span><span class="name">cwd</span><span class="punctuation">));</span>
<span class="name">full_path</span> <span class="operator">=</span> <span class="name">cwd</span> <span class="operator">+</span> <span class="punctuation">(</span><span class="literal string">&quot;</span><span class="literal string escape">\\</span><span class="literal string">&quot;</span> <span class="operator">+</span> <span class="name">full_path</span><span class="punctuation">);</span>
<span class="comment preproc">#else
</span> <span class="name">getcwd</span><span class="punctuation">(</span><span class="name">cwd</span><span class="punctuation">,</span> <span class="keyword">sizeof</span><span class="punctuation">(</span><span class="name">cwd</span><span class="punctuation">));</span>
<span class="name">full_path</span> <span class="operator">=</span> <span class="name">cwd</span> <span class="operator">+</span> <span class="punctuation">(</span><span class="literal string">&quot;/&quot;</span> <span class="operator">+</span> <span class="name">full_path</span><span class="punctuation">);</span>
<span class="comment preproc">#endif
</span> <span class="punctuation">}</span>
<span class="name">add_files</span><span class="punctuation">(</span><span class="name">fs</span><span class="punctuation">,</span> <span class="name">full_path</span><span class="punctuation">,</span> <span class="name">file_filter</span><span class="punctuation">,</span> <span class="name">flags</span><span class="punctuation">);</span> <span class="name">add_files</span><span class="punctuation">(</span><span class="name">fs</span><span class="punctuation">,</span> <span class="name">full_path</span><span class="punctuation">,</span> <span class="name">file_filter</span><span class="punctuation">,</span> <span class="name">flags</span><span class="punctuation">);</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">fs</span><span class="punctuation">.</span><span class="name">num_files</span><span class="punctuation">()</span> <span class="operator">==</span> <span class="literal number integer">0</span><span class="punctuation">)</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">fs</span><span class="punctuation">.</span><span class="name">num_files</span><span class="punctuation">()</span> <span class="operator">==</span> <span class="literal number integer">0</span><span class="punctuation">)</span>
@ -349,8 +448,16 @@ instructions for how to use it <a class="reference external" href="client_test.h
<span class="punctuation">,</span> <span class="name">end</span><span class="punctuation">(</span><span class="name">web_seeds</span><span class="punctuation">.</span><span class="name">end</span><span class="punctuation">());</span> <span class="name">i</span> <span class="operator">!=</span> <span class="name">end</span><span class="punctuation">;</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">)</span> <span class="punctuation">,</span> <span class="name">end</span><span class="punctuation">(</span><span class="name">web_seeds</span><span class="punctuation">.</span><span class="name">end</span><span class="punctuation">());</span> <span class="name">i</span> <span class="operator">!=</span> <span class="name">end</span><span class="punctuation">;</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">)</span>
<span class="name">t</span><span class="punctuation">.</span><span class="name">add_url_seed</span><span class="punctuation">(</span><span class="operator">*</span><span class="name">i</span><span class="punctuation">);</span> <span class="name">t</span><span class="punctuation">.</span><span class="name">add_url_seed</span><span class="punctuation">(</span><span class="operator">*</span><span class="name">i</span><span class="punctuation">);</span>
<span class="keyword">for</span> <span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">&gt;::</span><span class="name">iterator</span> <span class="name">i</span> <span class="operator">=</span> <span class="name">collections</span><span class="punctuation">.</span><span class="name">begin</span><span class="punctuation">()</span>
<span class="punctuation">,</span> <span class="name">end</span><span class="punctuation">(</span><span class="name">collections</span><span class="punctuation">.</span><span class="name">end</span><span class="punctuation">());</span> <span class="name">i</span> <span class="operator">!=</span> <span class="name">end</span><span class="punctuation">;</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">)</span>
<span class="name">t</span><span class="punctuation">.</span><span class="name">add_collection</span><span class="punctuation">(</span><span class="operator">*</span><span class="name">i</span><span class="punctuation">);</span>
<span class="keyword">for</span> <span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="name">sha1_hash</span><span class="operator">&gt;::</span><span class="name">iterator</span> <span class="name">i</span> <span class="operator">=</span> <span class="name">similar</span><span class="punctuation">.</span><span class="name">begin</span><span class="punctuation">()</span>
<span class="punctuation">,</span> <span class="name">end</span><span class="punctuation">(</span><span class="name">similar</span><span class="punctuation">.</span><span class="name">end</span><span class="punctuation">());</span> <span class="name">i</span> <span class="operator">!=</span> <span class="name">end</span><span class="punctuation">;</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">)</span>
<span class="name">t</span><span class="punctuation">.</span><span class="name">add_similar_torrent</span><span class="punctuation">(</span><span class="operator">*</span><span class="name">i</span><span class="punctuation">);</span>
<span class="name">error_code</span> <span class="name">ec</span><span class="punctuation">;</span> <span class="name">error_code</span> <span class="name">ec</span><span class="punctuation">;</span>
<span class="name">set_piece_hashes</span><span class="punctuation">(</span><span class="name">t</span><span class="punctuation">,</span> <span class="name">parent_path</span><span class="punctuation">(</span><span class="name">full_path</span><span class="punctuation">)</span> <span class="name">set_piece_hashes</span><span class="punctuation">(</span><span class="name">t</span><span class="punctuation">,</span> <span class="name">branch_path</span><span class="punctuation">(</span><span class="name">full_path</span><span class="punctuation">)</span>
<span class="punctuation">,</span> <span class="name">boost</span><span class="operator">::</span><span class="name">bind</span><span class="punctuation">(</span><span class="operator">&amp;</span><span class="name">print_progress</span><span class="punctuation">,</span> <span class="name">_1</span><span class="punctuation">,</span> <span class="name">t</span><span class="punctuation">.</span><span class="name">num_pieces</span><span class="punctuation">()),</span> <span class="name">ec</span><span class="punctuation">);</span> <span class="punctuation">,</span> <span class="name">boost</span><span class="operator">::</span><span class="name">bind</span><span class="punctuation">(</span><span class="operator">&amp;</span><span class="name">print_progress</span><span class="punctuation">,</span> <span class="name">_1</span><span class="punctuation">,</span> <span class="name">t</span><span class="punctuation">.</span><span class="name">num_pieces</span><span class="punctuation">()),</span> <span class="name">ec</span><span class="punctuation">);</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">ec</span><span class="punctuation">)</span> <span class="keyword">if</span> <span class="punctuation">(</span><span class="name">ec</span><span class="punctuation">)</span>
<span class="punctuation">{</span> <span class="punctuation">{</span>
@ -432,10 +539,11 @@ print information about it to std out:</p>
<span class="comment preproc">#include &quot;libtorrent/entry.hpp&quot; <span class="comment preproc">#include &quot;libtorrent/entry.hpp&quot;
#include &quot;libtorrent/bencode.hpp&quot; #include &quot;libtorrent/bencode.hpp&quot;
#include &quot;libtorrent/torrent_info.hpp&quot; #include &quot;libtorrent/torrent_info.hpp&quot;
#include &quot;libtorrent/lazy_entry.hpp&quot; #include &quot;libtorrent/bdecode.hpp&quot;
#include &quot;libtorrent/magnet_uri.hpp&quot; #include &quot;libtorrent/magnet_uri.hpp&quot;
</span> </span>
<span class="keyword type">int</span> <span class="name function">load_file</span><span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="keyword">const</span><span class="operator">&amp;</span> <span class="name">filename</span><span class="punctuation">,</span> <span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="keyword type">char</span><span class="operator">&gt;&amp;</span> <span class="name">v</span><span class="punctuation">,</span> <span class="name">libtorrent</span><span class="operator">::</span><span class="name">error_code</span><span class="operator">&amp;</span> <span class="name">ec</span><span class="punctuation">,</span> <span class="keyword type">int</span> <span class="name">limit</span> <span class="operator">=</span> <span class="literal number integer">8000000</span><span class="punctuation">)</span> <span class="keyword type">int</span> <span class="name function">load_file</span><span class="punctuation">(</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span> <span class="keyword">const</span><span class="operator">&amp;</span> <span class="name">filename</span><span class="punctuation">,</span> <span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator">&lt;</span><span class="keyword type">char</span><span class="operator">&gt;&amp;</span> <span class="name">v</span>
<span class="punctuation">,</span> <span class="name">libtorrent</span><span class="operator">::</span><span class="name">error_code</span><span class="operator">&amp;</span> <span class="name">ec</span><span class="punctuation">,</span> <span class="keyword type">int</span> <span class="name">limit</span> <span class="operator">=</span> <span class="literal number integer">8000000</span><span class="punctuation">)</span>
<span class="punctuation">{</span> <span class="punctuation">{</span>
<span class="name">ec</span><span class="punctuation">.</span><span class="name">clear</span><span class="punctuation">();</span> <span class="name">ec</span><span class="punctuation">.</span><span class="name">clear</span><span class="punctuation">();</span>
<span class="keyword type">FILE</span><span class="operator">*</span> <span class="name">f</span> <span class="operator">=</span> <span class="name">fopen</span><span class="punctuation">(</span><span class="name">filename</span><span class="punctuation">.</span><span class="name">c_str</span><span class="punctuation">(),</span> <span class="literal string">&quot;rb&quot;</span><span class="punctuation">);</span> <span class="keyword type">FILE</span><span class="operator">*</span> <span class="name">f</span> <span class="operator">=</span> <span class="name">fopen</span><span class="punctuation">(</span><span class="name">filename</span><span class="punctuation">.</span><span class="name">c_str</span><span class="punctuation">(),</span> <span class="literal string">&quot;rb&quot;</span><span class="punctuation">);</span>
@ -496,58 +604,6 @@ print information about it to std out:</p>
<span class="keyword">return</span> <span class="literal number integer">0</span><span class="punctuation">;</span> <span class="keyword">return</span> <span class="literal number integer">0</span><span class="punctuation">;</span>
<span class="punctuation">}</span> <span class="punctuation">}</span>
<span class="keyword type">int</span> <span class="name function">line_longer_than</span><span class="punctuation">(</span><span class="name">libtorrent</span><span class="operator">::</span><span class="name">lazy_entry</span> <span class="keyword">const</span><span class="operator">&amp;</span> <span class="name">e</span><span class="punctuation">,</span> <span class="keyword type">int</span> <span class="name">limit</span><span class="punctuation">)</span>
<span class="punctuation">{</span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="name">libtorrent</span><span class="punctuation">;</span>
<span class="keyword type">int</span> <span class="name">line_len</span> <span class="operator">=</span> <span class="literal number integer">0</span><span class="punctuation">;</span>
<span class="keyword">switch</span> <span class="punctuation">(</span><span class="name">e</span><span class="punctuation">.</span><span class="name">type</span><span class="punctuation">())</span>
<span class="punctuation">{</span>
<span class="keyword">case</span> <span class="name">lazy_entry</span><span class="operator">::</span><span class="keyword type">list_t</span><span class="operator">:</span>
<span class="name">line_len</span> <span class="operator">+=</span> <span class="literal number integer">4</span><span class="punctuation">;</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">line_len</span> <span class="operator">&gt;</span> <span class="name">limit</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="keyword">for</span> <span class="punctuation">(</span><span class="keyword type">int</span> <span class="name">i</span> <span class="operator">=</span> <span class="literal number integer">0</span><span class="punctuation">;</span> <span class="name">i</span> <span class="operator">&lt;</span> <span class="name">e</span><span class="punctuation">.</span><span class="name">list_size</span><span class="punctuation">();</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">)</span>
<span class="punctuation">{</span>
<span class="keyword type">int</span> <span class="name">ret</span> <span class="operator">=</span> <span class="name">line_longer_than</span><span class="punctuation">(</span><span class="operator">*</span><span class="name">e</span><span class="punctuation">.</span><span class="name">list_at</span><span class="punctuation">(</span><span class="name">i</span><span class="punctuation">),</span> <span class="name">limit</span> <span class="operator">-</span> <span class="name">line_len</span><span class="punctuation">);</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">ret</span> <span class="operator">==</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="name">line_len</span> <span class="operator">+=</span> <span class="name">ret</span> <span class="operator">+</span> <span class="literal number integer">2</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">case</span> <span class="name">lazy_entry</span><span class="operator">::</span><span class="keyword type">dict_t</span><span class="operator">:</span>
<span class="name">line_len</span> <span class="operator">+=</span> <span class="literal number integer">4</span><span class="punctuation">;</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">line_len</span> <span class="operator">&gt;</span> <span class="name">limit</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="keyword">for</span> <span class="punctuation">(</span><span class="keyword type">int</span> <span class="name">i</span> <span class="operator">=</span> <span class="literal number integer">0</span><span class="punctuation">;</span> <span class="name">i</span> <span class="operator">&lt;</span> <span class="name">e</span><span class="punctuation">.</span><span class="name">dict_size</span><span class="punctuation">();</span> <span class="operator">++</span><span class="name">i</span><span class="punctuation">)</span>
<span class="punctuation">{</span>
<span class="name">line_len</span> <span class="operator">+=</span> <span class="literal number integer">4</span> <span class="operator">+</span> <span class="name">e</span><span class="punctuation">.</span><span class="name">dict_at</span><span class="punctuation">(</span><span class="name">i</span><span class="punctuation">).</span><span class="name">first</span><span class="punctuation">.</span><span class="name">size</span><span class="punctuation">();</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">line_len</span> <span class="operator">&gt;</span> <span class="name">limit</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="keyword type">int</span> <span class="name">ret</span> <span class="operator">=</span> <span class="name">line_longer_than</span><span class="punctuation">(</span><span class="operator">*</span><span class="name">e</span><span class="punctuation">.</span><span class="name">dict_at</span><span class="punctuation">(</span><span class="name">i</span><span class="punctuation">).</span><span class="name">second</span><span class="punctuation">,</span> <span class="name">limit</span> <span class="operator">-</span> <span class="name">line_len</span><span class="punctuation">);</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">ret</span> <span class="operator">==</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="name">line_len</span> <span class="operator">+=</span> <span class="name">ret</span> <span class="operator">+</span> <span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">case</span> <span class="name">lazy_entry</span><span class="operator">::</span><span class="keyword type">string_t</span><span class="operator">:</span>
<span class="name">line_len</span> <span class="operator">+=</span> <span class="literal number integer">3</span> <span class="operator">+</span> <span class="name">e</span><span class="punctuation">.</span><span class="name">string_length</span><span class="punctuation">();</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">case</span> <span class="name">lazy_entry</span><span class="operator">::</span><span class="keyword type">int_t</span><span class="operator">:</span>
<span class="punctuation">{</span>
<span class="name">boost</span><span class="operator">::</span><span class="keyword type">int64_t</span> <span class="name">val</span> <span class="operator">=</span> <span class="name">e</span><span class="punctuation">.</span><span class="name">int_value</span><span class="punctuation">();</span>
<span class="keyword">while</span> <span class="punctuation">(</span><span class="name">val</span> <span class="operator">&gt;</span> <span class="literal number integer">0</span><span class="punctuation">)</span>
<span class="punctuation">{</span>
<span class="operator">++</span><span class="name">line_len</span><span class="punctuation">;</span>
<span class="name">val</span> <span class="operator">/=</span> <span class="literal number integer">10</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="name">line_len</span> <span class="operator">+=</span> <span class="literal number integer">2</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="keyword">case</span> <span class="name">lazy_entry</span><span class="operator">::</span><span class="keyword type">none_t</span><span class="operator">:</span>
<span class="name">line_len</span> <span class="operator">+=</span> <span class="literal number integer">4</span><span class="punctuation">;</span>
<span class="keyword">break</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="keyword">if</span> <span class="punctuation">(</span><span class="name">line_len</span> <span class="operator">&gt;</span> <span class="name">limit</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="keyword">return</span> <span class="name">line_len</span><span class="punctuation">;</span>
<span class="punctuation">}</span>
<span class="keyword type">int</span> <span class="name function">main</span><span class="punctuation">(</span><span class="keyword type">int</span> <span class="name">argc</span><span class="punctuation">,</span> <span class="keyword type">char</span><span class="operator">*</span> <span class="name">argv</span><span class="punctuation">[])</span> <span class="keyword type">int</span> <span class="name function">main</span><span class="punctuation">(</span><span class="keyword type">int</span> <span class="name">argc</span><span class="punctuation">,</span> <span class="keyword type">char</span><span class="operator">*</span> <span class="name">argv</span><span class="punctuation">[])</span>
<span class="punctuation">{</span> <span class="punctuation">{</span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="name">libtorrent</span><span class="punctuation">;</span> <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="name">libtorrent</span><span class="punctuation">;</span>
@ -578,11 +634,11 @@ print information about it to std out:</p>
<span class="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">&quot;failed to load file: %s</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span><span class="punctuation">,</span> <span class="name">ec</span><span class="punctuation">.</span><span class="name">message</span><span class="punctuation">().</span><span class="name">c_str</span><span class="punctuation">());</span> <span class="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">&quot;failed to load file: %s</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span><span class="punctuation">,</span> <span class="name">ec</span><span class="punctuation">.</span><span class="name">message</span><span class="punctuation">().</span><span class="name">c_str</span><span class="punctuation">());</span>
<span class="keyword">return</span> <span class="literal number integer">1</span><span class="punctuation">;</span> <span class="keyword">return</span> <span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="punctuation">}</span> <span class="punctuation">}</span>
<span class="name">lazy_entry</span> <span class="name">e</span><span class="punctuation">;</span> <span class="name">bdecode_node</span> <span class="name">e</span><span class="punctuation">;</span>
<span class="keyword type">int</span> <span class="name">pos</span> <span class="operator">=</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span> <span class="keyword type">int</span> <span class="name">pos</span> <span class="operator">=</span> <span class="operator">-</span><span class="literal number integer">1</span><span class="punctuation">;</span>
<span class="name">printf</span><span class="punctuation">(</span><span class="literal string">&quot;decoding. recursion limit: %d total item count limit: %d</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span> <span class="name">printf</span><span class="punctuation">(</span><span class="literal string">&quot;decoding. recursion limit: %d total item count limit: %d</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span>
<span class="punctuation">,</span> <span class="name">depth_limit</span><span class="punctuation">,</span> <span class="name">item_limit</span><span class="punctuation">);</span> <span class="punctuation">,</span> <span class="name">depth_limit</span><span class="punctuation">,</span> <span class="name">item_limit</span><span class="punctuation">);</span>
<span class="name">ret</span> <span class="operator">=</span> <span class="name">lazy_bdecode</span><span class="punctuation">(</span><span class="operator">&amp;</span><span class="name">buf</span><span class="punctuation">[</span><span class="literal number integer">0</span><span class="punctuation">],</span> <span class="operator">&amp;</span><span class="name">buf</span><span class="punctuation">[</span><span class="literal number integer">0</span><span class="punctuation">]</span> <span class="operator">+</span> <span class="name">buf</span><span class="punctuation">.</span><span class="name">size</span><span class="punctuation">(),</span> <span class="name">e</span><span class="punctuation">,</span> <span class="name">ec</span><span class="punctuation">,</span> <span class="operator">&amp;</span><span class="name">pos</span> <span class="name">ret</span> <span class="operator">=</span> <span class="name">bdecode</span><span class="punctuation">(</span><span class="operator">&amp;</span><span class="name">buf</span><span class="punctuation">[</span><span class="literal number integer">0</span><span class="punctuation">],</span> <span class="operator">&amp;</span><span class="name">buf</span><span class="punctuation">[</span><span class="literal number integer">0</span><span class="punctuation">]</span> <span class="operator">+</span> <span class="name">buf</span><span class="punctuation">.</span><span class="name">size</span><span class="punctuation">(),</span> <span class="name">e</span><span class="punctuation">,</span> <span class="name">ec</span><span class="punctuation">,</span> <span class="operator">&amp;</span><span class="name">pos</span>
<span class="punctuation">,</span> <span class="name">depth_limit</span><span class="punctuation">,</span> <span class="name">item_limit</span><span class="punctuation">);</span> <span class="punctuation">,</span> <span class="name">depth_limit</span><span class="punctuation">,</span> <span class="name">item_limit</span><span class="punctuation">);</span>
<span class="name">printf</span><span class="punctuation">(</span><span class="literal string">&quot;</span><span class="literal string escape">\n\n</span><span class="literal string">----- raw info -----</span><span class="literal string escape">\n\n</span><span class="literal string">%s</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span><span class="punctuation">,</span> <span class="name">print_entry</span><span class="punctuation">(</span><span class="name">e</span><span class="punctuation">).</span><span class="name">c_str</span><span class="punctuation">());</span> <span class="name">printf</span><span class="punctuation">(</span><span class="literal string">&quot;</span><span class="literal string escape">\n\n</span><span class="literal string">----- raw info -----</span><span class="literal string escape">\n\n</span><span class="literal string">%s</span><span class="literal string escape">\n</span><span class="literal string">&quot;</span><span class="punctuation">,</span> <span class="name">print_entry</span><span class="punctuation">(</span><span class="name">e</span><span class="punctuation">).</span><span class="name">c_str</span><span class="punctuation">());</span>
@ -698,7 +754,7 @@ print information about it to std out:</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title></title> <title></title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org Ludvig Strigeus, ludde&#64;utorrent.com" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org Ludvig Strigeus, ludde&#64;utorrent.com" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -490,7 +491,7 @@ message wrapping.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title> <title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -407,7 +408,7 @@ epoll on linux and kqueue on MacOS X and BSD.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title></title> <title></title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -59,9 +60,8 @@
<li><a class="reference external" href="http://lists.sourceforge.net/lists/listinfo/libtorrent-discuss">mailing list</a> (<a class="reference external" href="http://dir.gmane.org/gmane.network.bit-torrent.libtorrent">archive</a>)</li> <li><a class="reference external" href="http://lists.sourceforge.net/lists/listinfo/libtorrent-discuss">mailing list</a> (<a class="reference external" href="http://dir.gmane.org/gmane.network.bit-torrent.libtorrent">archive</a>)</li>
<li><a class="reference external" href="projects.html">who's using libtorrent?</a></li> <li><a class="reference external" href="projects.html">who's using libtorrent?</a></li>
<li><a class="reference external" href="http://code.google.com/p/libtorrent/issues/entry">report bugs</a></li> <li><a class="reference external" href="http://code.google.com/p/libtorrent/issues/entry">report bugs</a></li>
<li><a class="reference external" href="http://www.sourceforge.net/projects/libtorrent">sourceforge page</a></li> <li><a class="reference external" href="http://sourceforge.net/projects/libtorrent">sourceforge page</a></li>
<li><a class="reference external" href="http://blog.libtorrent.org">blog</a></li> <li><a class="reference external" href="http://blog.libtorrent.org">blog</a></li>
<li><a class="reference external" href="http://code.google.com/p/libtorrent/wiki/index">wiki</a></li>
</ul> </ul>
<hr class="docutils" /> <hr class="docutils" />
<p>Extensions</p> <p>Extensions</p>
@ -105,7 +105,7 @@ the library.</p>
<h2>Donate</h2> <h2>Donate</h2>
<p>Support the development of libtorrent</p> <p>Support the development of libtorrent</p>
<a class="FlattrButton" style="display:none;" href="http://libtorrent.org"></a> <a class="FlattrButton" style="display:none;" href="http://libtorrent.org"></a>
<noscript><a href="http://flattr.com/thing/95662/libtorrent" target="_blank"> <noscript><a href="https://flattr.com/thing/95662/libtorrent" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a></noscript></div> <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a></noscript></div>
<div class="section" id="feedback"> <div class="section" id="feedback">
<h2>Feedback</h2> <h2>Feedback</h2>
@ -114,7 +114,7 @@ the library.</p>
</div> </div>
<div class="section" id="license"> <div class="section" id="license">
<h2>license</h2> <h2>license</h2>
<p>libtorrent is released under the <a class="reference external" href="http://www.opensource.org/licenses/bsd-license.php">BSD-license</a>.</p> <p>libtorrent is released under the <a class="reference external" href="http://opensource.org/licenses/bsd-license.php">BSD-license</a>.</p>
<p>This means that you can use the library in your project without having to <p>This means that you can use the library in your project without having to
release its source code. The only requirement is that you give credit release its source code. The only requirement is that you give credit
to the author of the library by including the libtorrent license in your to the author of the library by including the libtorrent license in your
@ -166,7 +166,7 @@ list or posted to the <a class="reference external" href="https://code.google.co
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>projects using libtorrent</title> <title>projects using libtorrent</title>
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -18,6 +18,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -214,7 +215,7 @@ files without needing to leave your computer on.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>libtorrent python binding</title> <title>libtorrent python binding</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -150,7 +151,7 @@ ses.listen_on(6881, 6891)
e = lt.bdecode(open(&quot;test.torrent&quot;, 'rb').read()) e = lt.bdecode(open(&quot;test.torrent&quot;, 'rb').read())
info = lt.torrent_info(e) info = lt.torrent_info(e)
params = { save_path: './', \ params = { save_path: '.', \
storage_mode: lt.storage_mode_t.storage_mode_sparse, \ storage_mode: lt.storage_mode_t.storage_mode_sparse, \
ti: info } ti: info }
h = ses.add_torrent(params) h = ses.add_torrent(params)
@ -200,7 +201,7 @@ while (not h.is_seed()):
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -1,8 +1,3 @@
.document {
margin-left: 10px;
margin-right: 10px;
}
.document a { .document a {
border: none; border: none;
color: black; color: black;
@ -37,6 +32,9 @@ div.main-toc {
column-count: 4; column-count: 4;
-webkit-column-count: 4; -webkit-column-count: 4;
-moz-column-count: 4; -moz-column-count: 4;
column-width: 13em;
-webkit-column-width: 13em;
-moz-column-width: 13em;
border: 1px solid #999; border: 1px solid #999;
padding: 5px; padding: 5px;
margin-bottom: 10px; margin-bottom: 10px;

View File

@ -344,53 +344,53 @@ disconnect peers.
<a name="peer.num_peers_up_disk"></a> <a name="peer.num_peers_up_disk"></a>
<a name="peer.num_peers_down_disk"></a> <a name="peer.num_peers_down_disk"></a>
+---------------------------------------+-------+ +---------------------------------------+---------+
| name | type | | name | type |
+=======================================+=======+ +=======================================+=========+
| peer.num_tcp_peers | gauge | | peer.num_tcp_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_socks5_peers | gauge | | peer.num_socks5_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_http_proxy_peers | gauge | | peer.num_http_proxy_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_utp_peers | gauge | | peer.num_utp_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_i2p_peers | gauge | | peer.num_i2p_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_ssl_peers | gauge | | peer.num_ssl_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_ssl_socks5_peers | gauge | | peer.num_ssl_socks5_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_ssl_http_proxy_peers | gauge | | peer.num_ssl_http_proxy_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_ssl_utp_peers | gauge | | peer.num_ssl_utp_peers | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_half_open | gauge | | peer.num_peers_half_open | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_connected | gauge | | peer.num_peers_connected | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_up_interested | gauge | | peer.num_peers_up_interested | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_down_interested | gauge | | peer.num_peers_down_interested | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_up_unchoked_all | gauge | | peer.num_peers_up_unchoked_all | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_up_unchoked_optimistic | gauge | | peer.num_peers_up_unchoked_optimistic | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_up_unchoked | gauge | | peer.num_peers_up_unchoked | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_down_unchoked | gauge | | peer.num_peers_down_unchoked | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_up_requests | gauge | | peer.num_peers_up_requests | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_down_requests | gauge | | peer.num_peers_down_requests | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_end_game | gauge | | peer.num_peers_end_game | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_up_disk | gauge | | peer.num_peers_up_disk | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
| peer.num_peers_down_disk | gauge | | peer.num_peers_down_disk | counter |
+---------------------------------------+-------+ +---------------------------------------+---------+
the number of peer connections for each kind of socket. the number of peer connections for each kind of socket.
@ -517,13 +517,13 @@ total number of bytes sent and received by the session
<a name="net.limiter_up_queue"></a> <a name="net.limiter_up_queue"></a>
<a name="net.limiter_down_queue"></a> <a name="net.limiter_down_queue"></a>
+------------------------+-------+ +------------------------+---------+
| name | type | | name | type |
+========================+=======+ +========================+=========+
| net.limiter_up_queue | gauge | | net.limiter_up_queue | counter |
+------------------------+-------+ +------------------------+---------+
| net.limiter_down_queue | gauge | | net.limiter_down_queue | counter |
+------------------------+-------+ +------------------------+---------+
the number of sockets currently waiting for upload and download the number of sockets currently waiting for upload and download
@ -538,13 +538,13 @@ bandwidht from the rate limiter.
<a name="net.limiter_up_bytes"></a> <a name="net.limiter_up_bytes"></a>
<a name="net.limiter_down_bytes"></a> <a name="net.limiter_down_bytes"></a>
+------------------------+-------+ +------------------------+---------+
| name | type | | name | type |
+========================+=======+ +========================+=========+
| net.limiter_up_bytes | gauge | | net.limiter_up_bytes | counter |
+------------------------+-------+ +------------------------+---------+
| net.limiter_down_bytes | gauge | | net.limiter_down_bytes | counter |
+------------------------+-------+ +------------------------+---------+
the number of upload and download bytes waiting to be handed out from the number of upload and download bytes waiting to be handed out from
@ -588,11 +588,11 @@ were downloaded multiple times (from different peers)
<a name="net.has_incoming_connections"></a> <a name="net.has_incoming_connections"></a>
+------------------------------+-------+ +------------------------------+---------+
| name | type | | name | type |
+==============================+=======+ +==============================+=========+
| net.has_incoming_connections | gauge | | net.has_incoming_connections | counter |
+------------------------------+-------+ +------------------------------+---------+
is false by default and set to true when is false by default and set to true when
@ -627,25 +627,25 @@ NAT or not.
<a name="ses.num_queued_download_torrents"></a> <a name="ses.num_queued_download_torrents"></a>
<a name="ses.num_error_torrents"></a> <a name="ses.num_error_torrents"></a>
+----------------------------------+-------+ +----------------------------------+---------+
| name | type | | name | type |
+==================================+=======+ +==================================+=========+
| ses.num_checking_torrents | gauge | | ses.num_checking_torrents | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| ses.num_stopped_torrents | gauge | | ses.num_stopped_torrents | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| ses.num_upload_only_torrents | gauge | | ses.num_upload_only_torrents | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| ses.num_downloading_torrents | gauge | | ses.num_downloading_torrents | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| ses.num_seeding_torrents | gauge | | ses.num_seeding_torrents | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| ses.num_queued_seeding_torrents | gauge | | ses.num_queued_seeding_torrents | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| ses.num_queued_download_torrents | gauge | | ses.num_queued_download_torrents | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| ses.num_error_torrents | gauge | | ses.num_error_torrents | counter |
+----------------------------------+-------+ +----------------------------------+---------+
these gauges count the number of torrents in these gauges count the number of torrents in
@ -665,13 +665,13 @@ state.
<a name="ses.num_loaded_torrents"></a> <a name="ses.num_loaded_torrents"></a>
<a name="ses.num_pinned_torrents"></a> <a name="ses.num_pinned_torrents"></a>
+-------------------------+-------+ +-------------------------+---------+
| name | type | | name | type |
+=========================+=======+ +=========================+=========+
| ses.num_loaded_torrents | gauge | | ses.num_loaded_torrents | counter |
+-------------------------+-------+ +-------------------------+---------+
| ses.num_pinned_torrents | gauge | | ses.num_pinned_torrents | counter |
+-------------------------+-------+ +-------------------------+---------+
the number of torrents that are currently loaded the number of torrents that are currently loaded
@ -733,11 +733,11 @@ is enabled).
<a name="ses.num_unchoke_slots"></a> <a name="ses.num_unchoke_slots"></a>
+-----------------------+-------+ +-----------------------+---------+
| name | type | | name | type |
+=======================+=======+ +=======================+=========+
| ses.num_unchoke_slots | gauge | | ses.num_unchoke_slots | counter |
+-----------------------+-------+ +-----------------------+---------+
the number of allowed unchoked peers the number of allowed unchoked peers
@ -1087,9 +1087,9 @@ the number of pieces considered while picking pieces
+---------------------------------------+---------+ +---------------------------------------+---------+
| picker.hash_fail_piece_picks | counter | | picker.hash_fail_piece_picks | counter |
+---------------------------------------+---------+ +---------------------------------------+---------+
| disk.write_cache_blocks | gauge | | disk.write_cache_blocks | counter |
+---------------------------------------+---------+ +---------------------------------------+---------+
| disk.read_cache_blocks | gauge | | disk.read_cache_blocks | counter |
+---------------------------------------+---------+ +---------------------------------------+---------+
@ -1132,31 +1132,31 @@ triggered it
<a name="disk.num_running_threads"></a> <a name="disk.num_running_threads"></a>
<a name="disk.blocked_disk_jobs"></a> <a name="disk.blocked_disk_jobs"></a>
+----------------------------+-------+ +----------------------------+---------+
| name | type | | name | type |
+============================+=======+ +============================+=========+
| disk.request_latency | gauge | | disk.request_latency | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.pinned_blocks | gauge | | disk.pinned_blocks | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.disk_blocks_in_use | gauge | | disk.disk_blocks_in_use | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.queued_disk_jobs | gauge | | disk.queued_disk_jobs | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.num_running_disk_jobs | gauge | | disk.num_running_disk_jobs | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.num_read_jobs | gauge | | disk.num_read_jobs | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.num_write_jobs | gauge | | disk.num_write_jobs | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.num_jobs | gauge | | disk.num_jobs | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.num_writing_threads | gauge | | disk.num_writing_threads | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.num_running_threads | gauge | | disk.num_running_threads | counter |
+----------------------------+-------+ +----------------------------+---------+
| disk.blocked_disk_jobs | gauge | | disk.blocked_disk_jobs | counter |
+----------------------------+-------+ +----------------------------+---------+
the number of microseconds it takes from receiving a request from a the number of microseconds it takes from receiving a request from a
@ -1186,23 +1186,23 @@ peer until we're sending the response back on the socket.
<a name="disk.arc_write_size"></a> <a name="disk.arc_write_size"></a>
<a name="disk.arc_volatile_size"></a> <a name="disk.arc_volatile_size"></a>
+-------------------------+-------+ +-------------------------+---------+
| name | type | | name | type |
+=========================+=======+ +=========================+=========+
| disk.queued_write_bytes | gauge | | disk.queued_write_bytes | counter |
+-------------------------+-------+ +-------------------------+---------+
| disk.arc_mru_size | gauge | | disk.arc_mru_size | counter |
+-------------------------+-------+ +-------------------------+---------+
| disk.arc_mru_ghost_size | gauge | | disk.arc_mru_ghost_size | counter |
+-------------------------+-------+ +-------------------------+---------+
| disk.arc_mfu_size | gauge | | disk.arc_mfu_size | counter |
+-------------------------+-------+ +-------------------------+---------+
| disk.arc_mfu_ghost_size | gauge | | disk.arc_mfu_ghost_size | counter |
+-------------------------+-------+ +-------------------------+---------+
| disk.arc_write_size | gauge | | disk.arc_write_size | counter |
+-------------------------+-------+ +-------------------------+---------+
| disk.arc_volatile_size | gauge | | disk.arc_volatile_size | counter |
+-------------------------+-------+ +-------------------------+---------+
the number of bytes we have sent to the disk I/O the number of bytes we have sent to the disk I/O
@ -1391,47 +1391,47 @@ as total for all disk jobs. Measured in microseconds
<a name="disk.num_fenced_clear_piece"></a> <a name="disk.num_fenced_clear_piece"></a>
<a name="disk.num_fenced_tick_storage"></a> <a name="disk.num_fenced_tick_storage"></a>
+----------------------------------+-------+ +----------------------------------+---------+
| name | type | | name | type |
+==================================+=======+ +==================================+=========+
| disk.num_fenced_read | gauge | | disk.num_fenced_read | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_write | gauge | | disk.num_fenced_write | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_hash | gauge | | disk.num_fenced_hash | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_move_storage | gauge | | disk.num_fenced_move_storage | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_release_files | gauge | | disk.num_fenced_release_files | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_delete_files | gauge | | disk.num_fenced_delete_files | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_check_fastresume | gauge | | disk.num_fenced_check_fastresume | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_save_resume_data | gauge | | disk.num_fenced_save_resume_data | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_rename_file | gauge | | disk.num_fenced_rename_file | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_stop_torrent | gauge | | disk.num_fenced_stop_torrent | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_cache_piece | gauge | | disk.num_fenced_cache_piece | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_flush_piece | gauge | | disk.num_fenced_flush_piece | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_flush_hashed | gauge | | disk.num_fenced_flush_hashed | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_flush_storage | gauge | | disk.num_fenced_flush_storage | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_trim_cache | gauge | | disk.num_fenced_trim_cache | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_file_priority | gauge | | disk.num_fenced_file_priority | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_load_torrent | gauge | | disk.num_fenced_load_torrent | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_clear_piece | gauge | | disk.num_fenced_clear_piece | counter |
+----------------------------------+-------+ +----------------------------------+---------+
| disk.num_fenced_tick_storage | gauge | | disk.num_fenced_tick_storage | counter |
+----------------------------------+-------+ +----------------------------------+---------+
for each kind of disk job, a counter of how many jobs of that kind for each kind of disk job, a counter of how many jobs of that kind
@ -1443,11 +1443,11 @@ are currently blocked by a disk fence
<a name="dht.dht_nodes"></a> <a name="dht.dht_nodes"></a>
+---------------+-------+ +---------------+---------+
| name | type | | name | type |
+===============+=======+ +===============+=========+
| dht.dht_nodes | gauge | | dht.dht_nodes | counter |
+---------------+-------+ +---------------+---------+
The number of nodes in the DHT routing table The number of nodes in the DHT routing table
@ -1458,11 +1458,11 @@ The number of nodes in the DHT routing table
<a name="dht.dht_node_cache"></a> <a name="dht.dht_node_cache"></a>
+--------------------+-------+ +--------------------+---------+
| name | type | | name | type |
+====================+=======+ +====================+=========+
| dht.dht_node_cache | gauge | | dht.dht_node_cache | counter |
+--------------------+-------+ +--------------------+---------+
The number of replacement nodes in the DHT routing table The number of replacement nodes in the DHT routing table
@ -1473,11 +1473,11 @@ The number of replacement nodes in the DHT routing table
<a name="dht.dht_torrents"></a> <a name="dht.dht_torrents"></a>
+------------------+-------+ +------------------+---------+
| name | type | | name | type |
+==================+=======+ +==================+=========+
| dht.dht_torrents | gauge | | dht.dht_torrents | counter |
+------------------+-------+ +------------------+---------+
the number of torrents currently tracked by our DHT node the number of torrents currently tracked by our DHT node
@ -1488,11 +1488,11 @@ the number of torrents currently tracked by our DHT node
<a name="dht.dht_peers"></a> <a name="dht.dht_peers"></a>
+---------------+-------+ +---------------+---------+
| name | type | | name | type |
+===============+=======+ +===============+=========+
| dht.dht_peers | gauge | | dht.dht_peers | counter |
+---------------+-------+ +---------------+---------+
the number of peers currently tracked by our DHT node the number of peers currently tracked by our DHT node
@ -1503,11 +1503,11 @@ the number of peers currently tracked by our DHT node
<a name="dht.dht_immutable_data"></a> <a name="dht.dht_immutable_data"></a>
+------------------------+-------+ +------------------------+---------+
| name | type | | name | type |
+========================+=======+ +========================+=========+
| dht.dht_immutable_data | gauge | | dht.dht_immutable_data | counter |
+------------------------+-------+ +------------------------+---------+
the number of immutable data items tracked by our DHT node the number of immutable data items tracked by our DHT node
@ -1518,11 +1518,11 @@ the number of immutable data items tracked by our DHT node
<a name="dht.dht_mutable_data"></a> <a name="dht.dht_mutable_data"></a>
+----------------------+-------+ +----------------------+---------+
| name | type | | name | type |
+======================+=======+ +======================+=========+
| dht.dht_mutable_data | gauge | | dht.dht_mutable_data | counter |
+----------------------+-------+ +----------------------+---------+
the number of mutable data items tracked by our DHT node the number of mutable data items tracked by our DHT node
@ -1533,11 +1533,11 @@ the number of mutable data items tracked by our DHT node
<a name="dht.dht_allocated_observers"></a> <a name="dht.dht_allocated_observers"></a>
+-----------------------------+-------+ +-----------------------------+---------+
| name | type | | name | type |
+=============================+=======+ +=============================+=========+
| dht.dht_allocated_observers | gauge | | dht.dht_allocated_observers | counter |
+-----------------------------+-------+ +-----------------------------+---------+
the number of RPC observers currently allocated the number of RPC observers currently allocated
@ -1788,19 +1788,19 @@ has occurred.
<a name="utp.num_utp_fin_sent"></a> <a name="utp.num_utp_fin_sent"></a>
<a name="utp.num_utp_close_wait"></a> <a name="utp.num_utp_close_wait"></a>
+------------------------+-------+ +------------------------+---------+
| name | type | | name | type |
+========================+=======+ +========================+=========+
| utp.num_utp_idle | gauge | | utp.num_utp_idle | counter |
+------------------------+-------+ +------------------------+---------+
| utp.num_utp_syn_sent | gauge | | utp.num_utp_syn_sent | counter |
+------------------------+-------+ +------------------------+---------+
| utp.num_utp_connected | gauge | | utp.num_utp_connected | counter |
+------------------------+-------+ +------------------------+---------+
| utp.num_utp_fin_sent | gauge | | utp.num_utp_fin_sent | counter |
+------------------------+-------+ +------------------------+---------+
| utp.num_utp_close_wait | gauge | | utp.num_utp_close_wait | counter |
+------------------------+-------+ +------------------------+---------+
the number of uTP sockets in each respective state the number of uTP sockets in each respective state

View File

@ -41,7 +41,7 @@ a {
ul, ol { line-height: 1.8em; } ul, ol { line-height: 1.8em; }
ul { list-style: square; } ul { list-style: square; }
li { margin-left: 2.8em; font-size: 92%; } li { margin-left: 2.8em; }
p, ul, ol, img {margin-bottom: 1em;} p, ul, ol, img {margin-bottom: 1em;}
@ -66,9 +66,10 @@ div.section p, div.section ul, div.section dl {
#container { #container {
text-align: left; text-align: left;
width: 65em; max-width: 65em;
margin: 0 auto; margin: 5px auto;
position: relative; position: relative;
padding: 3px ;
} }
#header { #header {

View File

@ -1,6 +1,6 @@
%(head_prefix)s %(head_prefix)s
%(head)s %(head)s
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -13,6 +13,7 @@
/* ]]> */ /* ]]> */
</script> </script>
%(stylesheet)s %(stylesheet)s
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%%; } * html pre { height: 1%%; }

View File

@ -1,6 +1,6 @@
%(head_prefix)s %(head_prefix)s
%(head)s %(head)s
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -13,6 +13,7 @@
/* ]]> */ /* ]]> */
</script> </script>
%(stylesheet)s %(stylesheet)s
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%%; } * html pre { height: 1%%; }

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title> <title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -82,7 +83,7 @@ against <tt class="docutils literal">docs/troubleshooting.dot</tt>.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title> <title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -620,7 +621,7 @@ use case, please let us know and we'll update this document.</p>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>Bittorrent udp-tracker protocol extension</title> <title>Bittorrent udp-tracker protocol extension</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -597,7 +598,7 @@ arguments as extensions.</td>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>libtorrent manual</title> <title>libtorrent manual</title>
<meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" /> <meta name="author" content="Arvid Norberg, arvid&#64;libtorrent.org" />
<link rel="stylesheet" type="text/css" href="rst.css" /> <meta name=viewport content="width=device-width, initial-scale=1">
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */ /* <![CDATA[ */
(function() { (function() {
@ -19,6 +19,7 @@
/* ]]> */ /* ]]> */
</script> </script>
<link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="rst.css" />
<style type="text/css"> <style type="text/css">
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html pre { height: 1%; } * html pre { height: 1%; }
@ -362,7 +363,7 @@ and socket buffers.</li>
</tr> </tr>
</table> </table>
</div> </div>
<div id="filler"></div></div> <div id="filler"></div>
</div> </div>
</body> </body>

View File

@ -1361,13 +1361,16 @@ namespace libtorrent
// counts the amount of bytes send and received this session, but only // counts the amount of bytes send and received this session, but only
// the actual payload data (i.e the interesting data), these counters // the actual payload data (i.e the interesting data), these counters
// ignore any protocol overhead. // ignore any protocol overhead. The session is considered to restart
// when a torrent is paused and restarted again. When a torrent is
// paused, these counters are reset to 0.
boost::int64_t total_payload_download; boost::int64_t total_payload_download;
boost::int64_t total_payload_upload; boost::int64_t total_payload_upload;
// the number of bytes that has been downloaded and that has failed the // the number of bytes that has been downloaded and that has failed the
// piece hash test. In other words, this is just how much crap that has // piece hash test. In other words, this is just how much crap that has
// been downloaded. // been downloaded since the torrent was last started. If a torrent is
// paused and then restarted again, this counter will be reset.
boost::int64_t total_failed_bytes; boost::int64_t total_failed_bytes;
// the number of bytes that has been downloaded even though that data // the number of bytes that has been downloaded even though that data
@ -1378,7 +1381,9 @@ namespace libtorrent
// situation when libtorrent may re-request blocks is when the requests // situation when libtorrent may re-request blocks is when the requests
// it sends out are not replied in FIFO-order (it will re-request blocks // it sends out are not replied in FIFO-order (it will re-request blocks
// that are skipped by an out of order block). This is supposed to be as // that are skipped by an out of order block). This is supposed to be as
// low as possible. // low as possible. This only counts bytes since the torrent was last
// started. If a torrent is paused and then restarted again, this counter
// will be reset.
boost::int64_t total_redundant_bytes; boost::int64_t total_redundant_bytes;
// a bitmask that represents which pieces we have (set to true) and the // a bitmask that represents which pieces we have (set to true) and the