Merge pull request #491 from arvidn/test-transfer-1.1

attempt to fix test_transfer
This commit is contained in:
Arvid Norberg 2016-02-23 21:48:46 -05:00
commit 7fdc2e6308
2 changed files with 10 additions and 3 deletions

View File

@ -841,10 +841,16 @@ setup_transfer(lt::session* ses1, lt::session* ses2, lt::session* ses3
error_code ec;
int port = 0;
if (use_ssl_ports)
{
port = ses2->ssl_listen_port();
fprintf(stderr, "%s: ses2->ssl_listen_port(): %d\n", time_now_string(), port);
}
if (port == 0)
{
port = ses2->listen_port();
fprintf(stderr, "%s: ses2->listen_port(): %d\n", time_now_string(), port);
}
fprintf(stderr, "%s: ses1: connecting peer port: %d\n"
, time_now_string(), port);

View File

@ -127,8 +127,6 @@ void test_transfer(int proxy_type, settings_pack const& sett
, bool test_disk_full = false
, storage_mode_t storage_mode = storage_mode_sparse)
{
static int listen_port = 0;
char const* test_name[] = {"no", "SOCKS4", "SOCKS5", "SOCKS5 password", "HTTP", "HTTP password"};
fprintf(stderr, "\n\n ==== TESTING %s proxy ==== disk-full: %s\n\n\n"
@ -160,7 +158,6 @@ void test_transfer(int proxy_type, settings_pack const& sett
pack.set_str(settings_pack::listen_interfaces, "0.0.0.0:49075");
lt::session ses2(pack);
listen_port += 10;
int proxy_port = 0;
if (proxy_type)
@ -183,6 +180,10 @@ void test_transfer(int proxy_type, settings_pack const& sett
pack.set_str(settings_pack::proxy_hostname, "127.0.0.1");
ses1.apply_settings(pack);
ses2.apply_settings(pack);
// ses1 is connecting to ses2, so only ses1 should be using the proxy
pack.set_int(settings_pack::proxy_type, settings_pack::none);
ses1.apply_settings(pack);
}
pack = sett;