From 1cdff958f11378b53ae8518fe553fbb53e187cdc Mon Sep 17 00:00:00 2001 From: arvidn Date: Tue, 7 Jan 2020 18:12:45 +0100 Subject: [PATCH] minor fix to socks5 simulation --- simulation/test_socks5.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/simulation/test_socks5.cpp b/simulation/test_socks5.cpp index e30dc2fe2..71122f67c 100644 --- a/simulation/test_socks5.cpp +++ b/simulation/test_socks5.cpp @@ -262,13 +262,11 @@ TORRENT_TEST(socks5_udp_retry) sim::socks_server socks5(proxy_ios, 5555, 5, socks_flag::disconnect_udp_associate); lt::settings_pack pack = settings(); - pack.set_str(settings_pack::listen_interfaces, "50.50.50.50:6881"); // create session std::shared_ptr ses = std::make_shared(pack, *ios); + print_alerts(*ses); set_proxy(*ses, settings_pack::socks5); - // run for 60 seconds.The sokcks5 retry interval is expected to be 5 seconds, - // meaning there should have been 12 connection attempts sim::timer t(sim, lt::seconds(60), [&](boost::system::error_code const&) { fprintf(stderr, "shutting down\n"); @@ -279,5 +277,9 @@ TORRENT_TEST(socks5_udp_retry) sim.run(); // number of UDP ASSOCIATE commands invoked on the socks proxy - TEST_EQUAL(socks5.cmd_counts()[2], 12); + // We run for 60 seconds. The sokcks5 retry interval is expected to be 5 + // seconds, meaning there should have been 12 connection attempts since we + // have an outgoing_udp_socket as well, it will also attempt to establish a + // SOCKS5 UDP tunnel, so it will bring it to 24 attempts + TEST_EQUAL(socks5.cmd_counts()[2], 24); }