From a53473a65d3e67c6044503e366507d1336f19092 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 7 Feb 2008 07:09:52 +0000 Subject: [PATCH] added new logging mode to log peer errors --- Jamfile | 3 +- docs/building.html | 1 + docs/building.rst | 1 + docs/manual.html | 22 ++++----- docs/udp_tracker_protocol.html | 12 +---- include/libtorrent/peer_connection.hpp | 2 +- src/peer_connection.cpp | 62 +++++++++++++------------- src/torrent.cpp | 44 +++++++++--------- 8 files changed, 69 insertions(+), 78 deletions(-) diff --git a/Jamfile b/Jamfile index a2623c854..d7fd8e75f 100755 --- a/Jamfile +++ b/Jamfile @@ -161,8 +161,9 @@ feature.compose on : TORRENT_DISK_STATS ; feature memdebug : off on : composite propagated ; feature.compose on : TORRENT_MEMDEBUG ; -feature logging : none default verbose : composite propagated link-incompatible ; +feature logging : none default errors verbose : composite propagated link-incompatible ; feature.compose default : TORRENT_LOGGING ; +feature.compose errors : TORRENT_ERRORLOGGING ; feature.compose verbose : TORRENT_VERBOSE_LOGGING ; feature dht-support : on off logging : composite propagated link-incompatible ; diff --git a/docs/building.html b/docs/building.html index 957139ca7..b32c1af4b 100644 --- a/docs/building.html +++ b/docs/building.html @@ -205,6 +205,7 @@ boost directory.
  • none - no logging.
  • default - basic session logging.
  • verbose - verbose peer wire logging.
  • +
  • errors - like verbose, but limited to errors.
  • diff --git a/docs/building.rst b/docs/building.rst index cf782373f..6d783af31 100644 --- a/docs/building.rst +++ b/docs/building.rst @@ -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. | diff --git a/docs/manual.html b/docs/manual.html index 523cde0c1..3f0248417 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -86,7 +86,7 @@
  • name()
  • set_ratio()
  • set_upload_limit() set_download_limit() upload_limit() download_limit()
  • -
  • set_sequenced_download_threshold()
  • +
  • set_sequential_download()
  • set_peer_upload_limit() set_peer_download_limit()
  • pause() resume() is_paused()
  • resolve_countries()
  • @@ -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.

    download, respectively.

    -

    set_sequenced_download_threshold()

    +

    set_sequential_download()

    -void set_sequenced_download_threshold(int threshold);
    +void set_sequential_download(bool sd);
     
    -

    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.

    -

    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.

    +

    Enables or disables sequential download. When enabled, the piece picker will pick pieces in sequence +instead of rarest first.

    +

    Enabling sequential download will affect the piece distribution negatively in the swarm. It should be +used sparingly.

    set_peer_upload_limit() set_peer_download_limit()

    diff --git a/docs/udp_tracker_protocol.html b/docs/udp_tracker_protocol.html index 091d55354..ff5bea55c 100644 --- a/docs/udp_tracker_protocol.html +++ b/docs/udp_tracker_protocol.html @@ -312,18 +312,10 @@ scrape. See actions. transaction_id Randomized by client. -int16_t -num_info_hashes -The number of info-hashes that will -follow. - -uint16_t -extensions -Optional field. See extensions. - -

    The following structure is repeated num_info_hashes times:

    +

    The following structure is repeated for each info-hash to scrape, but limited by +the MTU.

    diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 8f9cde4e6..fdec4989b 100755 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -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 m_logger; #endif diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index c9df1ba0c..9e815e8d1 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -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(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(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::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"; diff --git a/src/torrent.cpp b/src/torrent.cpp index 80308a889..941b183af 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -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";