forked from premiere/premiere-libtorrent
added new logging mode to log peer errors
This commit is contained in:
parent
92f4947bbe
commit
a53473a65d
3
Jamfile
3
Jamfile
|
@ -161,8 +161,9 @@ feature.compose <disk-stats>on : <define>TORRENT_DISK_STATS ;
|
|||
feature memdebug : off on : composite propagated ;
|
||||
feature.compose <memdebug>on : <define>TORRENT_MEMDEBUG ;
|
||||
|
||||
feature logging : none default verbose : composite propagated link-incompatible ;
|
||||
feature logging : none default errors verbose : composite propagated link-incompatible ;
|
||||
feature.compose <logging>default : <define>TORRENT_LOGGING ;
|
||||
feature.compose <logging>errors : <define>TORRENT_ERRORLOGGING ;
|
||||
feature.compose <logging>verbose : <define>TORRENT_VERBOSE_LOGGING ;
|
||||
|
||||
feature dht-support : on off logging : composite propagated link-incompatible ;
|
||||
|
|
|
@ -205,6 +205,7 @@ boost directory.</li>
|
|||
<li><tt class="docutils literal"><span class="pre">none</span></tt> - no logging.</li>
|
||||
<li><tt class="docutils literal"><span class="pre">default</span></tt> - basic session logging.</li>
|
||||
<li><tt class="docutils literal"><span class="pre">verbose</span></tt> - verbose peer wire logging.</li>
|
||||
<li><tt class="docutils literal"><span class="pre">errors</span></tt> - like verbose, but limited to errors.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -209,6 +209,7 @@ Build features:
|
|||
| ``logging`` | * ``none`` - no logging. |
|
||||
| | * ``default`` - basic session logging. |
|
||||
| | * ``verbose`` - verbose peer wire logging. |
|
||||
| | * ``errors`` - like verbose, but limited to errors.|
|
||||
+------------------------+----------------------------------------------------+
|
||||
| ``dht-support`` | * ``on`` - build with support for tracker less |
|
||||
| | torrents and DHT support. |
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
<li><a class="reference" href="#name" id="id71" name="id71">name()</a></li>
|
||||
<li><a class="reference" href="#set-ratio" id="id72" name="id72">set_ratio()</a></li>
|
||||
<li><a class="reference" href="#set-upload-limit-set-download-limit-upload-limit-download-limit" id="id73" name="id73">set_upload_limit() set_download_limit() upload_limit() download_limit()</a></li>
|
||||
<li><a class="reference" href="#set-sequenced-download-threshold" id="id74" name="id74">set_sequenced_download_threshold()</a></li>
|
||||
<li><a class="reference" href="#set-sequential-download" id="id74" name="id74">set_sequential_download()</a></li>
|
||||
<li><a class="reference" href="#set-peer-upload-limit-set-peer-download-limit" id="id75" name="id75">set_peer_upload_limit() set_peer_download_limit()</a></li>
|
||||
<li><a class="reference" href="#pause-resume-is-paused" id="id76" name="id76">pause() resume() is_paused()</a></li>
|
||||
<li><a class="reference" href="#resolve-countries" id="id77" name="id77">resolve_countries()</a></li>
|
||||
|
@ -1484,7 +1484,7 @@ struct torrent_handle
|
|||
int upload_limit() const;
|
||||
void set_download_limit(int limit) const;
|
||||
int download_limit() const;
|
||||
void set_sequenced_download_threshold(int threshold) const;
|
||||
void set_sequential_download(bool sd) const;
|
||||
|
||||
void set_peer_upload_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
||||
void set_peer_download_limit(asio::ip::tcp::endpoint ip, int limit) const;
|
||||
|
@ -1705,22 +1705,16 @@ limit.</p>
|
|||
download, respectively.</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h2><a id="set-sequenced-download-threshold" name="set-sequenced-download-threshold">set_sequenced_download_threshold()</a></h2>
|
||||
<h2><a id="set-sequential-download" name="set-sequential-download">set_sequential_download()</a></h2>
|
||||
<blockquote>
|
||||
<pre class="literal-block">
|
||||
void set_sequenced_download_threshold(int threshold);
|
||||
void set_sequential_download(bool sd);
|
||||
</pre>
|
||||
</blockquote>
|
||||
<p>sequenced-download threshold is the limit on how popular a piece has to be
|
||||
(popular == inverse of rarity) to be downloaded in sequence instead of in
|
||||
random (rarest first) order. It can be used to tweak disk performance in
|
||||
settings where the random download property is less necessary. For example, if
|
||||
the threshold is 10, all pieces which 10 or more peers have, will be downloaded
|
||||
in index order. This setting defaults to 100, which means that it is disabled
|
||||
in practice.</p>
|
||||
<p>Setting this threshold to a very small value will affect the piece distribution
|
||||
negatively in the swarm. It should basically only be used in situations where
|
||||
the random seeks on the disk is the download bottleneck.</p>
|
||||
<p>Enables or disables <em>sequential download</em>. When enabled, the piece picker will pick pieces in sequence
|
||||
instead of rarest first.</p>
|
||||
<p>Enabling sequential download will affect the piece distribution negatively in the swarm. It should be
|
||||
used sparingly.</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<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>
|
||||
|
|
|
@ -312,18 +312,10 @@ scrape. See <a class="reference" href="#actions">actions</a>.</td>
|
|||
<td>transaction_id</td>
|
||||
<td>Randomized by client.</td>
|
||||
</tr>
|
||||
<tr><td>int16_t</td>
|
||||
<td>num_info_hashes</td>
|
||||
<td>The number of info-hashes that will
|
||||
follow.</td>
|
||||
</tr>
|
||||
<tr><td>uint16_t</td>
|
||||
<td>extensions</td>
|
||||
<td>Optional field. See <a class="reference" href="#extensions">extensions</a>.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The following structure is repeated <tt class="docutils literal"><span class="pre">num_info_hashes</span></tt> times:</p>
|
||||
<p>The following structure is repeated for each info-hash to scrape, but limited by
|
||||
the MTU.</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="18%" />
|
||||
|
|
|
@ -286,7 +286,7 @@ namespace libtorrent
|
|||
|
||||
int desired_queue_size() const { return m_desired_queue_size; }
|
||||
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
boost::shared_ptr<logger> m_logger;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace libtorrent
|
|||
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
|
||||
std::fill(m_country, m_country + 2, 0);
|
||||
#endif
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
m_logger = m_ses.create_log(m_remote.address().to_string() + "_"
|
||||
+ boost::lexical_cast<std::string>(m_remote.port()), m_ses.listen_port());
|
||||
(*m_logger) << "*** OUTGOING CONNECTION\n";
|
||||
|
@ -224,7 +224,7 @@ namespace libtorrent
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
TORRENT_ASSERT(m_socket->remote_endpoint() == remote() || ec);
|
||||
m_logger = m_ses.create_log(remote().address().to_string(ec) + "_"
|
||||
+ boost::lexical_cast<std::string>(remote().port()), m_ses.listen_port());
|
||||
|
@ -400,7 +400,7 @@ namespace libtorrent
|
|||
TORRENT_ASSERT(!m_in_constructor);
|
||||
TORRENT_ASSERT(m_disconnecting);
|
||||
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
if (m_logger)
|
||||
{
|
||||
(*m_logger) << time_now_string()
|
||||
|
@ -591,7 +591,7 @@ namespace libtorrent
|
|||
|
||||
if (t && t->is_aborted())
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << " *** the torrent has been aborted\n";
|
||||
#endif
|
||||
t.reset();
|
||||
|
@ -600,7 +600,7 @@ namespace libtorrent
|
|||
if (!t)
|
||||
{
|
||||
// we couldn't find the torrent!
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << " *** couldn't find a torrent with the given info_hash: " << ih << "\n";
|
||||
(*m_logger) << " torrents:\n";
|
||||
session_impl::torrent_map const& torrents = m_ses.m_torrents;
|
||||
|
@ -618,7 +618,7 @@ namespace libtorrent
|
|||
{
|
||||
// paused torrents will not accept
|
||||
// incoming connections
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << " rejected connection to paused torrent\n";
|
||||
#endif
|
||||
disconnect("connection rejected bacause torrent is paused");
|
||||
|
@ -773,7 +773,7 @@ namespace libtorrent
|
|||
p.abort_download(b);
|
||||
}
|
||||
}
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
else
|
||||
{
|
||||
(*m_logger) << time_now_string()
|
||||
|
@ -974,7 +974,7 @@ namespace libtorrent
|
|||
|
||||
if (m_have_piece[index])
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << " got redundant HAVE message for index: " << index << "\n";
|
||||
#endif
|
||||
}
|
||||
|
@ -1154,7 +1154,7 @@ namespace libtorrent
|
|||
{
|
||||
// if we don't have valid metadata yet,
|
||||
// we shouldn't get a request
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " <== UNEXPECTED_REQUEST [ "
|
||||
"piece: " << r.piece << " | "
|
||||
|
@ -1180,7 +1180,7 @@ namespace libtorrent
|
|||
// memory consumption.
|
||||
// ignore requests if the client
|
||||
// is making too many of them.
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " <== TOO MANY REQUESTS [ "
|
||||
"piece: " << r.piece << " | "
|
||||
|
@ -1222,7 +1222,7 @@ namespace libtorrent
|
|||
if (m_choked && m_accept_fast.find(r.piece) == m_accept_fast.end())
|
||||
{
|
||||
write_reject_request(r);
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " *** REJECTING REQUEST [ peer choked and piece not in allowed fast set ]\n";
|
||||
(*m_logger) << time_now_string()
|
||||
|
@ -1241,7 +1241,7 @@ namespace libtorrent
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " <== INVALID_REQUEST [ "
|
||||
"piece: " << r.piece << " | "
|
||||
|
@ -1348,7 +1348,7 @@ namespace libtorrent
|
|||
|
||||
if (!verify_piece(p))
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " <== INVALID_PIECE [ piece: " << p.piece << " | "
|
||||
"start: " << p.start << " | "
|
||||
|
@ -1388,7 +1388,7 @@ namespace libtorrent
|
|||
for (std::deque<piece_block>::iterator i = m_download_queue.begin();
|
||||
i != b; ++i)
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " *** SKIPPED_PIECE [ piece: " << i->piece_index << " | "
|
||||
"b: " << i->block_index << " ] ***\n";
|
||||
|
@ -1422,7 +1422,7 @@ namespace libtorrent
|
|||
, m_peer_id
|
||||
, "got a block that was not in the request queue"));
|
||||
}
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << " *** The block we just got was not in the "
|
||||
"request queue ***\n";
|
||||
#endif
|
||||
|
@ -1561,7 +1561,7 @@ namespace libtorrent
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string() << " *** GOT CANCEL NOT IN THE QUEUE\n";
|
||||
#endif
|
||||
}
|
||||
|
@ -1696,7 +1696,7 @@ namespace libtorrent
|
|||
|
||||
if (index < 0 || index >= int(m_have_piece.size()))
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string() << " <== INVALID_ALLOWED_FAST [ " << index << " | s: "
|
||||
<< int(m_have_piece.size()) << " ]\n";
|
||||
#endif
|
||||
|
@ -1751,6 +1751,8 @@ namespace libtorrent
|
|||
TORRENT_ASSERT(block.block_index < t->torrent_file().piece_size(block.piece_index));
|
||||
TORRENT_ASSERT(!t->picker().is_requested(block) || (t->picker().num_peers(block) > 0));
|
||||
TORRENT_ASSERT(!t->have_piece(block.piece_index));
|
||||
TORRENT_ASSERT(std::find(m_download_queue.begin(), m_download_queue.end(), block) == m_download_queue.end());
|
||||
TORRENT_ASSERT(std::find(m_request_queue.begin(), m_request_queue.end(), block) == m_request_queue.end());
|
||||
|
||||
piece_picker::piece_state_t state;
|
||||
peer_speed_t speed = peer_speed();
|
||||
|
@ -2032,7 +2034,7 @@ namespace libtorrent
|
|||
{
|
||||
TORRENT_ASSERT(m_connecting);
|
||||
TORRENT_ASSERT(m_connection_ticket >= 0);
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " CONNECTION TIMED OUT: " << m_remote.address().to_string()
|
||||
<< "\n";
|
||||
#endif
|
||||
|
@ -2044,7 +2046,7 @@ namespace libtorrent
|
|||
{
|
||||
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << "*** CONNECTION FAILED " << message << "\n";
|
||||
#endif
|
||||
// we cannot create an intrusive pointer to ourselves, since we
|
||||
|
@ -2319,7 +2321,7 @@ namespace libtorrent
|
|||
// requested (this has been observed by BitComet)
|
||||
// in this case we'll clear our download queue and
|
||||
// re-request the blocks.
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string()
|
||||
<< " *** PIECE_REQUESTS TIMED OUT [ " << (int)m_download_queue.size()
|
||||
<< " " << total_seconds(now - m_last_piece) << "] ***\n";
|
||||
|
@ -2419,7 +2421,7 @@ namespace libtorrent
|
|||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << "**ERROR**: " << e.what() << "\n";
|
||||
#endif
|
||||
disconnect(e.what());
|
||||
|
@ -2753,7 +2755,7 @@ namespace libtorrent
|
|||
|
||||
if (error)
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string() << " **ERROR**: "
|
||||
<< error.message() << "[in peer_connection::on_receive_data]\n";
|
||||
#endif
|
||||
|
@ -2875,7 +2877,7 @@ namespace libtorrent
|
|||
INVARIANT_CHECK;
|
||||
|
||||
asio::error_code ec;
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " CONNECTING: " << m_remote.address().to_string(ec)
|
||||
<< ":" << m_remote.port() << "\n";
|
||||
#endif
|
||||
|
@ -2931,7 +2933,7 @@ namespace libtorrent
|
|||
|
||||
if (e)
|
||||
{
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " CONNECTION FAILED: " << m_remote.address().to_string()
|
||||
<< ": " << e.message() << "\n";
|
||||
#endif
|
||||
|
@ -2945,7 +2947,7 @@ namespace libtorrent
|
|||
|
||||
// this means the connection just succeeded
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " COMPLETED: " << m_remote.address().to_string() << "\n";
|
||||
#endif
|
||||
|
||||
|
@ -2993,7 +2995,7 @@ namespace libtorrent
|
|||
|
||||
if (error)
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << "**ERROR**: " << error.message() << " [in peer_connection::on_send_data]\n";
|
||||
#endif
|
||||
set_failed();
|
||||
|
@ -3182,7 +3184,7 @@ namespace libtorrent
|
|||
d = now - m_last_receive;
|
||||
if (d > seconds(m_timeout))
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string() << " *** LAST ACTIVITY [ "
|
||||
<< total_seconds(d) << " seconds ago ] ***\n";
|
||||
#endif
|
||||
|
@ -3192,7 +3194,7 @@ namespace libtorrent
|
|||
// do not stall waiting for a handshake
|
||||
if (in_handshake() && d > seconds(m_ses.settings().handshake_timeout))
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string() << " *** NO HANDSHAKE [ waited "
|
||||
<< total_seconds(d) << " seconds ] ***\n";
|
||||
#endif
|
||||
|
@ -3210,7 +3212,7 @@ namespace libtorrent
|
|||
&& t && t->is_finished()
|
||||
&& d > seconds(20))
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string() << " *** NO REQUEST [ t: "
|
||||
<< total_seconds(d) << " ] ***\n";
|
||||
#endif
|
||||
|
@ -3241,7 +3243,7 @@ namespace libtorrent
|
|||
&& (m_ses.num_connections() >= m_ses.max_connections()
|
||||
|| (t && t->num_peers() >= t->max_connections())))
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string() << " *** MUTUAL NO INTEREST [ "
|
||||
"t1: " << total_seconds(d1) << " | "
|
||||
"t2: " << total_seconds(d2) << " ] ***\n";
|
||||
|
|
|
@ -321,7 +321,7 @@ namespace libtorrent
|
|||
|
||||
INVARIANT_CHECK;
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
for (peer_iterator i = m_connections.begin();
|
||||
i != m_connections.end(); ++i)
|
||||
{
|
||||
|
@ -594,7 +594,7 @@ namespace libtorrent
|
|||
// connect to random peers from the list
|
||||
std::random_shuffle(peer_list.begin(), peer_list.end());
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
|
||||
std::stringstream s;
|
||||
s << "TRACKER RESPONSE:\n"
|
||||
"interval: " << m_duration << "\n"
|
||||
|
@ -623,7 +623,7 @@ namespace libtorrent
|
|||
|
||||
if (m_ses.m_ip_filter.access(a.address()) & ip_filter::blocked)
|
||||
{
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
debug_log("blocked ip from tracker: " + i->ip);
|
||||
#endif
|
||||
if (m_ses.m_alerts.should_post(alert::info))
|
||||
|
@ -670,7 +670,7 @@ namespace libtorrent
|
|||
|
||||
if (m_ses.m_ip_filter.access(host->endpoint().address()) & ip_filter::blocked)
|
||||
{
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
debug_log("blocked ip from tracker: " + host->endpoint().address().to_string());
|
||||
#endif
|
||||
if (m_ses.m_alerts.should_post(alert::info))
|
||||
|
@ -1081,10 +1081,10 @@ namespace libtorrent
|
|||
#ifdef TORRENT_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " *** BANNING PEER [ " << p->ip
|
||||
<< " ] 'too many corrupt pieces'\n";
|
||||
#if defined(TORRENT_VERBOSE_LOGGING)
|
||||
#endif
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*p->connection->m_logger) << "*** BANNING PEER [ " << p->ip
|
||||
<< " ] 'too many corrupt pieces'\n";
|
||||
#endif
|
||||
#endif
|
||||
p->connection->disconnect("too many corrupt pieces, banning peer");
|
||||
}
|
||||
|
@ -1131,7 +1131,7 @@ namespace libtorrent
|
|||
// disconnect all peers and close all
|
||||
// files belonging to the torrents
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
for (peer_iterator i = m_connections.begin();
|
||||
i != m_connections.end(); ++i)
|
||||
{
|
||||
|
@ -1640,7 +1640,7 @@ namespace libtorrent
|
|||
{
|
||||
INVARIANT_CHECK;
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " resolving web seed: " << url << "\n";
|
||||
#endif
|
||||
|
||||
|
@ -1682,7 +1682,7 @@ namespace libtorrent
|
|||
|
||||
INVARIANT_CHECK;
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " completed resolve proxy hostname for: " << url << "\n";
|
||||
#endif
|
||||
|
||||
|
@ -1738,7 +1738,7 @@ namespace libtorrent
|
|||
|
||||
INVARIANT_CHECK;
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " completed resolve: " << url << "\n";
|
||||
#endif
|
||||
|
||||
|
@ -1754,7 +1754,7 @@ namespace libtorrent
|
|||
m_ses.m_alerts.post_alert(
|
||||
url_seed_alert(get_handle(), url, msg.str()));
|
||||
}
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_ses.m_logger) << " ** HOSTNAME LOOKUP FAILED!**: " << url << "\n";
|
||||
#endif
|
||||
|
||||
|
@ -1819,7 +1819,7 @@ namespace libtorrent
|
|||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_ses.m_logger) << " ** HOSTNAME LOOKUP FAILED!**: " << e.what() << "\n";
|
||||
#endif
|
||||
|
||||
|
@ -1957,7 +1957,7 @@ namespace libtorrent
|
|||
{
|
||||
// unknown country!
|
||||
p->set_country("!!");
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_ses.m_logger) << "IP " << p->remote().address() << " was mapped to unknown country: " << country << "\n";
|
||||
#endif
|
||||
return;
|
||||
|
@ -2250,7 +2250,7 @@ namespace libtorrent
|
|||
peer_connection* p = *m_connections.begin();
|
||||
TORRENT_ASSERT(p->associated_torrent().lock().get() == this);
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
if (m_abort)
|
||||
(*p->m_logger) << "*** CLOSING CONNECTION 'aborting'\n";
|
||||
else
|
||||
|
@ -2381,7 +2381,7 @@ namespace libtorrent
|
|||
TORRENT_ASSERT(p->associated_torrent().lock().get() == this);
|
||||
if (p->is_seed())
|
||||
{
|
||||
#if defined(TORRENT_VERBOSE_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*p->m_logger) << "*** SEED, CLOSING CONNECTION\n";
|
||||
#endif
|
||||
seeds.push_back(p);
|
||||
|
@ -2486,7 +2486,7 @@ namespace libtorrent
|
|||
{
|
||||
m_ses.m_alerts.post_alert(fastresume_rejected_alert(
|
||||
get_handle(), error_msg));
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_ses.m_logger) << "fastresume data for "
|
||||
<< torrent_file().name() << " rejected: "
|
||||
<< error_msg << "\n";
|
||||
|
@ -2861,7 +2861,7 @@ namespace libtorrent
|
|||
|
||||
void torrent::delete_files()
|
||||
{
|
||||
#if defined(TORRENT_VERBOSE_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING
|
||||
for (peer_iterator i = m_connections.begin();
|
||||
i != m_connections.end(); ++i)
|
||||
{
|
||||
|
@ -2898,7 +2898,7 @@ namespace libtorrent
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
for (peer_iterator i = m_connections.begin();
|
||||
i != m_connections.end(); ++i)
|
||||
{
|
||||
|
@ -3022,7 +3022,7 @@ namespace libtorrent
|
|||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
#ifdef TORRENT_VERBOSE_LOGGING
|
||||
#ifdef TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*p->m_logger) << "**ERROR**: " << e.what() << "\n";
|
||||
#endif
|
||||
p->set_failed();
|
||||
|
@ -3278,7 +3278,7 @@ namespace libtorrent
|
|||
|
||||
INVARIANT_CHECK;
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
debug_log("*** tracker timed out");
|
||||
#endif
|
||||
|
||||
|
@ -3311,7 +3311,7 @@ namespace libtorrent
|
|||
|
||||
INVARIANT_CHECK;
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
debug_log(std::string("*** tracker error: ") + str);
|
||||
#endif
|
||||
if (m_ses.m_alerts.should_post(alert::warning))
|
||||
|
@ -3334,7 +3334,7 @@ namespace libtorrent
|
|||
}
|
||||
|
||||
|
||||
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING)
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
void torrent::debug_log(const std::string& line)
|
||||
{
|
||||
(*m_ses.m_logger) << time_now_string() << " " << line << "\n";
|
||||
|
|
Loading…
Reference in New Issue