deprecated setters for max connections, max half-open, upload and download rates and unchoke slots. These are now set through session_settings
This commit is contained in:
@@ -25,18 +25,18 @@ void test_swarm()
|
||||
// immediately. To make the swarm actually connect all
|
||||
// three peers before finishing.
|
||||
float rate_limit = 100000;
|
||||
ses1.set_upload_rate_limit(int(rate_limit));
|
||||
ses1.set_max_uploads(1);
|
||||
ses2.set_download_rate_limit(int(rate_limit / 5));
|
||||
ses3.set_download_rate_limit(int(rate_limit / 5));
|
||||
ses2.set_upload_rate_limit(int(rate_limit / 10));
|
||||
ses3.set_upload_rate_limit(int(rate_limit / 10));
|
||||
|
||||
session_settings settings;
|
||||
settings.allow_multiple_connections_per_ip = true;
|
||||
settings.ignore_limits_on_local_network = false;
|
||||
settings.choking_algorithm = session_settings::auto_expand_choker;
|
||||
settings.upload_rate_limit = rate_limit;
|
||||
settings.unchoke_slots_limit = 1;
|
||||
ses1.set_settings(settings);
|
||||
|
||||
settings.upload_rate_limit = rate_limit / 10;
|
||||
settings.download_rate_limit = rate_limit / 5;
|
||||
settings.unchoke_slots_limit = 0;
|
||||
ses2.set_settings(settings);
|
||||
ses3.set_settings(settings);
|
||||
|
||||
|
@@ -53,13 +53,21 @@ void test_pex()
|
||||
// immediately. To make the swarm actually connect all
|
||||
// three peers before finishing.
|
||||
float rate_limit = 1000;
|
||||
ses1.set_upload_rate_limit(int(rate_limit));
|
||||
ses2.set_download_rate_limit(int(rate_limit));
|
||||
ses3.set_download_rate_limit(int(rate_limit));
|
||||
session_settings set = ses1.settings();
|
||||
set.upload_rate_limit = rate_limit;
|
||||
ses1.set_settings(set);
|
||||
|
||||
// make the peer connecting the two worthless to transfer
|
||||
// data, to force peer 3 to connect directly to peer 1 through pex
|
||||
ses2.set_upload_rate_limit(2000);
|
||||
ses3.set_upload_rate_limit(int(rate_limit / 2));
|
||||
set = ses2.settings();
|
||||
set.download_rate_limit = rate_limit;
|
||||
set.upload_rate_limit = 2000;
|
||||
ses2.set_settings(set);
|
||||
|
||||
set = ses3.settings();
|
||||
set.download_rate_limit = rate_limit;
|
||||
set.upload_rate_limit = rate_limit / 2;
|
||||
ses3.set_settings(set);
|
||||
|
||||
ses1.add_extension(&create_ut_pex_plugin);
|
||||
ses2.add_extension(&create_ut_pex_plugin);
|
||||
|
@@ -60,17 +60,17 @@ void test_swarm(bool super_seeding = false, bool strict = false, bool seed_mode
|
||||
// immediately. To make the swarm actually connect all
|
||||
// three peers before finishing.
|
||||
float rate_limit = 100000;
|
||||
ses1.set_upload_rate_limit(int(rate_limit));
|
||||
ses2.set_download_rate_limit(int(rate_limit));
|
||||
ses3.set_download_rate_limit(int(rate_limit));
|
||||
ses2.set_upload_rate_limit(int(rate_limit / 2));
|
||||
ses3.set_upload_rate_limit(int(rate_limit / 2));
|
||||
|
||||
session_settings settings;
|
||||
settings.allow_multiple_connections_per_ip = true;
|
||||
settings.ignore_limits_on_local_network = false;
|
||||
settings.strict_super_seeding = strict;
|
||||
|
||||
settings.upload_rate_limit = rate_limit;
|
||||
ses1.set_settings(settings);
|
||||
|
||||
settings.download_rate_limit = rate_limit / 2;
|
||||
settings.upload_rate_limit = rate_limit;
|
||||
ses2.set_settings(settings);
|
||||
ses3.set_settings(settings);
|
||||
|
||||
|
@@ -82,7 +82,7 @@ void test_rate()
|
||||
|
||||
ptime start = time_now();
|
||||
|
||||
for (int i = 0; i < 70; ++i)
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
print_alerts(ses1, "ses1");
|
||||
print_alerts(ses2, "ses2");
|
||||
@@ -97,7 +97,7 @@ void test_rate()
|
||||
<< std::endl;
|
||||
|
||||
if (tor2.is_seed()) break;
|
||||
test_sleep(100);
|
||||
test_sleep(1000);
|
||||
}
|
||||
|
||||
TEST_CHECK(tor2.is_seed());
|
||||
@@ -263,7 +263,7 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
||||
if (test_allowed_fast)
|
||||
{
|
||||
sett.allowed_fast_set_size = 2000;
|
||||
ses1.set_max_uploads(0);
|
||||
sett.unchoke_slots_limit = 0;
|
||||
}
|
||||
|
||||
sett.min_reconnect_time = 1;
|
||||
@@ -324,7 +324,9 @@ void test_transfer(int proxy_type, bool test_disk_full = false, bool test_allowe
|
||||
& ~alert::stats_notification);
|
||||
// ses1.set_alert_dispatch(&print_alert);
|
||||
|
||||
ses2.set_download_rate_limit(tor2.get_torrent_info().piece_length() * 5);
|
||||
sett = ses2.settings();
|
||||
sett.download_rate_limit = tor2.get_torrent_info().piece_length() * 5;
|
||||
ses2.set_settings(sett);
|
||||
|
||||
// also test to move the storage of the downloader and the uploader
|
||||
// to make sure it can handle switching paths
|
||||
|
Reference in New Issue
Block a user