forked from premiere/premiere-libtorrent
merged fixes from RC_1_0 and regenerated documentation
This commit is contained in:
parent
72e0e331a5
commit
a44731aabb
|
@ -70,6 +70,8 @@
|
|||
* almost completely changed the storage interface (for custom storage)
|
||||
* added support for hashing pieces in multiple threads
|
||||
|
||||
1.0.5 release
|
||||
|
||||
* improve ip_voter to avoid flapping
|
||||
* fixed bug when max_peerlist_size was set to 0
|
||||
* fix issues with missing exported symbols when building dll
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent manual</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -276,10 +277,10 @@ libraries.</li>
|
|||
</tr>
|
||||
<tr><td><tt class="docutils literal">logging</tt></td>
|
||||
<td><ul class="first last simple">
|
||||
<li><tt class="docutils literal">off</tt> - default. logging disabled.</li>
|
||||
<li><tt class="docutils literal">on</tt> - logging alerts available, still need to
|
||||
be enabled by the alert mask. The reason logging
|
||||
is disabled by default is to keep the binary
|
||||
<li><tt class="docutils literal">off</tt> - logging alerts disabled.</li>
|
||||
<li><tt class="docutils literal">on</tt> - default. logging alerts available,
|
||||
still need to be enabled by the alert mask. The
|
||||
reason to disable logging is to keep the binary
|
||||
size down.</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
@ -294,16 +295,6 @@ logging of the DHT protocol traffic.</li>
|
|||
</ul>
|
||||
</td>
|
||||
</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>
|
||||
<td><ul class="first last simple">
|
||||
<li><tt class="docutils literal">auto</tt> - asserts are on if in debug mode</li>
|
||||
|
@ -320,14 +311,6 @@ filename.</li>
|
|||
</ul>
|
||||
</td>
|
||||
</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 "upnp.log" with the messages
|
||||
sent to and received from UPnP devices.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td><tt class="docutils literal">encryption</tt></td>
|
||||
<td><ul class="first last simple">
|
||||
<li><tt class="docutils literal">on</tt> - encrypted bittorrent connections
|
||||
|
@ -338,6 +321,14 @@ implementation is used.</li>
|
|||
</ul>
|
||||
</td>
|
||||
</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>
|
||||
<td><ul class="first last simple">
|
||||
<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>
|
||||
</td>
|
||||
</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>
|
||||
<td><ul class="first last simple">
|
||||
<li><tt class="docutils literal">auto</tt> - use iconv for string conversions for
|
||||
|
@ -462,28 +443,6 @@ awareness except on windows).</li>
|
|||
</ul>
|
||||
</td>
|
||||
</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<pid>. 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>
|
||||
<td><ul class="first last simple">
|
||||
<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
|
||||
structs and class layouts and sizes.</td>
|
||||
</tr>
|
||||
<tr><td><tt class="docutils literal">TORRENT_LOGGING</tt></td>
|
||||
<td>This macro will enable support for logging
|
||||
<tr><td><tt class="docutils literal">TORRENT_DISABLE_LOGGING</tt></td>
|
||||
<td>This macro will disable support for logging
|
||||
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>
|
||||
</tr>
|
||||
<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
|
||||
piece sorting.</td>
|
||||
</tr>
|
||||
<tr><td><tt class="docutils literal">TORRENT_UPNP_LOGGING</tt></td>
|
||||
<td>Generates a "upnp.log" 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>
|
||||
<td>This will create a log of all disk activity
|
||||
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>
|
||||
<td>Disables use of <tt class="docutils literal"><span class="pre">boost::pool<></span></tt>.</td>
|
||||
</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>
|
||||
<td>If this is defined when including the
|
||||
libtorrent headers, the classes and functions
|
||||
|
@ -813,7 +769,7 @@ be picked up by libtorrent.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -18,6 +18,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -104,7 +105,7 @@ which peer that sent the corrupt data if a piece fails the hash test.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent manual</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -125,7 +126,7 @@ algorithms, seeding policies, ports to new platforms etc.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title></title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -140,7 +141,7 @@ only IPv4 nodes present.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>BitTorrent extension for DHT RSS feeds</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -427,7 +428,7 @@ in both C and Java.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>BitTorrent DHT security extension</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -297,7 +298,7 @@ are accepted.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>BitTorrent extension for arbitrary DHT store</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -530,7 +531,7 @@ e5f96f6f38320f0f33959cb4d3d656452117aadb
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent Examples</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -127,9 +128,14 @@ instructions for how to use it <a class="reference external" href="client_test.h
|
|||
#include "libtorrent/create_torrent.hpp"
|
||||
#include "libtorrent/file.hpp"
|
||||
#include "libtorrent/file_pool.hpp"
|
||||
#include "libtorrent/hex.hpp" </span><span class="comment single">// for from_hex
|
||||
</span>
|
||||
<span class="comment preproc">#include <boost/bind.hpp>
|
||||
</span>
|
||||
<span class="comment preproc">#ifdef TORRENT_WINDOWS
|
||||
#include <direct.h> </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 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">&</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"><</span><span class="keyword type">char</span><span class="operator">>&</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">&</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,54 +199,102 @@ 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="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">&</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">"</span><span class="literal string escape">\\\\</span><span class="literal string">"</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="literal string">""</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">"/"</span><span class="punctuation">)</span> <span class="keyword">return</span> <span class="literal string">""</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">></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
|
||||
// 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">&</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">&</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">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">></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">"%s</span><span class="literal string escape">\n</span><span class="literal 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="keyword">return</span> <span class="name builtin">true</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="name">fprintf</span><span class="punctuation">(</span><span class="name">stderr</span><span class="punctuation">,</span> <span class="literal string">"</span><span class="literal string escape">\r</span><span class="literal string">%d/%d"</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="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="name">fputs</span><span class="punctuation">(</span><span class="literal string">"usage: make_torrent FILE [OPTIONS]</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"Generates a torrent file from the specified file</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"or directory and writes it to standard out</span><span class="literal string escape">\n\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"OPTIONS:</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-m file generate a merkle hash tree torrent.</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" merkle torrents require client support</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" the resulting full merkle tree is written to</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" the specified file</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-w url adds a web seed to the torrent with</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" the specified url</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-t url adds the specified tracker to the</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" torrent. For multiple trackers, specify more</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" -t options</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-c comment sets the comment to the specified string</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-C creator sets the created-by field to the specified string</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-p bytes enables padding files. Files larger</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" than bytes will be piece-aligned</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-s bytes specifies a piece size for the torrent</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" This has to be a multiple of 16 kiB</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-l Don't follow symlinks, instead encode them as</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" links in the torrent file</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-o file specifies the output filename of the torrent file</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" If this is not specified, the torrent file is</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" printed to the standard out, except on windows</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" where the filename defaults to a.torrent</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-r file add root certificate to the torrent, to verify</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" the HTTPS tracker</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-m file generate a merkle hash tree torrent.</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" merkle torrents require client support</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" the resulting full merkle tree is written to</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" the specified file</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-w url adds a web seed to the torrent with</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" the specified url</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-t url adds the specified tracker to the</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" torrent. For multiple trackers, specify more</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" -t options</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-c comment sets the comment to the specified string</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-C creator sets the created-by field to the specified string</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-p bytes enables padding files. Files larger</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" than bytes will be piece-aligned</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-s bytes specifies a piece size for the torrent</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" This has to be a multiple of 16 kiB</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-l Don't follow symlinks, instead encode them as</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" links in the torrent file</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-o file specifies the output filename of the torrent file</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" If this is not specified, the torrent file is</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" printed to the standard out, except on windows</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" where the filename defaults to a.torrent</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-r file add root certificate to the torrent, to verify</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" the HTTPS tracker</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-S info-hash add a similar torrent by info-hash. The similar</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" torrent is expected to share some files with this one</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-L collection add a collection name to this torrent. Other torrents</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" in the same collection is expected to share files</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" with this one.</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">"-M make the torrent compatible with mutable torrents</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" this means aligning large files and pad them in order</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" for piece hashes to uniquely indentify a file without</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="literal string">" overlap</span><span class="literal string escape">\n</span><span class="literal string">"</span>
|
||||
<span class="punctuation">,</span> <span class="name">stderr</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="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> <span class="name">std</span><span class="operator">::</span><span class="name">vector</span><span class="operator"><</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">></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"><</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">></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"><</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">></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"><</span><span class="name">sha1_hash</span><span class="operator">></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">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>
|
||||
|
@ -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="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">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="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>
|
||||
|
@ -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="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">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">"invalid info-hash for -S. "</span>
|
||||
<span class="literal string">"Expected 40 hex characters</span><span class="literal string escape">\n</span><span class="literal string">"</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">&</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">"invalid info-hash for -S</span><span class="literal string escape">\n</span><span class="literal string">"</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="name">print_usage</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="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">"</span><span class="literal string escape">\\</span><span class="literal string">"</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">"/"</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="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="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"><</span><span class="name">std</span><span class="operator">::</span><span class="name">string</span><span class="operator">>::</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"><</span><span class="name">sha1_hash</span><span class="operator">>::</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">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">&</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="punctuation">{</span>
|
||||
|
@ -432,10 +539,11 @@ print information about it to std out:</p>
|
|||
<span class="comment preproc">#include "libtorrent/entry.hpp"
|
||||
#include "libtorrent/bencode.hpp"
|
||||
#include "libtorrent/torrent_info.hpp"
|
||||
#include "libtorrent/lazy_entry.hpp"
|
||||
#include "libtorrent/bdecode.hpp"
|
||||
#include "libtorrent/magnet_uri.hpp"
|
||||
</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">&</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"><</span><span class="keyword type">char</span><span class="operator">>&</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">&</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">&</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"><</span><span class="keyword type">char</span><span class="operator">>&</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">&</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="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">"rb"</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="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">&</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">></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"><</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">></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"><</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">></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">></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">></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="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">"failed to load file: %s</span><span class="literal string escape">\n</span><span class="literal string">"</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="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="name">printf</span><span class="punctuation">(</span><span class="literal string">"decoding. recursion limit: %d total item count limit: %d</span><span class="literal string escape">\n</span><span class="literal string">"</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">&</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="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">&</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">&</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="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">&</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="name">printf</span><span class="punctuation">(</span><span class="literal string">"</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">"</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>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title></title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@libtorrent.org Ludvig Strigeus, ludde@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -490,7 +491,7 @@ message wrapping.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent manual</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -407,7 +408,7 @@ epoll on linux and kqueue on MacOS X and BSD.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title></title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* 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="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://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://code.google.com/p/libtorrent/wiki/index">wiki</a></li>
|
||||
</ul>
|
||||
<hr class="docutils" />
|
||||
<p>Extensions</p>
|
||||
|
@ -105,7 +105,7 @@ the library.</p>
|
|||
<h2>Donate</h2>
|
||||
<p>Support the development of libtorrent</p>
|
||||
<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>
|
||||
<div class="section" id="feedback">
|
||||
<h2>Feedback</h2>
|
||||
|
@ -114,7 +114,7 @@ the library.</p>
|
|||
</div>
|
||||
<div class="section" id="license">
|
||||
<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
|
||||
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
|
||||
|
@ -166,7 +166,7 @@ list or posted to the <a class="reference external" href="https://code.google.co
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -18,6 +18,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -214,7 +215,7 @@ files without needing to leave your computer on.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent python binding</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -150,7 +151,7 @@ ses.listen_on(6881, 6891)
|
|||
e = lt.bdecode(open("test.torrent", 'rb').read())
|
||||
info = lt.torrent_info(e)
|
||||
|
||||
params = { save_path: './', \
|
||||
params = { save_path: '.', \
|
||||
storage_mode: lt.storage_mode_t.storage_mode_sparse, \
|
||||
ti: info }
|
||||
h = ses.add_torrent(params)
|
||||
|
@ -200,7 +201,7 @@ while (not h.is_seed()):
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
.document {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.document a {
|
||||
border: none;
|
||||
color: black;
|
||||
|
@ -37,6 +32,9 @@ div.main-toc {
|
|||
column-count: 4;
|
||||
-webkit-column-count: 4;
|
||||
-moz-column-count: 4;
|
||||
column-width: 13em;
|
||||
-webkit-column-width: 13em;
|
||||
-moz-column-width: 13em;
|
||||
border: 1px solid #999;
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
|
|
|
@ -344,53 +344,53 @@ disconnect peers.
|
|||
<a name="peer.num_peers_up_disk"></a>
|
||||
<a name="peer.num_peers_down_disk"></a>
|
||||
|
||||
+---------------------------------------+-------+
|
||||
| name | type |
|
||||
+=======================================+=======+
|
||||
| peer.num_tcp_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_socks5_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_http_proxy_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_utp_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_i2p_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_ssl_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_ssl_socks5_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_ssl_http_proxy_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_ssl_utp_peers | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_half_open | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_connected | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_up_interested | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_down_interested | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_up_unchoked_all | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_up_unchoked_optimistic | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_up_unchoked | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_down_unchoked | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_up_requests | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_down_requests | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_end_game | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_up_disk | gauge |
|
||||
+---------------------------------------+-------+
|
||||
| peer.num_peers_down_disk | gauge |
|
||||
+---------------------------------------+-------+
|
||||
+---------------------------------------+---------+
|
||||
| name | type |
|
||||
+=======================================+=========+
|
||||
| peer.num_tcp_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_socks5_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_http_proxy_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_utp_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_i2p_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_ssl_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_ssl_socks5_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_ssl_http_proxy_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_ssl_utp_peers | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_half_open | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_connected | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_up_interested | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_down_interested | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_up_unchoked_all | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_up_unchoked_optimistic | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_up_unchoked | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_down_unchoked | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_up_requests | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_down_requests | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_end_game | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_up_disk | counter |
|
||||
+---------------------------------------+---------+
|
||||
| peer.num_peers_down_disk | counter |
|
||||
+---------------------------------------+---------+
|
||||
|
||||
|
||||
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_down_queue"></a>
|
||||
|
||||
+------------------------+-------+
|
||||
| name | type |
|
||||
+========================+=======+
|
||||
| net.limiter_up_queue | gauge |
|
||||
+------------------------+-------+
|
||||
| net.limiter_down_queue | gauge |
|
||||
+------------------------+-------+
|
||||
+------------------------+---------+
|
||||
| name | type |
|
||||
+========================+=========+
|
||||
| net.limiter_up_queue | counter |
|
||||
+------------------------+---------+
|
||||
| net.limiter_down_queue | counter |
|
||||
+------------------------+---------+
|
||||
|
||||
|
||||
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_down_bytes"></a>
|
||||
|
||||
+------------------------+-------+
|
||||
| name | type |
|
||||
+========================+=======+
|
||||
| net.limiter_up_bytes | gauge |
|
||||
+------------------------+-------+
|
||||
| net.limiter_down_bytes | gauge |
|
||||
+------------------------+-------+
|
||||
+------------------------+---------+
|
||||
| name | type |
|
||||
+========================+=========+
|
||||
| net.limiter_up_bytes | counter |
|
||||
+------------------------+---------+
|
||||
| net.limiter_down_bytes | counter |
|
||||
+------------------------+---------+
|
||||
|
||||
|
||||
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>
|
||||
|
||||
+------------------------------+-------+
|
||||
| name | type |
|
||||
+==============================+=======+
|
||||
| net.has_incoming_connections | gauge |
|
||||
+------------------------------+-------+
|
||||
+------------------------------+---------+
|
||||
| name | type |
|
||||
+==============================+=========+
|
||||
| net.has_incoming_connections | counter |
|
||||
+------------------------------+---------+
|
||||
|
||||
|
||||
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_error_torrents"></a>
|
||||
|
||||
+----------------------------------+-------+
|
||||
| name | type |
|
||||
+==================================+=======+
|
||||
| ses.num_checking_torrents | gauge |
|
||||
+----------------------------------+-------+
|
||||
| ses.num_stopped_torrents | gauge |
|
||||
+----------------------------------+-------+
|
||||
| ses.num_upload_only_torrents | gauge |
|
||||
+----------------------------------+-------+
|
||||
| ses.num_downloading_torrents | gauge |
|
||||
+----------------------------------+-------+
|
||||
| ses.num_seeding_torrents | gauge |
|
||||
+----------------------------------+-------+
|
||||
| ses.num_queued_seeding_torrents | gauge |
|
||||
+----------------------------------+-------+
|
||||
| ses.num_queued_download_torrents | gauge |
|
||||
+----------------------------------+-------+
|
||||
| ses.num_error_torrents | gauge |
|
||||
+----------------------------------+-------+
|
||||
+----------------------------------+---------+
|
||||
| name | type |
|
||||
+==================================+=========+
|
||||
| ses.num_checking_torrents | counter |
|
||||
+----------------------------------+---------+
|
||||
| ses.num_stopped_torrents | counter |
|
||||
+----------------------------------+---------+
|
||||
| ses.num_upload_only_torrents | counter |
|
||||
+----------------------------------+---------+
|
||||
| ses.num_downloading_torrents | counter |
|
||||
+----------------------------------+---------+
|
||||
| ses.num_seeding_torrents | counter |
|
||||
+----------------------------------+---------+
|
||||
| ses.num_queued_seeding_torrents | counter |
|
||||
+----------------------------------+---------+
|
||||
| ses.num_queued_download_torrents | counter |
|
||||
+----------------------------------+---------+
|
||||
| ses.num_error_torrents | counter |
|
||||
+----------------------------------+---------+
|
||||
|
||||
|
||||
these gauges count the number of torrents in
|
||||
|
@ -665,13 +665,13 @@ state.
|
|||
<a name="ses.num_loaded_torrents"></a>
|
||||
<a name="ses.num_pinned_torrents"></a>
|
||||
|
||||
+-------------------------+-------+
|
||||
| name | type |
|
||||
+=========================+=======+
|
||||
| ses.num_loaded_torrents | gauge |
|
||||
+-------------------------+-------+
|
||||
| ses.num_pinned_torrents | gauge |
|
||||
+-------------------------+-------+
|
||||
+-------------------------+---------+
|
||||
| name | type |
|
||||
+=========================+=========+
|
||||
| ses.num_loaded_torrents | counter |
|
||||
+-------------------------+---------+
|
||||
| ses.num_pinned_torrents | counter |
|
||||
+-------------------------+---------+
|
||||
|
||||
|
||||
the number of torrents that are currently loaded
|
||||
|
@ -733,11 +733,11 @@ is enabled).
|
|||
|
||||
<a name="ses.num_unchoke_slots"></a>
|
||||
|
||||
+-----------------------+-------+
|
||||
| name | type |
|
||||
+=======================+=======+
|
||||
| ses.num_unchoke_slots | gauge |
|
||||
+-----------------------+-------+
|
||||
+-----------------------+---------+
|
||||
| name | type |
|
||||
+=======================+=========+
|
||||
| ses.num_unchoke_slots | counter |
|
||||
+-----------------------+---------+
|
||||
|
||||
|
||||
the number of allowed unchoked peers
|
||||
|
@ -1087,9 +1087,9 @@ the number of pieces considered while picking pieces
|
|||
+---------------------------------------+---------+
|
||||
| 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.blocked_disk_jobs"></a>
|
||||
|
||||
+----------------------------+-------+
|
||||
| name | type |
|
||||
+============================+=======+
|
||||
| disk.request_latency | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.pinned_blocks | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.disk_blocks_in_use | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.queued_disk_jobs | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.num_running_disk_jobs | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.num_read_jobs | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.num_write_jobs | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.num_jobs | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.num_writing_threads | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.num_running_threads | gauge |
|
||||
+----------------------------+-------+
|
||||
| disk.blocked_disk_jobs | gauge |
|
||||
+----------------------------+-------+
|
||||
+----------------------------+---------+
|
||||
| name | type |
|
||||
+============================+=========+
|
||||
| disk.request_latency | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.pinned_blocks | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.disk_blocks_in_use | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.queued_disk_jobs | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.num_running_disk_jobs | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.num_read_jobs | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.num_write_jobs | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.num_jobs | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.num_writing_threads | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.num_running_threads | counter |
|
||||
+----------------------------+---------+
|
||||
| disk.blocked_disk_jobs | counter |
|
||||
+----------------------------+---------+
|
||||
|
||||
|
||||
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_volatile_size"></a>
|
||||
|
||||
+-------------------------+-------+
|
||||
| name | type |
|
||||
+=========================+=======+
|
||||
| disk.queued_write_bytes | gauge |
|
||||
+-------------------------+-------+
|
||||
| disk.arc_mru_size | gauge |
|
||||
+-------------------------+-------+
|
||||
| disk.arc_mru_ghost_size | gauge |
|
||||
+-------------------------+-------+
|
||||
| disk.arc_mfu_size | gauge |
|
||||
+-------------------------+-------+
|
||||
| disk.arc_mfu_ghost_size | gauge |
|
||||
+-------------------------+-------+
|
||||
| disk.arc_write_size | gauge |
|
||||
+-------------------------+-------+
|
||||
| disk.arc_volatile_size | gauge |
|
||||
+-------------------------+-------+
|
||||
+-------------------------+---------+
|
||||
| name | type |
|
||||
+=========================+=========+
|
||||
| disk.queued_write_bytes | counter |
|
||||
+-------------------------+---------+
|
||||
| disk.arc_mru_size | counter |
|
||||
+-------------------------+---------+
|
||||
| disk.arc_mru_ghost_size | counter |
|
||||
+-------------------------+---------+
|
||||
| disk.arc_mfu_size | counter |
|
||||
+-------------------------+---------+
|
||||
| disk.arc_mfu_ghost_size | counter |
|
||||
+-------------------------+---------+
|
||||
| disk.arc_write_size | counter |
|
||||
+-------------------------+---------+
|
||||
| disk.arc_volatile_size | counter |
|
||||
+-------------------------+---------+
|
||||
|
||||
|
||||
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_tick_storage"></a>
|
||||
|
||||
+----------------------------------+-------+
|
||||
| name | type |
|
||||
+==================================+=======+
|
||||
| disk.num_fenced_read | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_write | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_hash | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_move_storage | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_release_files | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_delete_files | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_check_fastresume | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_save_resume_data | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_rename_file | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_stop_torrent | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_cache_piece | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_flush_piece | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_flush_hashed | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_flush_storage | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_trim_cache | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_file_priority | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_load_torrent | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_clear_piece | gauge |
|
||||
+----------------------------------+-------+
|
||||
| disk.num_fenced_tick_storage | gauge |
|
||||
+----------------------------------+-------+
|
||||
+----------------------------------+---------+
|
||||
| name | type |
|
||||
+==================================+=========+
|
||||
| disk.num_fenced_read | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_write | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_hash | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_move_storage | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_release_files | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_delete_files | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_check_fastresume | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_save_resume_data | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_rename_file | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_stop_torrent | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_cache_piece | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_flush_piece | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_flush_hashed | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_flush_storage | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_trim_cache | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_file_priority | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_load_torrent | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_clear_piece | counter |
|
||||
+----------------------------------+---------+
|
||||
| disk.num_fenced_tick_storage | counter |
|
||||
+----------------------------------+---------+
|
||||
|
||||
|
||||
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>
|
||||
|
||||
+---------------+-------+
|
||||
| name | type |
|
||||
+===============+=======+
|
||||
| dht.dht_nodes | gauge |
|
||||
+---------------+-------+
|
||||
+---------------+---------+
|
||||
| name | type |
|
||||
+===============+=========+
|
||||
| dht.dht_nodes | counter |
|
||||
+---------------+---------+
|
||||
|
||||
|
||||
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>
|
||||
|
||||
+--------------------+-------+
|
||||
| name | type |
|
||||
+====================+=======+
|
||||
| dht.dht_node_cache | gauge |
|
||||
+--------------------+-------+
|
||||
+--------------------+---------+
|
||||
| name | type |
|
||||
+====================+=========+
|
||||
| dht.dht_node_cache | counter |
|
||||
+--------------------+---------+
|
||||
|
||||
|
||||
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>
|
||||
|
||||
+------------------+-------+
|
||||
| name | type |
|
||||
+==================+=======+
|
||||
| dht.dht_torrents | gauge |
|
||||
+------------------+-------+
|
||||
+------------------+---------+
|
||||
| name | type |
|
||||
+==================+=========+
|
||||
| dht.dht_torrents | counter |
|
||||
+------------------+---------+
|
||||
|
||||
|
||||
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>
|
||||
|
||||
+---------------+-------+
|
||||
| name | type |
|
||||
+===============+=======+
|
||||
| dht.dht_peers | gauge |
|
||||
+---------------+-------+
|
||||
+---------------+---------+
|
||||
| name | type |
|
||||
+===============+=========+
|
||||
| dht.dht_peers | counter |
|
||||
+---------------+---------+
|
||||
|
||||
|
||||
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>
|
||||
|
||||
+------------------------+-------+
|
||||
| name | type |
|
||||
+========================+=======+
|
||||
| dht.dht_immutable_data | gauge |
|
||||
+------------------------+-------+
|
||||
+------------------------+---------+
|
||||
| name | type |
|
||||
+========================+=========+
|
||||
| dht.dht_immutable_data | counter |
|
||||
+------------------------+---------+
|
||||
|
||||
|
||||
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>
|
||||
|
||||
+----------------------+-------+
|
||||
| name | type |
|
||||
+======================+=======+
|
||||
| dht.dht_mutable_data | gauge |
|
||||
+----------------------+-------+
|
||||
+----------------------+---------+
|
||||
| name | type |
|
||||
+======================+=========+
|
||||
| dht.dht_mutable_data | counter |
|
||||
+----------------------+---------+
|
||||
|
||||
|
||||
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>
|
||||
|
||||
+-----------------------------+-------+
|
||||
| name | type |
|
||||
+=============================+=======+
|
||||
| dht.dht_allocated_observers | gauge |
|
||||
+-----------------------------+-------+
|
||||
+-----------------------------+---------+
|
||||
| name | type |
|
||||
+=============================+=========+
|
||||
| dht.dht_allocated_observers | counter |
|
||||
+-----------------------------+---------+
|
||||
|
||||
|
||||
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_close_wait"></a>
|
||||
|
||||
+------------------------+-------+
|
||||
| name | type |
|
||||
+========================+=======+
|
||||
| utp.num_utp_idle | gauge |
|
||||
+------------------------+-------+
|
||||
| utp.num_utp_syn_sent | gauge |
|
||||
+------------------------+-------+
|
||||
| utp.num_utp_connected | gauge |
|
||||
+------------------------+-------+
|
||||
| utp.num_utp_fin_sent | gauge |
|
||||
+------------------------+-------+
|
||||
| utp.num_utp_close_wait | gauge |
|
||||
+------------------------+-------+
|
||||
+------------------------+---------+
|
||||
| name | type |
|
||||
+========================+=========+
|
||||
| utp.num_utp_idle | counter |
|
||||
+------------------------+---------+
|
||||
| utp.num_utp_syn_sent | counter |
|
||||
+------------------------+---------+
|
||||
| utp.num_utp_connected | counter |
|
||||
+------------------------+---------+
|
||||
| utp.num_utp_fin_sent | counter |
|
||||
+------------------------+---------+
|
||||
| utp.num_utp_close_wait | counter |
|
||||
+------------------------+---------+
|
||||
|
||||
|
||||
the number of uTP sockets in each respective state
|
||||
|
|
|
@ -41,7 +41,7 @@ a {
|
|||
|
||||
ul, ol { line-height: 1.8em; }
|
||||
ul { list-style: square; }
|
||||
li { margin-left: 2.8em; font-size: 92%; }
|
||||
li { margin-left: 2.8em; }
|
||||
|
||||
p, ul, ol, img {margin-bottom: 1em;}
|
||||
|
||||
|
@ -66,9 +66,10 @@ div.section p, div.section ul, div.section dl {
|
|||
|
||||
#container {
|
||||
text-align: left;
|
||||
width: 65em;
|
||||
margin: 0 auto;
|
||||
max-width: 65em;
|
||||
margin: 5px auto;
|
||||
position: relative;
|
||||
padding: 3px ;
|
||||
}
|
||||
|
||||
#header {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
%(head_prefix)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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -13,6 +13,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
%(stylesheet)s
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%%; }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
%(head_prefix)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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -13,6 +13,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
%(stylesheet)s
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%%; }
|
||||
|
|
833
docs/todo.html
833
docs/todo.html
File diff suppressed because one or more lines are too long
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent manual</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -82,7 +83,7 @@ against <tt class="docutils literal">docs/troubleshooting.dot</tt>.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent manual</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -620,7 +621,7 @@ use case, please let us know and we'll update this document.</p>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>Bittorrent udp-tracker protocol extension</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -597,7 +598,7 @@ arguments as extensions.</td>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
|
||||
<title>libtorrent manual</title>
|
||||
<meta name="author" content="Arvid Norberg, arvid@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">
|
||||
/* <![CDATA[ */
|
||||
(function() {
|
||||
|
@ -19,6 +19,7 @@
|
|||
/* ]]> */
|
||||
</script>
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="rst.css" />
|
||||
<style type="text/css">
|
||||
/* Hides from IE-mac \*/
|
||||
* html pre { height: 1%; }
|
||||
|
@ -362,7 +363,7 @@ and socket buffers.</li>
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="filler"></div></div>
|
||||
<div id="filler"></div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -1361,13 +1361,16 @@ namespace libtorrent
|
|||
|
||||
// counts the amount of bytes send and received this session, but only
|
||||
// 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_upload;
|
||||
|
||||
// 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
|
||||
// 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;
|
||||
|
||||
// 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
|
||||
// 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
|
||||
// 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;
|
||||
|
||||
// a bitmask that represents which pieces we have (set to true) and the
|
||||
|
|
Loading…
Reference in New Issue