*** empty log message ***

This commit is contained in:
Arvid Norberg 2006-05-20 17:59:17 +00:00
parent 262e97f21d
commit d891214358
10 changed files with 472 additions and 108 deletions

View File

@ -3,9 +3,129 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.8: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>client_test example program</title> <title>client_test example program</title>
<link rel="stylesheet" href="style.css" type="text/css" /> <style type="text/css">
body
{
background-color: white;
color: black;
margin: 1em 2em 1em 2em;
}
h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; font-size: 140%; }
h2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; font-size: 110%; }
h3 { font-family: "courier new", courier, monospace; font-weight: bold; text-align: left; font-size: 100%; }
pre
{
border: gray 1pt solid;
padding: 2pt;
display: block;
font-family: "courier new", courier, monospace;
background-color: #eeeeee;
color: black;
font-size: small
}
code
{
white-space: pre;
border: gray 1pt solid;
padding: 2pt;
display: block;
font-family: "courier new", courier, monospace;
color: black;
font-size: small
}
tt
{
display: inline;
font-family: "Courier New", Courier, monospace;
}
p
{
text-align: justify;
font-family: Georgia, "Times New Roman", Times, serif
}
ul
{
font-family: Georgia, "Times New Roman", Times, serif
}
ol
{
font-family: Georgia, "Times New Roman", Times, serif
}
a:link
{
font-weight: bold;
color: #003366;
text-decoration: none;
}
a:visited
{
font-weight: bold;
color: #003366;
text-decoration: none;
}
table
{
border: 1px solid black;
border-collapse: collapse;
}
table td
{
padding: 6px;
}
table th
{
border: 3px solid black;
padding: 6px;
}
table.menu
{
border-style: none;
}
table.menu td
{
padding-left: 15px;
padding-right: 15px;
padding-top: 7px;
padding-bottom: 7px;
}
td
{
border: 1px solid black
}
div.warning, div.note, div.important {
width: 80%;
margin: 1.5em auto;
background: #C1E5F6;
background: #F1FFF5;
border: solid 1px #D1DFD5;
padding: 5px 10px 5px 10px;
}
</style>
</head> </head>
<body> <body>
<div class="document" id="client-test-example-program"> <div class="document" id="client-test-example-program">
@ -26,7 +146,7 @@ client and has the metadata (.torrent file). The metadata extension in
libtorrent will then download it from that peer (or from those peers if more libtorrent will then download it from that peer (or from those peers if more
than one).</p> than one).</p>
<p>While running, the <tt class="docutils literal"><span class="pre">client_test</span></tt> sample will look something like this:</p> <p>While running, the <tt class="docutils literal"><span class="pre">client_test</span></tt> sample will look something like this:</p>
<div class="image"><img alt="client_test.png" src="client_test.png" /></div> <img alt="client_test.png" src="client_test.png" />
<p>The commands available in the client are:</p> <p>The commands available in the client are:</p>
<blockquote> <blockquote>
<ul class="simple"> <ul class="simple">
@ -47,7 +167,7 @@ been requested from which peer. The green background means that it has been
downloaded. It shows that fast peers will prefer to request whole pieces downloaded. It shows that fast peers will prefer to request whole pieces
instead of dowloading parts of pieces. It may make it easier to determine instead of dowloading parts of pieces. It may make it easier to determine
which peer that sent the corrupt data if a piece fails the hash test.</p> which peer that sent the corrupt data if a piece fails the hash test.</p>
<div class="image"><img alt="unicode_support.png" src="unicode_support.png" /></div> <img alt="unicode_support.png" src="unicode_support.png" />
<p>There's unicode support on linux, MacOS X and Windows.</p> <p>There's unicode support on linux, MacOS X and Windows.</p>
</div> </div>
</body> </body>

View File

@ -148,14 +148,13 @@ bittorrent protocol or clients that don't support this extension or the
one you want to add.</p> one you want to add.</p>
<p>To advertise to other clients that you support, one bit from the reserved <p>To advertise to other clients that you support, one bit from the reserved
bytes is used.</p> bytes is used.</p>
<dl class="docutils"> <p>Right now, two bits have known usages.</p>
<dt>Right now, two bits have known usages.</dt> <blockquote>
<dd><ul class="first last simple"> <ul class="simple">
<li>[7] &amp; 1 is used by Mainline for DHT support</li> <li>[7] &amp; 1 is used by Mainline for DHT support</li>
<li>[7] &amp; 2 is used by XBT client for peer-exchange support</li> <li>[7] &amp; 2 is used by XBT client for peer-exchange support</li>
</ul> </ul>
</dd> </blockquote>
</dl>
<p>The bit selected for the extension protocol is bit 20 from the right (counting <p>The bit selected for the extension protocol is bit 20 from the right (counting
starts at 0). So (reserved_byte[5] &amp; 0x10) is the expression to use for checking starts at 0). So (reserved_byte[5] &amp; 0x10) is the expression to use for checking
if the client supports extended messaging.</p> if the client supports extended messaging.</p>

View File

@ -14,6 +14,7 @@ To advertise to other clients that you support, one bit from the reserved
bytes is used. bytes is used.
Right now, two bits have known usages. Right now, two bits have known usages.
* [7] & 1 is used by Mainline for DHT support * [7] & 1 is used by Mainline for DHT support
* [7] & 2 is used by XBT client for peer-exchange support * [7] & 2 is used by XBT client for peer-exchange support

View File

@ -3,9 +3,129 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.8: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>libtorrent</title> <title>libtorrent</title>
<link rel="stylesheet" href="style.css" type="text/css" /> <style type="text/css">
body
{
background-color: white;
color: black;
margin: 1em 2em 1em 2em;
}
h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; font-size: 140%; }
h2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; font-size: 110%; }
h3 { font-family: "courier new", courier, monospace; font-weight: bold; text-align: left; font-size: 100%; }
pre
{
border: gray 1pt solid;
padding: 2pt;
display: block;
font-family: "courier new", courier, monospace;
background-color: #eeeeee;
color: black;
font-size: small
}
code
{
white-space: pre;
border: gray 1pt solid;
padding: 2pt;
display: block;
font-family: "courier new", courier, monospace;
color: black;
font-size: small
}
tt
{
display: inline;
font-family: "Courier New", Courier, monospace;
}
p
{
text-align: justify;
font-family: Georgia, "Times New Roman", Times, serif
}
ul
{
font-family: Georgia, "Times New Roman", Times, serif
}
ol
{
font-family: Georgia, "Times New Roman", Times, serif
}
a:link
{
font-weight: bold;
color: #003366;
text-decoration: none;
}
a:visited
{
font-weight: bold;
color: #003366;
text-decoration: none;
}
table
{
border: 1px solid black;
border-collapse: collapse;
}
table td
{
padding: 6px;
}
table th
{
border: 3px solid black;
padding: 6px;
}
table.menu
{
border-style: none;
}
table.menu td
{
padding-left: 15px;
padding-right: 15px;
padding-top: 7px;
padding-bottom: 7px;
}
td
{
border: 1px solid black
}
div.warning, div.note, div.important {
width: 80%;
margin: 1.5em auto;
background: #C1E5F6;
background: #F1FFF5;
border: solid 1px #D1DFD5;
padding: 5px 10px 5px 10px;
}
</style>
</head> </head>
<body> <body>
<div class="document" id="libtorrent"> <div class="document" id="libtorrent">
@ -39,8 +159,8 @@ library and not a full featured client, although it comes with a working
<li>to be very easy to use</li> <li>to be very easy to use</li>
</ul> </ul>
</blockquote> </blockquote>
<div class="section" id="donate"> <div class="section">
<h1><a name="donate">Donate</a></h1> <h1><a id="donate" name="donate">Donate</a></h1>
<p>Support the development of libtorrent</p> <p>Support the development of libtorrent</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="cmd" value="_xclick">
@ -52,13 +172,13 @@ library and not a full featured client, although it comes with a working
<input type="image" src="https://www.paypal.com/images/x-click-but04.gif" <input type="image" src="https://www.paypal.com/images/x-click-but04.gif"
border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form></div> </form></div>
<div class="section" id="feedback"> <div class="section">
<h1><a name="feedback">Feedback</a></h1> <h1><a id="feedback" name="feedback">Feedback</a></h1>
<p>There's a <a class="reference" href="http://lists.sourceforge.net/lists/listinfo/libtorrent-discuss">mailing list</a>, general libtorrent discussion.</p> <p>There's a <a class="reference" href="http://lists.sourceforge.net/lists/listinfo/libtorrent-discuss">mailing list</a>, general libtorrent discussion.</p>
<p>You can usually find me as hydri in <tt class="docutils literal"><span class="pre">#libtorrent</span></tt> on <tt class="docutils literal"><span class="pre">irc.freenode.net</span></tt>.</p> <p>You can usually find me as hydri in <tt class="docutils literal"><span class="pre">#libtorrent</span></tt> on <tt class="docutils literal"><span class="pre">irc.freenode.net</span></tt>.</p>
</div> </div>
<div class="section" id="acknowledgements"> <div class="section">
<h1><a name="acknowledgements">Acknowledgements</a></h1> <h1><a id="acknowledgements" name="acknowledgements">Acknowledgements</a></h1>
<p>Written by Arvid Norberg. Copyright (c) 2003</p> <p>Written by Arvid Norberg. Copyright (c) 2003</p>
<p>Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson</p> <p>Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson</p>
<p>Thanks to Reimond Retz for bugfixes, suggestions and testing</p> <p>Thanks to Reimond Retz for bugfixes, suggestions and testing</p>

View File

@ -352,8 +352,8 @@ boost libraries as well as <a class="reference" href="http://www.zlib.org">zlib<
<blockquote> <blockquote>
<ul class="simple"> <ul class="simple">
<li>Windows 2000 vc7.1</li> <li>Windows 2000 vc7.1</li>
<li>Linux x86 GCC 3.0.4, GCC 3.2.3, GCC 3.4.2</li> <li>Linux x86 GCC 3.3, GCC 3.4.2</li>
<li>MacOS X (darwin), (Apple's) GCC 3.3, (Apple's) GCC 4.0</li> <li>MacOS X (darwin), (Apple's) GCC 4.0</li>
<li>SunOS 5.8 GCC 3.1</li> <li>SunOS 5.8 GCC 3.1</li>
<li>Cygwin GCC 3.3.3</li> <li>Cygwin GCC 3.3.3</li>
</ul> </ul>
@ -362,7 +362,8 @@ boost libraries as well as <a class="reference" href="http://www.zlib.org">zlib<
<blockquote> <blockquote>
<ul class="simple"> <ul class="simple">
<li>GCC 2.95.4</li> <li>GCC 2.95.4</li>
<li>msvc6 sp5</li> <li>msvc6</li>
<li>(Apple's) GCC 3.3 (compiler crashes with the latest version of asio)</li>
</ul> </ul>
</blockquote> </blockquote>
<p>libtorrent is released under the <a class="reference" href="http://www.opensource.org/licenses/bsd-license.php">BSD-license</a>.</p> <p>libtorrent is released under the <a class="reference" href="http://www.opensource.org/licenses/bsd-license.php">BSD-license</a>.</p>
@ -1517,7 +1518,7 @@ struct torrent_handle
entry write_resume_data() const; entry write_resume_data() const;
std::vector&lt;char&gt; const&amp; metadata() const; std::vector&lt;char&gt; const&amp; metadata() const;
void force_reannounce() const; void force_reannounce() const;
void connect_peer(asio::ipv4::tcp::endpoint const&amp; adr) const; void connect_peer(asio::ip::tcp::endpoint const&amp; adr) const;
void set_tracker_login(std::string const&amp; username void set_tracker_login(std::string const&amp; username
, std::string const&amp; password) const; , std::string const&amp; password) const;
@ -1533,8 +1534,8 @@ struct torrent_handle
void set_upload_limit(int limit) const; void set_upload_limit(int limit) const;
void set_download_limit(int limit) const; void set_download_limit(int limit) const;
void set_peer_upload_limit(asio::ipv4::tcp::endpoint ip, int limit) const; void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
void set_peer_download_limit(asio::ipv4::tcp::endpoint ip, int limit) const; void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
void use_interface(char const* net_interface) const; void use_interface(char const* net_interface) const;
@ -1604,7 +1605,7 @@ peers. If the torrent is invalid, queued or in checking mode, this functions wil
<h2><a id="connect-peer" name="connect-peer">connect_peer()</a></h2> <h2><a id="connect-peer" name="connect-peer">connect_peer()</a></h2>
<blockquote> <blockquote>
<pre class="literal-block"> <pre class="literal-block">
void connect_peer(asio::ipv4::tcp::endpoint const&amp; adr) const; void connect_peer(asio::ip::tcp::endpoint const&amp; adr) const;
</pre> </pre>
</blockquote> </blockquote>
<p><tt class="docutils literal"><span class="pre">connect_peer()</span></tt> is a way to manually connect to peers that one believe is a part of the <p><tt class="docutils literal"><span class="pre">connect_peer()</span></tt> is a way to manually connect to peers that one believe is a part of the
@ -1647,8 +1648,8 @@ limit.</p>
<h2><a id="set-peer-upload-limit-set-peer-download-limit" name="set-peer-upload-limit-set-peer-download-limit">set_peer_upload_limit() set_peer_download_limit()</a></h2> <h2><a id="set-peer-upload-limit-set-peer-download-limit" name="set-peer-upload-limit-set-peer-download-limit">set_peer_upload_limit() set_peer_download_limit()</a></h2>
<blockquote> <blockquote>
<pre class="literal-block"> <pre class="literal-block">
void set_peer_upload_limit(asio::ipv4::tcp::endpoint ip, int limit) const; void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
void set_peer_download_limit(asio::ipv4::tcp::endpoint ip, int limit) const; void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
</pre> </pre>
</blockquote> </blockquote>
<p>Works like <tt class="docutils literal"><span class="pre">set_upload_limit</span></tt> and <tt class="docutils literal"><span class="pre">set_download_limit</span></tt> respectively, but controls individual <p>Works like <tt class="docutils literal"><span class="pre">set_upload_limit</span></tt> and <tt class="docutils literal"><span class="pre">set_download_limit</span></tt> respectively, but controls individual
@ -2080,7 +2081,7 @@ struct peer_info
queued = 0x100 queued = 0x100
}; };
unsigned int flags; unsigned int flags;
asio::ipv4::tcp::endpoint ip; asio::ip::tcp::endpoint ip;
float up_speed; float up_speed;
float down_speed; float down_speed;
float payload_up_speed; float payload_up_speed;
@ -2259,7 +2260,7 @@ uncompressed (given your limit is lower than 2 megs). Default limit is
<p>The <tt class="docutils literal"><span class="pre">ip_filter</span></tt> class is a set of rules that uniquely categorizes all <p>The <tt class="docutils literal"><span class="pre">ip_filter</span></tt> class is a set of rules that uniquely categorizes all
ip addresses as allowed or disallowed. The default constructor creates ip addresses as allowed or disallowed. The default constructor creates
a single rule that allowes all addresses (0.0.0.0 - 255.255.255.255). a single rule that allowes all addresses (0.0.0.0 - 255.255.255.255).
The <tt class="docutils literal"><span class="pre">address</span></tt> type here is <tt class="docutils literal"><span class="pre">asio::ipv4::address</span></tt>. It can also be The <tt class="docutils literal"><span class="pre">address</span></tt> type here is <tt class="docutils literal"><span class="pre">asio::ip::address_v4</span></tt>. It can also be
accessed as <tt class="docutils literal"><span class="pre">libtorrent::address</span></tt>.</p> accessed as <tt class="docutils literal"><span class="pre">libtorrent::address</span></tt>.</p>
<blockquote> <blockquote>
<pre class="literal-block"> <pre class="literal-block">
@ -2736,12 +2737,12 @@ to the torrent that this peer was a member of.</p>
struct peer_ban_alert: alert struct peer_ban_alert: alert
{ {
peer_ban_alert( peer_ban_alert(
asio::ipv4::tcp::endpoint const&amp; pip asio::ip::tcp::endpoint const&amp; pip
, torrent_handle h , torrent_handle h
, const std::string&amp; msg); , const std::string&amp; msg);
virtual std::auto_ptr&lt;alert&gt; clone() const; virtual std::auto_ptr&lt;alert&gt; clone() const;
asio::ipv4::tcp::endpoint ip; asio::ip::tcp::endpoint ip;
torrent_handle handle; torrent_handle handle;
}; };
</pre> </pre>
@ -2755,12 +2756,12 @@ is generated as severity level <tt class="docutils literal"><span class="pre">de
struct peer_error_alert: alert struct peer_error_alert: alert
{ {
peer_error_alert( peer_error_alert(
asio::ipv4::tcp::endpoint const&amp; pip asio::ip::tcp::endpoint const&amp; pip
, peer_id const&amp; pid , peer_id const&amp; pid
, const std::string&amp; msg); , const std::string&amp; msg);
virtual std::auto_ptr&lt;alert&gt; clone() const; virtual std::auto_ptr&lt;alert&gt; clone() const;
asio::ipv4::tcp::endpoint ip; asio::ip::tcp::endpoint ip;
peer_id id; peer_id id;
}; };
</pre> </pre>
@ -2777,13 +2778,13 @@ struct invalid_request_alert: alert
invalid_request_alert( invalid_request_alert(
peer_request const&amp; r peer_request const&amp; r
, torrent_handle const&amp; h , torrent_handle const&amp; h
, asio::ipv4::tcp::endpoint const&amp; send , asio::ip::tcp::endpoint const&amp; send
, peer_id const&amp; pid , peer_id const&amp; pid
, std::string const&amp; msg); , std::string const&amp; msg);
virtual std::auto_ptr&lt;alert&gt; clone() const; virtual std::auto_ptr&lt;alert&gt; clone() const;
torrent_handle handle; torrent_handle handle;
asio::ipv4::tcp::endpoint ip; asio::ip::tcp::endpoint ip;
peer_request request; peer_request request;
peer_id id; peer_id id;
}; };
@ -3586,6 +3587,7 @@ boost::filesystem::path::default_name_check(boost::filesystem::native);
<h1><a id="acknowledgements" name="acknowledgements">acknowledgements</a></h1> <h1><a id="acknowledgements" name="acknowledgements">acknowledgements</a></h1>
<p>Written by Arvid Norberg. Copyright © 2003-2005</p> <p>Written by Arvid Norberg. Copyright © 2003-2005</p>
<p>Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson</p> <p>Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson</p>
<p>Lots of testing, suggestions and contributions by Massaroddel and Tianhao Qiu.</p>
<p>Big thanks to Michael Wojciechowski and Peter Koeleman for making the autotools <p>Big thanks to Michael Wojciechowski and Peter Koeleman for making the autotools
scripts.</p> scripts.</p>
<p>Thanks to Reimond Retz for bugfixes, suggestions and testing</p> <p>Thanks to Reimond Retz for bugfixes, suggestions and testing</p>

View File

@ -1347,7 +1347,7 @@ Its declaration looks like this::
entry write_resume_data() const; entry write_resume_data() const;
std::vector<char> const& metadata() const; std::vector<char> const& metadata() const;
void force_reannounce() const; void force_reannounce() const;
void connect_peer(asio::ipv4::tcp::endpoint const& adr) const; void connect_peer(asio::ip::tcp::endpoint const& adr) const;
void set_tracker_login(std::string const& username void set_tracker_login(std::string const& username
, std::string const& password) const; , std::string const& password) const;
@ -1363,8 +1363,8 @@ Its declaration looks like this::
void set_upload_limit(int limit) const; void set_upload_limit(int limit) const;
void set_download_limit(int limit) const; void set_download_limit(int limit) const;
void set_peer_upload_limit(asio::ipv4::tcp::endpoint ip, int limit) const; void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
void set_peer_download_limit(asio::ipv4::tcp::endpoint ip, int limit) const; void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
void use_interface(char const* net_interface) const; void use_interface(char const* net_interface) const;
@ -1439,7 +1439,7 @@ connect_peer()
:: ::
void connect_peer(asio::ipv4::tcp::endpoint const& adr) const; void connect_peer(asio::ip::tcp::endpoint const& adr) const;
``connect_peer()`` is a way to manually connect to peers that one believe is a part of the ``connect_peer()`` is a way to manually connect to peers that one believe is a part of the
torrent. If the peer does not respond, or is not a member of this torrent, it will simply torrent. If the peer does not respond, or is not a member of this torrent, it will simply
@ -1485,8 +1485,8 @@ set_peer_upload_limit() set_peer_download_limit()
:: ::
void set_peer_upload_limit(asio::ipv4::tcp::endpoint ip, int limit) const; void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
void set_peer_download_limit(asio::ipv4::tcp::endpoint ip, int limit) const; void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
Works like ``set_upload_limit`` and ``set_download_limit`` respectively, but controls individual Works like ``set_upload_limit`` and ``set_download_limit`` respectively, but controls individual
peer instead of the whole torrent. peer instead of the whole torrent.
@ -1943,7 +1943,7 @@ It contains the following fields::
queued = 0x100 queued = 0x100
}; };
unsigned int flags; unsigned int flags;
asio::ipv4::tcp::endpoint ip; asio::ip::tcp::endpoint ip;
float up_speed; float up_speed;
float down_speed; float down_speed;
float payload_up_speed; float payload_up_speed;
@ -2137,7 +2137,7 @@ ip_filter
The ``ip_filter`` class is a set of rules that uniquely categorizes all The ``ip_filter`` class is a set of rules that uniquely categorizes all
ip addresses as allowed or disallowed. The default constructor creates ip addresses as allowed or disallowed. The default constructor creates
a single rule that allowes all addresses (0.0.0.0 - 255.255.255.255). a single rule that allowes all addresses (0.0.0.0 - 255.255.255.255).
The ``address`` type here is ``asio::ipv4::address``. It can also be The ``address`` type here is ``asio::ip::address_v4``. It can also be
accessed as ``libtorrent::address``. accessed as ``libtorrent::address``.
:: ::
@ -2671,12 +2671,12 @@ to the torrent that this peer was a member of.
struct peer_ban_alert: alert struct peer_ban_alert: alert
{ {
peer_ban_alert( peer_ban_alert(
asio::ipv4::tcp::endpoint const& pip asio::ip::tcp::endpoint const& pip
, torrent_handle h , torrent_handle h
, const std::string& msg); , const std::string& msg);
virtual std::auto_ptr<alert> clone() const; virtual std::auto_ptr<alert> clone() const;
asio::ipv4::tcp::endpoint ip; asio::ip::tcp::endpoint ip;
torrent_handle handle; torrent_handle handle;
}; };
@ -2693,12 +2693,12 @@ is generated as severity level ``debug``.
struct peer_error_alert: alert struct peer_error_alert: alert
{ {
peer_error_alert( peer_error_alert(
asio::ipv4::tcp::endpoint const& pip asio::ip::tcp::endpoint const& pip
, peer_id const& pid , peer_id const& pid
, const std::string& msg); , const std::string& msg);
virtual std::auto_ptr<alert> clone() const; virtual std::auto_ptr<alert> clone() const;
asio::ipv4::tcp::endpoint ip; asio::ip::tcp::endpoint ip;
peer_id id; peer_id id;
}; };
@ -2718,13 +2718,13 @@ is a handle to the torrent the peer is a member of. ``
invalid_request_alert( invalid_request_alert(
peer_request const& r peer_request const& r
, torrent_handle const& h , torrent_handle const& h
, asio::ipv4::tcp::endpoint const& send , asio::ip::tcp::endpoint const& send
, peer_id const& pid , peer_id const& pid
, std::string const& msg); , std::string const& msg);
virtual std::auto_ptr<alert> clone() const; virtual std::auto_ptr<alert> clone() const;
torrent_handle handle; torrent_handle handle;
asio::ipv4::tcp::endpoint ip; asio::ip::tcp::endpoint ip;
peer_request request; peer_request request;
peer_id id; peer_id id;
}; };
@ -3507,6 +3507,8 @@ Written by Arvid Norberg. Copyright |copy| 2003-2005
Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson Contributions by Magnus Jonsson, Daniel Wallin and Cory Nelson
Lots of testing, suggestions and contributions by Massaroddel and Tianhao Qiu.
Big thanks to Michael Wojciechowski and Peter Koeleman for making the autotools Big thanks to Michael Wojciechowski and Peter Koeleman for making the autotools
scripts. scripts.

View File

@ -3,10 +3,130 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.8: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>Bittorrent udp-tracker protocol extension</title> <title>Bittorrent udp-tracker protocol extension</title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" /> <meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com" />
<link rel="stylesheet" href="style.css" type="text/css" /> <style type="text/css">
body
{
background-color: white;
color: black;
margin: 1em 2em 1em 2em;
}
h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; font-size: 140%; }
h2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; font-size: 110%; }
h3 { font-family: "courier new", courier, monospace; font-weight: bold; text-align: left; font-size: 100%; }
pre
{
border: gray 1pt solid;
padding: 2pt;
display: block;
font-family: "courier new", courier, monospace;
background-color: #eeeeee;
color: black;
font-size: small
}
code
{
white-space: pre;
border: gray 1pt solid;
padding: 2pt;
display: block;
font-family: "courier new", courier, monospace;
color: black;
font-size: small
}
tt
{
display: inline;
font-family: "Courier New", Courier, monospace;
}
p
{
text-align: justify;
font-family: Georgia, "Times New Roman", Times, serif
}
ul
{
font-family: Georgia, "Times New Roman", Times, serif
}
ol
{
font-family: Georgia, "Times New Roman", Times, serif
}
a:link
{
font-weight: bold;
color: #003366;
text-decoration: none;
}
a:visited
{
font-weight: bold;
color: #003366;
text-decoration: none;
}
table
{
border: 1px solid black;
border-collapse: collapse;
}
table td
{
padding: 6px;
}
table th
{
border: 3px solid black;
padding: 6px;
}
table.menu
{
border-style: none;
}
table.menu td
{
padding-left: 15px;
padding-right: 15px;
padding-top: 7px;
padding-bottom: 7px;
}
td
{
border: 1px solid black
}
div.warning, div.note, div.important {
width: 80%;
margin: 1.5em auto;
background: #C1E5F6;
background: #F1FFF5;
border: solid 1px #D1DFD5;
padding: 5px 10px 5px 10px;
}
</style>
</head> </head>
<body> <body>
<div class="document" id="bittorrent-udp-tracker-protocol-extension"> <div class="document" id="bittorrent-udp-tracker-protocol-extension">
@ -19,8 +139,8 @@
<td>Arvid Norberg, <a class="last reference" href="mailto:arvid&#64;rasterbar.com">arvid&#64;rasterbar.com</a></td></tr> <td>Arvid Norberg, <a class="last reference" href="mailto:arvid&#64;rasterbar.com">arvid&#64;rasterbar.com</a></td></tr>
</tbody> </tbody>
</table> </table>
<div class="contents topic" id="table-of-contents"> <div class="contents topic">
<p class="topic-title first"><a name="table-of-contents">Table of contents</a></p> <p class="topic-title first"><a id="table-of-contents" name="table-of-contents">Table of contents</a></p>
<ul class="simple"> <ul class="simple">
<li><a class="reference" href="#introduction" id="id2" name="id2">introduction</a></li> <li><a class="reference" href="#introduction" id="id2" name="id2">introduction</a></li>
<li><a class="reference" href="#connecting" id="id3" name="id3">connecting</a></li> <li><a class="reference" href="#connecting" id="id3" name="id3">connecting</a></li>
@ -35,8 +155,8 @@
<li><a class="reference" href="#credits" id="id10" name="id10">credits</a></li> <li><a class="reference" href="#credits" id="id10" name="id10">credits</a></li>
</ul> </ul>
</div> </div>
<div class="section" id="introduction"> <div class="section">
<h1><a name="introduction">introduction</a></h1> <h1><a id="introduction" name="introduction">introduction</a></h1>
<p>A tracker with the protocol &quot;udp://&quot; in its URI <p>A tracker with the protocol &quot;udp://&quot; in its URI
is supposed to be contacted using this protocol.</p> is supposed to be contacted using this protocol.</p>
<p>This protocol is supported by <p>This protocol is supported by
@ -50,8 +170,8 @@ are specified with ANSI-C standard types.</p>
the request. If no reply has been received after 60 seconds, stop the request. If no reply has been received after 60 seconds, stop
retrying.</p> retrying.</p>
</div> </div>
<div class="section" id="connecting"> <div class="section">
<h1><a name="connecting">connecting</a></h1> <h1><a id="connecting" name="connecting">connecting</a></h1>
<p>Client sends packet:</p> <p>Client sends packet:</p>
<table border="1" class="docutils"> <table border="1" class="docutils">
<colgroup> <colgroup>
@ -60,9 +180,9 @@ retrying.</p>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -90,9 +210,9 @@ identify the protocol.</td>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -120,8 +240,8 @@ anymore.</td>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="section" id="announcing"> <div class="section">
<h1><a name="announcing">announcing</a></h1> <h1><a id="announcing" name="announcing">announcing</a></h1>
<p>Client sends packet:</p> <p>Client sends packet:</p>
<table border="1" class="docutils"> <table border="1" class="docutils">
<colgroup> <colgroup>
@ -130,9 +250,9 @@ anymore.</td>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -221,9 +341,9 @@ in the reply. Use -1 for default.</td>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -265,9 +385,9 @@ seeding.</td>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -282,8 +402,8 @@ seeding.</td>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="section" id="scraping"> <div class="section">
<h1><a name="scraping">scraping</a></h1> <h1><a id="scraping" name="scraping">scraping</a></h1>
<p>Client sends packet:</p> <p>Client sends packet:</p>
<table border="1" class="docutils"> <table border="1" class="docutils">
<colgroup> <colgroup>
@ -292,9 +412,9 @@ seeding.</td>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -331,9 +451,9 @@ follow.</td>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -351,9 +471,9 @@ follow.</td>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -378,9 +498,9 @@ you asked in the scrape request.</p>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -401,8 +521,8 @@ leechers.</td>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="section" id="errors"> <div class="section">
<h1><a name="errors">errors</a></h1> <h1><a id="errors" name="errors">errors</a></h1>
<p>In case of a tracker error,</p> <p>In case of a tracker error,</p>
<p>server replies packet:</p> <p>server replies packet:</p>
<table border="1" class="docutils"> <table border="1" class="docutils">
@ -412,9 +532,9 @@ leechers.</td>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -436,8 +556,8 @@ describing the error.</td>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="section" id="actions"> <div class="section">
<h1><a name="actions">actions</a></h1> <h1><a id="actions" name="actions">actions</a></h1>
<p>The action fields has the following encoding:</p> <p>The action fields has the following encoding:</p>
<blockquote> <blockquote>
<ul class="simple"> <ul class="simple">
@ -448,8 +568,8 @@ describing the error.</td>
</ul> </ul>
</blockquote> </blockquote>
</div> </div>
<div class="section" id="extensions"> <div class="section">
<h1><a name="extensions">extensions</a></h1> <h1><a id="extensions" name="extensions">extensions</a></h1>
<p>The extensions field is a bitmask. The following <p>The extensions field is a bitmask. The following
bits are assigned:</p> bits are assigned:</p>
<blockquote> <blockquote>
@ -457,8 +577,8 @@ bits are assigned:</p>
<li>1 = <a class="reference" href="#authentication">authentication</a>.</li> <li>1 = <a class="reference" href="#authentication">authentication</a>.</li>
</ul> </ul>
</blockquote> </blockquote>
<div class="section" id="authentication"> <div class="section">
<h2><a name="authentication">authentication</a></h2> <h2><a id="authentication" name="authentication">authentication</a></h2>
<p>The packet will have an authentication part <p>The packet will have an authentication part
appended to it. It has the following format:</p> appended to it. It has the following format:</p>
<table border="1" class="docutils"> <table border="1" class="docutils">
@ -468,9 +588,9 @@ appended to it. It has the following format:</p>
<col width="54%" /> <col width="54%" />
</colgroup> </colgroup>
<thead valign="bottom"> <thead valign="bottom">
<tr><th>size</th> <tr><th class="head">size</th>
<th>name</th> <th class="head">name</th>
<th>description</th> <th class="head">description</th>
</tr> </tr>
</thead> </thead>
<tbody valign="top"> <tbody valign="top">
@ -497,8 +617,8 @@ from the 20 bytes hash calculated.</td>
</table> </table>
</div> </div>
</div> </div>
<div class="section" id="credits"> <div class="section">
<h1><a name="credits">credits</a></h1> <h1><a id="credits" name="credits">credits</a></h1>
<p>Protocol designed by Olaf van der Spek</p> <p>Protocol designed by Olaf van der Spek</p>
</div> </div>
</div> </div>

View File

@ -375,7 +375,7 @@ namespace libtorrent
} }
#endif #endif
tcp::resolver::query q(*connect_to_host); tcp::resolver::query q(*connect_to_host, "http");
m_name_lookup.async_resolve(q m_name_lookup.async_resolve(q
, boost::bind(&http_tracker_connection::name_lookup, self(), _1, _2)); , boost::bind(&http_tracker_connection::name_lookup, self(), _1, _2));
set_timeout(m_settings.tracker_completion_timeout set_timeout(m_settings.tracker_completion_timeout
@ -415,7 +415,7 @@ namespace libtorrent
{ {
assert(false); assert(false);
fail(-1, e.what()); fail(-1, e.what());
} };
void http_tracker_connection::connected(asio::error const& error) try void http_tracker_connection::connected(asio::error const& error) try
{ {

View File

@ -938,7 +938,7 @@ namespace libtorrent
= parse_url_components(url); = parse_url_components(url);
m_resolving_web_seeds.insert(url); m_resolving_web_seeds.insert(url);
tcp::resolver::query q(hostname); tcp::resolver::query q(hostname, "http");
m_host_resolver.async_resolve(q, bind(&torrent::on_name_lookup m_host_resolver.async_resolve(q, bind(&torrent::on_name_lookup
, shared_from_this(), _1, _2, port, url)); , shared_from_this(), _1, _2, port, url));

View File

@ -90,7 +90,7 @@ namespace libtorrent
, m_attempts(0) , m_attempts(0)
{ {
m_socket.reset(new datagram_socket(d)); m_socket.reset(new datagram_socket(d));
tcp::resolver::query q(hostname.c_str()); tcp::resolver::query q(hostname, "http");
m_name_lookup.async_resolve(q m_name_lookup.async_resolve(q
, boost::bind(&udp_tracker_connection::name_lookup, self(), _1, _2)); , boost::bind(&udp_tracker_connection::name_lookup, self(), _1, _2));
set_timeout(m_settings.tracker_completion_timeout set_timeout(m_settings.tracker_completion_timeout
@ -121,7 +121,7 @@ namespace libtorrent
{ {
fail(-1, e.what()); fail(-1, e.what());
assert(false); assert(false);
} };
void udp_tracker_connection::on_timeout() void udp_tracker_connection::on_timeout()
{ {