merged RC_1_1 into master

This commit is contained in:
arvidn 2016-05-19 01:28:22 -04:00
commit aa0d29b67d
7 changed files with 24 additions and 7 deletions

View File

@ -17,6 +17,7 @@
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
the torrent
* fixed peer-class leak when settings per-torrent rate limits

View File

@ -50,6 +50,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/aux_/disable_warnings_pop.hpp"
#ifndef BOOST_SYSTEM_NOEXCEPT
#define BOOST_SYSTEM_NOEXCEPT TORRENT_EXCEPTION_THROW_SPECIFIER
#endif
namespace libtorrent
{

View File

@ -39,6 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/settings_pack.hpp"
#include "libtorrent/session_settings.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/session_stats.hpp"
#include "libtorrent/alert_types.hpp"
#include "libtorrent/deadline_timer.hpp"
#include "libtorrent/socket_io.hpp"
@ -126,6 +127,11 @@ TORRENT_TEST(dht_bootstrap)
num_nodes = c;
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?
, [&](int ticks, lt::session& ses) -> bool
@ -136,6 +142,7 @@ TORRENT_TEST(dht_bootstrap)
}
if (ticks > 2)
{
ses.post_session_stats();
std::printf("depth: %d nodes: %d\n", routing_table_depth, num_nodes);
TEST_CHECK(routing_table_depth >= 9);
TEST_CHECK(num_nodes >= 115);

View File

@ -37,6 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <utility>
#include <cinttypes> // for PRId64 et.al.
#include <boost/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/function/function1.hpp>
#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_immutable_data, dht_cnt.immutable_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

View File

@ -404,7 +404,7 @@ namespace libtorrent
m_socket->async_connect(m_remote
, 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());
@ -4092,7 +4092,7 @@ namespace libtorrent
, boost::asio::error::get_misc_category())
&& !in_handshake()
&& !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", "");
}

View File

@ -38,12 +38,12 @@ rule link_libtorrent ( properties * )
if <link>shared in $(properties)
{
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
{
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) ;
}
@ -83,8 +83,6 @@ lib libtorrent_test
: # user-requirements
<link>shared:<define>TORRENT_LINK_TEST_SHARED
<debug-iterators>on
<logging>on
<include>.
;

View File

@ -60,7 +60,6 @@ TORRENT_TEST(session)
// verify that we get the appropriate performance warning because
// we're allowing a larger queue than we have cache.
alert const* a;
for (;;)
{
@ -175,6 +174,7 @@ TORRENT_TEST(session_stats)
TEST_EQUAL(stats[i].value_index, i);
}
}
template <typename Set, typename Save, typename Default, typename Load>
void test_save_restore(Set setup, Save s, Default d, Load l)
{