merge RC_1_1 into master

This commit is contained in:
arvidn 2017-02-18 13:29:12 -05:00
commit 2c51c59327
7 changed files with 94 additions and 6 deletions

View File

@ -56,6 +56,7 @@
* resume data no longer has timestamps of files
* require C++11 to build libtorrent
* fix invalid access when leaving seed-mode with outstanding hash jobs
* fix ABI compatibility issue introduced with preformatted entry type
* add web_seed_name_lookup_retry to session_settings
* slightly improve proxy settings backwards compatibility

View File

@ -20,7 +20,6 @@ import inspect
if os.name != 'nt':
import pty
class test_create_torrent(unittest.TestCase):
def test_from_torrent_info(self):

View File

@ -505,6 +505,14 @@ TORRENT_TEST(default_connections_limit)
);
}
TORRENT_TEST(default_connections_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::connections_limit, -1); }
);
}
TORRENT_TEST(redundant_have)
{
test_settings([](lt::settings_pack& pack) {
@ -540,6 +548,13 @@ TORRENT_TEST(active_seeds)
);
}
TORRENT_TEST(active_seeds_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::active_seeds, -1); }
);
}
TORRENT_TEST(active_limit)
{
test_settings([](lt::settings_pack& pack) {
@ -547,6 +562,13 @@ TORRENT_TEST(active_limit)
);
}
TORRENT_TEST(active_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::active_limit, -1); }
);
}
TORRENT_TEST(upload_rate_limit)
{
test_settings([](lt::settings_pack& pack) {
@ -554,6 +576,13 @@ TORRENT_TEST(upload_rate_limit)
);
}
TORRENT_TEST(upload_rate_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::upload_rate_limit, -1); }
);
}
TORRENT_TEST(download_rate_limit)
{
test_settings([](lt::settings_pack& pack) {
@ -561,6 +590,14 @@ TORRENT_TEST(download_rate_limit)
);
}
TORRENT_TEST(download_rate_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::download_rate_limit, -1); }
);
}
TORRENT_TEST(unchoke_slots_limit)
{
test_settings([](lt::settings_pack& pack) {
@ -568,6 +605,14 @@ TORRENT_TEST(unchoke_slots_limit)
);
}
TORRENT_TEST(unchoke_slots_limit_negative)
{
test_settings([](lt::settings_pack& pack) {
pack.set_int(settings_pack::unchoke_slots_limit, -1);
pack.set_int(settings_pack::choking_algorithm, settings_pack::fixed_slots_choker);
});
}
// TODO: add test that makes sure a torrent in graceful pause mode won't make
// outgoing connections
// TODO: add test that makes sure a torrent in graceful pause mode won't accept

View File

@ -5178,8 +5178,11 @@ namespace libtorrent
}
else
{
TORRENT_ASSERT(t->verifying_piece(piece));
if (t->seed_mode()) t->verified(piece);
if (t->seed_mode())
{
TORRENT_ASSERT(t->verifying_piece(piece));
t->verified(piece);
}
#ifndef TORRENT_DISABLE_LOGGING
peer_log(peer_log_alert::info, "SEED_MODE_FILE_HASH"

View File

@ -313,6 +313,10 @@ namespace libtorrent
METRIC(picker, interesting_piece_picks)
METRIC(picker, hash_fail_piece_picks)
// These gauges indicate how many blocks are currently in use as dirty
// disk blocks (``write_cache_blocks``) and read cache blocks,
// respectively. deprecates ``cache_status::read_cache_size``.
// The sum of these gauges deprecates ``cache_status::cache_size``.
METRIC(disk, write_cache_blocks)
METRIC(disk, read_cache_blocks)
@ -320,16 +324,25 @@ namespace libtorrent
// peer until we're sending the response back on the socket.
METRIC(disk, request_latency)
// ``disk_blocks_in_use`` indicates how many disk blocks are currently in
// use, either as dirty blocks waiting to be written or blocks kept around
// in the hope that a peer will request it or in a peer send buffer. This
// gauge deprecates ``cache_status::total_used_buffers``.
METRIC(disk, pinned_blocks)
METRIC(disk, disk_blocks_in_use)
// ``queued_disk_jobs`` is the number of disk jobs currently queued,
// waiting to be executed by a disk thread. Deprecates
// ``cache_status::job_queue_length``.
METRIC(disk, queued_disk_jobs)
METRIC(disk, num_running_disk_jobs)
METRIC(disk, num_read_jobs)
METRIC(disk, num_write_jobs)
METRIC(disk, num_jobs)
METRIC(disk, blocked_disk_jobs)
METRIC(disk, num_writing_threads)
METRIC(disk, num_running_threads)
METRIC(disk, blocked_disk_jobs)
// the number of bytes we have sent to the disk I/O
// thread for writing. Every time we hear back from
@ -345,8 +358,9 @@ namespace libtorrent
METRIC(disk, arc_write_size)
METRIC(disk, arc_volatile_size)
// the number of blocks written and read from disk in total. A block is
// 16 kiB.
// the number of blocks written and read from disk in total. A block is 16
// kiB. ``num_blocks_written`` and ``num_blocks_read`` deprecates
// ``cache_status::blocks_written`` and ``cache_status::blocks_read`` respectively.
METRIC(disk, num_blocks_written)
METRIC(disk, num_blocks_read)
@ -354,10 +368,13 @@ namespace libtorrent
METRIC(disk, num_blocks_hashed)
// the number of blocks read from the disk cache
// Deprecates ``cache_info::blocks_read_hit``.
METRIC(disk, num_blocks_cache_hits)
// the number of disk I/O operation for reads and writes. One disk
// operation may transfer more then one block.
// These counters deprecates ``cache_status::writes`` and
// ``cache_status::reads``.
METRIC(disk, num_write_ops)
METRIC(disk, num_read_ops)

View File

@ -186,5 +186,13 @@ extern int EXPORT _g_test_failures;
TEST_ERROR("TEST_ERROR: Exception thrown: " #x); \
}
#define TEST_THROW(x) \
try \
{ \
x; \
TEST_ERROR("No exception thrown: " #x); \
} \
catch (...) {}
#endif // TEST_HPP

View File

@ -410,3 +410,18 @@ TORRENT_TEST(make_magnet_uri2)
TEST_CHECK(magnet.find("&ws=http%3a%2f%2ffoo.com%2fbar") != std::string::npos);
}
TORRENT_TEST(trailing_whitespace)
{
session ses(settings());
add_torrent_params p;
p.save_path = ".";
p.url = "magnet:?xt=urn:btih:abaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n";
// invalid hash
TEST_THROW(ses.add_torrent(p));
p.url = "magnet:?xt=urn:btih:abaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
// now it's valid, because there's no trailing whitespace
torrent_handle h = ses.add_torrent(p);
TEST_CHECK(h.is_valid());
}