merged ban_web_seed setting patch from RC_0_16

This commit is contained in:
Arvid Norberg 2012-04-11 03:25:09 +00:00
parent bd046bbf4a
commit 9f0e892228
5 changed files with 24 additions and 7 deletions

View File

@ -4301,6 +4301,8 @@ struct session_settings
int ssl_listen;
int tracker_backoff;
bool ban_web_seeds;
};
</pre>
<p><tt class="docutils literal"><span class="pre">version</span></tt> is automatically set to the libtorrent version you're using
@ -5047,6 +5049,8 @@ delay = 5 + 5 * x / 100 * fails^2</blockquote>
<p>It defaults to 250.</p>
<p>This setting may be useful to make libtorrent more or less aggressive in hitting
trackers.</p>
<p><tt class="docutils literal"><span class="pre">ban_web_seeds</span></tt> enables banning web seeds. By default, web seeds that send
corrupt data are banned.</p>
</div>
</div>
<div class="section" id="pe-settings">
@ -6258,7 +6262,7 @@ struct peer_disconnected_alert: peer_alert
<div class="section" id="invalid-request-alert">
<h2>invalid_request_alert</h2>
<p>This is a debug alert that is generated by an incoming invalid piece request.
<tt class="docutils literal"><span class="pre">ìp</span></tt> is the address of the peer and the <tt class="docutils literal"><span class="pre">request</span></tt> is the actual incoming
<tt class="docutils literal"><span class="pre">Ïp</span></tt> is the address of the peer and the <tt class="docutils literal"><span class="pre">request</span></tt> is the actual incoming
request from the peer.</p>
<pre class="literal-block">
struct invalid_request_alert: peer_alert
@ -7845,13 +7849,13 @@ std::string error_code_to_string(boost::system::error_code const&amp; ec)
static const char const* swedish[] =
{
&quot;inget fel&quot;,
&quot;en fil i torrenten kolliderar med en fil från en annan torrent&quot;,
&quot;en fil i torrenten kolliderar med en fil frÂn en annan torrent&quot;,
&quot;hash check misslyckades&quot;,
&quot;torrent filen är inte en dictionary&quot;,
&quot;'info'-nyckeln saknas eller är korrupt i torrentfilen&quot;,
&quot;'info'-fältet är inte en dictionary&quot;,
&quot;'piece length' fältet saknas eller är korrupt i torrentfilen&quot;,
&quot;torrentfilen saknar namnfältet&quot;,
&quot;torrent filen r inte en dictionary&quot;,
&quot;'info'-nyckeln saknas eller r korrupt i torrentfilen&quot;,
&quot;'info'-f‰ltet ‰r inte en dictionary&quot;,
&quot;'piece length' f‰ltet saknas eller ‰r korrupt i torrentfilen&quot;,
&quot;torrentfilen saknar namnfltet&quot;,
&quot;ogiltigt namn i torrentfilen (kan vara en attack)&quot;,
// ... more strings here
};

View File

@ -4558,6 +4558,8 @@ session_settings
int ssl_listen;
int tracker_backoff;
bool ban_web_seeds;
};
``version`` is automatically set to the libtorrent version you're using
@ -5455,6 +5457,9 @@ It defaults to 250.
This setting may be useful to make libtorrent more or less aggressive in hitting
trackers.
``ban_web_seeds`` enables banning web seeds. By default, web seeds that send
corrupt data are banned.
pe_settings
===========

View File

@ -927,6 +927,9 @@ namespace libtorrent
// determines how fast the back-off happens. Default
// is 250
int tracker_backoff;
// when true, web seeds sending bad data will be banned
bool ban_web_seeds;
};
#ifndef TORRENT_DISABLE_DHT

View File

@ -564,6 +564,10 @@ namespace libtorrent
INVARIANT_CHECK;
TORRENT_ASSERT(p->in_use);
if (!m_torrent->settings().ban_web_seeds && p->web_seed)
return;
if (is_connect_candidate(*p, m_finished))
--m_num_connect_candidates;

View File

@ -1277,6 +1277,7 @@ namespace libtorrent
, lock_files(false)
, ssl_listen(4433)
, tracker_backoff(250)
, ban_web_seeds(true)
{}
session_settings::~session_settings() {}