merged RC_1_1 into master
This commit is contained in:
commit
aa0d29b67d
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
1.1.1 release
|
1.1.1 release
|
||||||
|
|
||||||
|
* fixed dht stats counters that weren't being updated
|
||||||
* make sure add_torrent_alert is always posted before other alerts for
|
* make sure add_torrent_alert is always posted before other alerts for
|
||||||
the torrent
|
the torrent
|
||||||
* fixed peer-class leak when settings per-torrent rate limits
|
* fixed peer-class leak when settings per-torrent rate limits
|
||||||
|
|
|
@ -50,6 +50,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "libtorrent/aux_/disable_warnings_pop.hpp"
|
#include "libtorrent/aux_/disable_warnings_pop.hpp"
|
||||||
|
|
||||||
|
#ifndef BOOST_SYSTEM_NOEXCEPT
|
||||||
|
#define BOOST_SYSTEM_NOEXCEPT TORRENT_EXCEPTION_THROW_SPECIFIER
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/settings_pack.hpp"
|
#include "libtorrent/settings_pack.hpp"
|
||||||
#include "libtorrent/session_settings.hpp"
|
#include "libtorrent/session_settings.hpp"
|
||||||
#include "libtorrent/session.hpp"
|
#include "libtorrent/session.hpp"
|
||||||
|
#include "libtorrent/session_stats.hpp"
|
||||||
#include "libtorrent/alert_types.hpp"
|
#include "libtorrent/alert_types.hpp"
|
||||||
#include "libtorrent/deadline_timer.hpp"
|
#include "libtorrent/deadline_timer.hpp"
|
||||||
#include "libtorrent/socket_io.hpp"
|
#include "libtorrent/socket_io.hpp"
|
||||||
|
@ -126,6 +127,11 @@ TORRENT_TEST(dht_bootstrap)
|
||||||
num_nodes = c;
|
num_nodes = c;
|
||||||
print_routing_table(p->routing_table);
|
print_routing_table(p->routing_table);
|
||||||
}
|
}
|
||||||
|
else if (lt::session_stats_alert const* sa = lt::alert_cast<lt::session_stats_alert>(a))
|
||||||
|
{
|
||||||
|
int const dht_nodes = lt::find_metric_idx("dht.nodes");
|
||||||
|
TEST_CHECK(sa->values[dht_nodes] > 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// terminate?
|
// terminate?
|
||||||
, [&](int ticks, lt::session& ses) -> bool
|
, [&](int ticks, lt::session& ses) -> bool
|
||||||
|
@ -136,6 +142,7 @@ TORRENT_TEST(dht_bootstrap)
|
||||||
}
|
}
|
||||||
if (ticks > 2)
|
if (ticks > 2)
|
||||||
{
|
{
|
||||||
|
ses.post_session_stats();
|
||||||
std::printf("depth: %d nodes: %d\n", routing_table_depth, num_nodes);
|
std::printf("depth: %d nodes: %d\n", routing_table_depth, num_nodes);
|
||||||
TEST_CHECK(routing_table_depth >= 9);
|
TEST_CHECK(routing_table_depth >= 9);
|
||||||
TEST_CHECK(num_nodes >= 115);
|
TEST_CHECK(num_nodes >= 115);
|
||||||
|
|
|
@ -37,6 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <cinttypes> // for PRId64 et.al.
|
#include <cinttypes> // for PRId64 et.al.
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/function/function1.hpp>
|
#include <boost/function/function1.hpp>
|
||||||
|
|
||||||
#ifdef TORRENT_USE_VALGRIND
|
#ifdef TORRENT_USE_VALGRIND
|
||||||
|
@ -751,6 +752,12 @@ void node::update_stats_counters(counters& c) const
|
||||||
c.set_value(counters::dht_peers, dht_cnt.peers);
|
c.set_value(counters::dht_peers, dht_cnt.peers);
|
||||||
c.set_value(counters::dht_immutable_data, dht_cnt.immutable_data);
|
c.set_value(counters::dht_immutable_data, dht_cnt.immutable_data);
|
||||||
c.set_value(counters::dht_mutable_data, dht_cnt.mutable_data);
|
c.set_value(counters::dht_mutable_data, dht_cnt.mutable_data);
|
||||||
|
|
||||||
|
int nodes, replacements;
|
||||||
|
boost::tie(nodes, replacements, boost::tuples::ignore) = size();
|
||||||
|
c.set_value(counters::dht_nodes, nodes);
|
||||||
|
c.set_value(counters::dht_node_cache, replacements);
|
||||||
|
c.set_value(counters::dht_allocated_observers, m_rpc.num_allocated_observers());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TORRENT_NO_DEPRECATE
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
|
|
|
@ -404,7 +404,7 @@ namespace libtorrent
|
||||||
|
|
||||||
m_socket->async_connect(m_remote
|
m_socket->async_connect(m_remote
|
||||||
, boost::bind(&peer_connection::on_connection_complete, self(), _1));
|
, boost::bind(&peer_connection::on_connection_complete, self(), _1));
|
||||||
m_connect = clock_type::now();
|
m_connect = aux::time_now();
|
||||||
|
|
||||||
sent_syn(m_remote.address().is_v6());
|
sent_syn(m_remote.address().is_v6());
|
||||||
|
|
||||||
|
@ -4092,7 +4092,7 @@ namespace libtorrent
|
||||||
, boost::asio::error::get_misc_category())
|
, boost::asio::error::get_misc_category())
|
||||||
&& !in_handshake()
|
&& !in_handshake()
|
||||||
&& !is_connecting()
|
&& !is_connecting()
|
||||||
&& clock_type::now() - connected_time() < seconds(15))
|
&& aux::time_now() - connected_time() < seconds(15))
|
||||||
{
|
{
|
||||||
peer_log(peer_log_alert::info, "SHORT_LIVED_DISCONNECT", "");
|
peer_log(peer_log_alert::info, "SHORT_LIVED_DISCONNECT", "");
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,12 +38,12 @@ rule link_libtorrent ( properties * )
|
||||||
if <link>shared in $(properties)
|
if <link>shared in $(properties)
|
||||||
{
|
{
|
||||||
result +=
|
result +=
|
||||||
<library>/torrent//torrent/<link>shared/<logging>on/<boost-link>shared/<export-extra>on/<debug-iterators>on ;
|
<library>/torrent//torrent/<link>shared/<boost-link>shared/<export-extra>on ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result +=
|
result +=
|
||||||
<library>/torrent//torrent/<link>static/<logging>on/<boost-link>static/<export-extra>on/<debug-iterators>on ;
|
<library>/torrent//torrent/<link>static/<boost-link>static/<export-extra>on ;
|
||||||
}
|
}
|
||||||
return $(result) ;
|
return $(result) ;
|
||||||
}
|
}
|
||||||
|
@ -83,8 +83,6 @@ lib libtorrent_test
|
||||||
|
|
||||||
: # user-requirements
|
: # user-requirements
|
||||||
<link>shared:<define>TORRENT_LINK_TEST_SHARED
|
<link>shared:<define>TORRENT_LINK_TEST_SHARED
|
||||||
<debug-iterators>on
|
|
||||||
<logging>on
|
|
||||||
<include>.
|
<include>.
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ TORRENT_TEST(session)
|
||||||
// verify that we get the appropriate performance warning because
|
// verify that we get the appropriate performance warning because
|
||||||
// we're allowing a larger queue than we have cache.
|
// we're allowing a larger queue than we have cache.
|
||||||
|
|
||||||
|
|
||||||
alert const* a;
|
alert const* a;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
@ -175,6 +174,7 @@ TORRENT_TEST(session_stats)
|
||||||
TEST_EQUAL(stats[i].value_index, i);
|
TEST_EQUAL(stats[i].value_index, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Set, typename Save, typename Default, typename Load>
|
template <typename Set, typename Save, typename Default, typename Load>
|
||||||
void test_save_restore(Set setup, Save s, Default d, Load l)
|
void test_save_restore(Set setup, Save s, Default d, Load l)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue