diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 9474773ad..9e7d6acb2 100755 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -244,7 +244,7 @@ int main(int argc, char* argv[]) session ses(fingerprint("LT", 0, 1, 0, 0)); ses.listen_on(std::make_pair(6881, 6889)); - ses.set_upload_rate_limit(100000); + ses.set_upload_rate_limit(1000); // ses.set_download_rate_limit(50000); ses.set_http_settings(settings); ses.set_severity_level(alert::debug); diff --git a/src/identify_client.cpp b/src/identify_client.cpp index 22b1e1843..1393644e5 100755 --- a/src/identify_client.cpp +++ b/src/identify_client.cpp @@ -338,9 +338,11 @@ namespace libtorrent return "SimpleBT"; } - if (std::equal(PID, PID + 8, "turbobt")) + if (std::equal(PID, PID + 7, "turbobt")) { - return "TurboBT"; + std::stringstream s; + s << "TurboBT " << PID[8] << "." << PID[10] << "." << PID[12]; + return s.str(); } if (std::equal(PID, PID + 13, "\0\0\0\0\0\0\0\0\0\0\0\0\x97")) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 26070d945..07a738690 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -402,7 +402,6 @@ namespace libtorrent , m_send_buffer.begin() + pos + 8 , 0); // indicate that we support the extension protocol - // curently disabled #ifdef TORRENT_ENABLE_EXTENSIONS m_send_buffer[pos+7] = 0x01; #endif diff --git a/src/policy.cpp b/src/policy.cpp index afea2cab5..068512e72 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -867,7 +867,8 @@ namespace libtorrent if (i->banned) return; - if (m_torrent->num_peers() < m_max_connections) + if (m_torrent->num_peers() < m_max_connections + && !m_torrent->is_paused()) { connect_peer(&*i); } diff --git a/src/session.cpp b/src/session.cpp index 6a8811284..43014e47e 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -131,8 +131,7 @@ namespace libtorrent { namespace detail peer_id id; std::fill(id.begin(), id.end(), 0); for (std::vector
::const_iterator i = t->peers.begin(); - i != t->peers.end(); - ++i) + i != t->peers.end(); ++i) { t->torrent_ptr->get_policy().peer_from_tracker(*i, id); } diff --git a/src/torrent.cpp b/src/torrent.cpp index abcaa0a99..805ede47f 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -251,7 +251,16 @@ namespace libtorrent m_currently_trying_tracker = 0; m_duration = interval; - m_next_request = boost::posix_time::second_clock::local_time() + boost::posix_time::seconds(m_duration); + if (peer_list.empty()) + { + // if the peer list is empty, we should contact the + // tracker soon again to see if there are any peers + m_next_request = boost::posix_time::second_clock::local_time() + boost::posix_time::seconds(60); + } + else + { + m_next_request = boost::posix_time::second_clock::local_time() + boost::posix_time::seconds(m_duration); + } // connect to random peers from the list std::random_shuffle(peer_list.begin(), peer_list.end());