From af50fe181b82741edc9d5e1d30e27edb404f64b1 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 20 May 2004 23:26:40 +0000 Subject: [PATCH] *** empty log message *** --- src/http_tracker_connection.cpp | 16 +++++++++++++++- src/identify_client.cpp | 8 +++++++- src/policy.cpp | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/http_tracker_connection.cpp b/src/http_tracker_connection.cpp index e79435d69..7375caf24 100755 --- a/src/http_tracker_connection.cpp +++ b/src/http_tracker_connection.cpp @@ -195,6 +195,11 @@ namespace libtorrent // the connections list. bool http_tracker_connection::tick() { +#ifndef NDEBUG + try + { +#endif + using namespace boost::posix_time; time_duration d = second_clock::local_time() - m_request_time; @@ -450,7 +455,16 @@ namespace libtorrent } return false; - } +#ifndef NDEBUG + } + catch (std::exception&) + { + if (requester()) + requester()->debug_log(std::string(m_buffer.begin(), m_buffer.end()); + throw; + } +#endif +} peer_entry http_tracker_connection::extract_peer_info(const entry& info) { diff --git a/src/identify_client.cpp b/src/identify_client.cpp index 383fe4ed8..29716f258 100755 --- a/src/identify_client.cpp +++ b/src/identify_client.cpp @@ -297,7 +297,13 @@ namespace libtorrent return "Generic"; } - return "Unknown"; + std::string unknown("Unknown ["); + for (peer_id::const_iterator i = p.begin(); i != p.end(); ++i) + { + unknown += std::isprint(*i)?*i:'.'; + } + unknown += "]"; + return unknown; } } diff --git a/src/policy.cpp b/src/policy.cpp index 329341ab6..afea2cab5 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -487,7 +487,7 @@ namespace libtorrent // if there is no first choice candidate, this candidate will be chosen. // it is the candidate that we owe the least to. peer* secondCandidate = 0; - size_type lowest_share_diff; // not valid when secondCandidate==0 + size_type lowest_share_diff = 0; // not valid when secondCandidate==0 for (std::vector::iterator i = m_peers.begin(); i != m_peers.end();