added a setting for max outstanding requests, and a limit for BitComet since it's known to have a very low limit, also added an extension header to specify it. Fixed another unnecessary delay spotted by Tianhao Qiu. Cleaned up the logging class a bit. Fixed a bug that would cause an assert when removing a torrent queued for checking.

This commit is contained in:
Arvid Norberg
2006-05-14 22:30:05 +00:00
parent 73b1c5c9b8
commit 0b529e8f96
18 changed files with 318 additions and 124 deletions

View File

@@ -3,10 +3,130 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.9: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title></title>
<meta name="author" content="Arvid Norberg, arvid&#64;rasterbar.com Ludvig Strigeus, ludde&#64;utorrent.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>
<body>
<div class="document">
@@ -19,8 +139,8 @@
Ludvig Strigeus, <a class="last reference" href="mailto:ludde&#64;utorrent.com">ludde&#64;utorrent.com</a></td></tr>
</tbody>
</table>
<div class="section" id="extension-protocol-for-bittorrent">
<h1><a name="extension-protocol-for-bittorrent">extension protocol for bittorrent</a></h1>
<div class="section">
<h1><a id="extension-protocol-for-bittorrent" name="extension-protocol-for-bittorrent">extension protocol for bittorrent</a></h1>
<p>The intention of this protocol is to provide a simple and thin transport
for extensions to the bittorrent protocol. Supporting this protocol makes
it easy to add new extensions without interfering with the standard
@@ -88,8 +208,8 @@ message as specified by the handshake.</td>
</tr>
</tbody>
</table>
<div class="section" id="handshake-message">
<h2><a name="handshake-message">handshake message</a></h2>
<div class="section">
<h2><a id="handshake-message" name="handshake-message">handshake message</a></h2>
<p>The payload of the handshake message is a bencoded dictionary. All items
in the dictionary are optional. Any unknown names should be ignored
by the client. All parts of the dictionary are case sensitive.
@@ -140,6 +260,11 @@ known.</td>
This is a much more reliable way of identifying the
client than relying on the peer id encoding.</td>
</tr>
<tr><td>reqq</td>
<td>An integer, the number of outstanding request messages
this client supports without dropping any. The default in
in libtorrent is 250.</td>
</tr>
</tbody>
</table>
<p>The handshake dictionary could also include extended handshake
@@ -214,8 +339,8 @@ for the actual extensions to the bittorrent protocol and the extensions
named in the example above (such as <tt class="docutils literal"><span class="pre">p</span></tt>) are just examples of possible
extensions.</p>
</div>
<div class="section" id="rationale">
<h2><a name="rationale">rationale</a></h2>
<div class="section">
<h2><a id="rationale" name="rationale">rationale</a></h2>
<p>The reason why the extension messages' IDs would be defined in the handshake
is to avoid having a global registry somewhere, where ID's are assigned
global identifiers. Now the extensions have unique names.</p>

View File

@@ -87,6 +87,10 @@ Here are two other items that an implementation may choose to support:
| | This is a much more reliable way of identifying the |
| | client than relying on the peer id encoding. |
+-------+-----------------------------------------------------------+
| reqq | An integer, the number of outstanding request messages |
| | this client supports without dropping any. The default in |
| | in libtorrent is 250. |
+-------+-----------------------------------------------------------+
The handshake dictionary could also include extended handshake
information, such as support for encrypted headers or anything

View File

@@ -229,60 +229,61 @@ div.warning, div.note, div.important {
<li><a class="reference" href="#fingerprint" id="id96" name="id96">fingerprint</a></li>
<li><a class="reference" href="#free-functions" id="id97" name="id97">free functions</a><ul>
<li><a class="reference" href="#identify-client" id="id98" name="id98">identify_client()</a></li>
<li><a class="reference" href="#bdecode-bencode" id="id99" name="id99">bdecode() bencode()</a></li>
<li><a class="reference" href="#client-fingerprint" id="id99" name="id99">client_fingerprint()</a></li>
<li><a class="reference" href="#bdecode-bencode" id="id100" name="id100">bdecode() bencode()</a></li>
</ul>
</li>
<li><a class="reference" href="#alerts" id="id100" name="id100">alerts</a><ul>
<li><a class="reference" href="#listen-failed-alert" id="id101" name="id101">listen_failed_alert</a></li>
<li><a class="reference" href="#file-error-alert" id="id102" name="id102">file_error_alert</a></li>
<li><a class="reference" href="#tracker-announce-alert" id="id103" name="id103">tracker_announce_alert</a></li>
<li><a class="reference" href="#tracker-alert" id="id104" name="id104">tracker_alert</a></li>
<li><a class="reference" href="#tracker-reply-alert" id="id105" name="id105">tracker_reply_alert</a></li>
<li><a class="reference" href="#tracker-warning-alert" id="id106" name="id106">tracker_warning_alert</a></li>
<li><a class="reference" href="#url-seed-alert" id="id107" name="id107">url_seed_alert</a></li>
<li><a class="reference" href="#hash-failed-alert" id="id108" name="id108">hash_failed_alert</a></li>
<li><a class="reference" href="#peer-ban-alert" id="id109" name="id109">peer_ban_alert</a></li>
<li><a class="reference" href="#peer-error-alert" id="id110" name="id110">peer_error_alert</a></li>
<li><a class="reference" href="#invalid-request-alert" id="id111" name="id111">invalid_request_alert</a></li>
<li><a class="reference" href="#torrent-finished-alert" id="id112" name="id112">torrent_finished_alert</a></li>
<li><a class="reference" href="#metadata-failed-alert" id="id113" name="id113">metadata_failed_alert</a></li>
<li><a class="reference" href="#metadata-received-alert" id="id114" name="id114">metadata_received_alert</a></li>
<li><a class="reference" href="#fastresume-rejected-alert" id="id115" name="id115">fastresume_rejected_alert</a></li>
<li><a class="reference" href="#dispatcher" id="id116" name="id116">dispatcher</a></li>
<li><a class="reference" href="#alerts" id="id101" name="id101">alerts</a><ul>
<li><a class="reference" href="#listen-failed-alert" id="id102" name="id102">listen_failed_alert</a></li>
<li><a class="reference" href="#file-error-alert" id="id103" name="id103">file_error_alert</a></li>
<li><a class="reference" href="#tracker-announce-alert" id="id104" name="id104">tracker_announce_alert</a></li>
<li><a class="reference" href="#tracker-alert" id="id105" name="id105">tracker_alert</a></li>
<li><a class="reference" href="#tracker-reply-alert" id="id106" name="id106">tracker_reply_alert</a></li>
<li><a class="reference" href="#tracker-warning-alert" id="id107" name="id107">tracker_warning_alert</a></li>
<li><a class="reference" href="#url-seed-alert" id="id108" name="id108">url_seed_alert</a></li>
<li><a class="reference" href="#hash-failed-alert" id="id109" name="id109">hash_failed_alert</a></li>
<li><a class="reference" href="#peer-ban-alert" id="id110" name="id110">peer_ban_alert</a></li>
<li><a class="reference" href="#peer-error-alert" id="id111" name="id111">peer_error_alert</a></li>
<li><a class="reference" href="#invalid-request-alert" id="id112" name="id112">invalid_request_alert</a></li>
<li><a class="reference" href="#torrent-finished-alert" id="id113" name="id113">torrent_finished_alert</a></li>
<li><a class="reference" href="#metadata-failed-alert" id="id114" name="id114">metadata_failed_alert</a></li>
<li><a class="reference" href="#metadata-received-alert" id="id115" name="id115">metadata_received_alert</a></li>
<li><a class="reference" href="#fastresume-rejected-alert" id="id116" name="id116">fastresume_rejected_alert</a></li>
<li><a class="reference" href="#dispatcher" id="id117" name="id117">dispatcher</a></li>
</ul>
</li>
<li><a class="reference" href="#exceptions" id="id117" name="id117">exceptions</a><ul>
<li><a class="reference" href="#invalid-handle" id="id118" name="id118">invalid_handle</a></li>
<li><a class="reference" href="#duplicate-torrent" id="id119" name="id119">duplicate_torrent</a></li>
<li><a class="reference" href="#invalid-encoding" id="id120" name="id120">invalid_encoding</a></li>
<li><a class="reference" href="#type-error" id="id121" name="id121">type_error</a></li>
<li><a class="reference" href="#invalid-torrent-file" id="id122" name="id122">invalid_torrent_file</a></li>
<li><a class="reference" href="#exceptions" id="id118" name="id118">exceptions</a><ul>
<li><a class="reference" href="#invalid-handle" id="id119" name="id119">invalid_handle</a></li>
<li><a class="reference" href="#duplicate-torrent" id="id120" name="id120">duplicate_torrent</a></li>
<li><a class="reference" href="#invalid-encoding" id="id121" name="id121">invalid_encoding</a></li>
<li><a class="reference" href="#type-error" id="id122" name="id122">type_error</a></li>
<li><a class="reference" href="#invalid-torrent-file" id="id123" name="id123">invalid_torrent_file</a></li>
</ul>
</li>
<li><a class="reference" href="#examples" id="id123" name="id123">examples</a><ul>
<li><a class="reference" href="#dump-torrent" id="id124" name="id124">dump_torrent</a></li>
<li><a class="reference" href="#simple-client" id="id125" name="id125">simple client</a></li>
<li><a class="reference" href="#make-torrent" id="id126" name="id126">make_torrent</a></li>
<li><a class="reference" href="#examples" id="id124" name="id124">examples</a><ul>
<li><a class="reference" href="#dump-torrent" id="id125" name="id125">dump_torrent</a></li>
<li><a class="reference" href="#simple-client" id="id126" name="id126">simple client</a></li>
<li><a class="reference" href="#make-torrent" id="id127" name="id127">make_torrent</a></li>
</ul>
</li>
<li><a class="reference" href="#fast-resume" id="id127" name="id127">fast resume</a><ul>
<li><a class="reference" href="#file-format" id="id128" name="id128">file format</a></li>
<li><a class="reference" href="#fast-resume" id="id128" name="id128">fast resume</a><ul>
<li><a class="reference" href="#file-format" id="id129" name="id129">file format</a></li>
</ul>
</li>
<li><a class="reference" href="#threads" id="id129" name="id129">threads</a></li>
<li><a class="reference" href="#storage-allocation" id="id130" name="id130">storage allocation</a><ul>
<li><a class="reference" href="#full-allocation" id="id131" name="id131">full allocation</a></li>
<li><a class="reference" href="#compact-allocation" id="id132" name="id132">compact allocation</a></li>
<li><a class="reference" href="#threads" id="id130" name="id130">threads</a></li>
<li><a class="reference" href="#storage-allocation" id="id131" name="id131">storage allocation</a><ul>
<li><a class="reference" href="#full-allocation" id="id132" name="id132">full allocation</a></li>
<li><a class="reference" href="#compact-allocation" id="id133" name="id133">compact allocation</a></li>
</ul>
</li>
<li><a class="reference" href="#extensions" id="id133" name="id133">extensions</a><ul>
<li><a class="reference" href="#chat-messages" id="id134" name="id134">chat messages</a></li>
<li><a class="reference" href="#metadata-from-peers" id="id135" name="id135">metadata from peers</a></li>
<li><a class="reference" href="#http-seeding" id="id136" name="id136">HTTP seeding</a></li>
<li><a class="reference" href="#extensions" id="id134" name="id134">extensions</a><ul>
<li><a class="reference" href="#chat-messages" id="id135" name="id135">chat messages</a></li>
<li><a class="reference" href="#metadata-from-peers" id="id136" name="id136">metadata from peers</a></li>
<li><a class="reference" href="#http-seeding" id="id137" name="id137">HTTP seeding</a></li>
</ul>
</li>
<li><a class="reference" href="#filename-checks" id="id137" name="id137">filename checks</a></li>
<li><a class="reference" href="#acknowledgements" id="id138" name="id138">acknowledgements</a></li>
<li><a class="reference" href="#filename-checks" id="id138" name="id138">filename checks</a></li>
<li><a class="reference" href="#acknowledgements" id="id139" name="id139">acknowledgements</a></li>
</ul>
</div>
<div class="section">
@@ -2459,6 +2460,18 @@ to extract a string describing a client version from its peer-id. It will recogn
that have this kind of identification in the peer-id.</p>
</div>
<div class="section">
<h2><a id="client-fingerprint" name="client-fingerprint">client_fingerprint()</a></h2>
<blockquote>
<pre class="literal-block">
boost::optional&lt;fingerprint&gt; client_fingerprint(peer_id const&amp; p);
</pre>
</blockquote>
<p>Returns an optional fingerprint if any can be identified from the peer id. This can be used
to automate the identification of clients. It will not be able to identifiy peers with non-
standard encodings. Only Azureus style, Shadow's style and Mainline style. This function is
declared in the header <tt class="docutils literal"><span class="pre">&lt;libtorrent/identify_client.hpp&gt;</span></tt>.</p>
</div>
<div class="section">
<h2><a id="bdecode-bencode" name="bdecode-bencode">bdecode() bencode()</a></h2>
<blockquote>
<pre class="literal-block">

View File

@@ -2346,6 +2346,20 @@ This function is declared in the header ``<libtorrent/identify_client.hpp>``. It
to extract a string describing a client version from its peer-id. It will recognize most clients
that have this kind of identification in the peer-id.
client_fingerprint()
--------------------
::
boost::optional<fingerprint> client_fingerprint(peer_id const& p);
Returns an optional fingerprint if any can be identified from the peer id. This can be used
to automate the identification of clients. It will not be able to identifiy peers with non-
standard encodings. Only Azureus style, Shadow's style and Mainline style. This function is
declared in the header ``<libtorrent/identify_client.hpp>``.
bdecode() bencode()
-------------------