diff --git a/src/udp_socket.cpp b/src/udp_socket.cpp index 9500e9d25..bb1213163 100644 --- a/src/udp_socket.cpp +++ b/src/udp_socket.cpp @@ -779,6 +779,9 @@ void udp_socket::set_proxy_settings(proxy_settings const& ps) ++m_outstanding_ops; #if TORRENT_USE_ASSERTS ++m_outstanding_resolve; +#endif +#if defined TORRENT_ASIO_DEBUGGING + add_outstanding_async("udp_socket::on_name_lookup"); #endif m_resolver.async_resolve(q, boost::bind( &udp_socket::on_name_lookup, this, _1, _2)); @@ -787,6 +790,9 @@ void udp_socket::set_proxy_settings(proxy_settings const& ps) void udp_socket::on_name_lookup(error_code const& e, tcp::resolver::iterator i) { +#if defined TORRENT_ASIO_DEBUGGING + complete_async("udp_socket::on_name_lookup"); +#endif #if TORRENT_USE_ASSERTS TORRENT_ASSERT(m_outstanding_resolve > 0); --m_outstanding_resolve; diff --git a/test/test_remap_files.cpp b/test/test_remap_files.cpp index 9cc279b9d..d22c50e3f 100644 --- a/test/test_remap_files.cpp +++ b/test/test_remap_files.cpp @@ -68,6 +68,9 @@ void test_remap_files_gather(storage_mode_t storage_mode = storage_mode_sparse) & ~alert::progress_notification & ~alert::stats_notification; + session_proxy p1; + session_proxy p2; + lt::session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48075, 49000) , "0.0.0.0", 0, alert_mask); lt::session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49075, 50000) @@ -202,6 +205,9 @@ void test_remap_files_gather(storage_mode_t storage_mode = storage_mode_sparse) st2 = tor2.status(); TEST_CHECK(st2.is_seeding); + + p1 = ses1.abort(); + p2 = ses2.abort(); } void test_remap_files_scatter(storage_mode_t storage_mode = storage_mode_sparse) @@ -215,6 +221,9 @@ void test_remap_files_scatter(storage_mode_t storage_mode = storage_mode_sparse) & ~alert::progress_notification & ~alert::stats_notification; + session_proxy p1; + session_proxy p2; + lt::session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48075, 49000) , "0.0.0.0", 0, alert_mask); lt::session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49075, 50000) @@ -331,6 +340,9 @@ void test_remap_files_scatter(storage_mode_t storage_mode = storage_mode_sparse) st2 = tor2.status(); TEST_CHECK(st2.is_seeding); + + p1 = ses1.abort(); + p2 = ses2.abort(); } void test_remap_files_prio(storage_mode_t storage_mode = storage_mode_sparse) @@ -342,6 +354,9 @@ void test_remap_files_prio(storage_mode_t storage_mode = storage_mode_sparse) & ~alert::progress_notification & ~alert::stats_notification; + session_proxy p1; + session_proxy p2; + lt::session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48075, 49000) , "0.0.0.0", 0, alert_mask); lt::session ses2(fingerprint("LT", 0, 1, 0, 0), std::make_pair(49075, 50000) @@ -467,6 +482,9 @@ void test_remap_files_prio(storage_mode_t storage_mode = storage_mode_sparse) torrent_status st2 = tor2.status(); TEST_CHECK(st2.is_finished); + + p1 = ses1.abort(); + p2 = ses2.abort(); } int test_main()