diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 8d890272b..b395524a3 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -592,9 +592,9 @@ namespace aux { save_struct(e["settings"], &m_settings, session_settings_map , sizeof(session_settings_map)/sizeof(session_settings_map[0])); #ifndef TORRENT_DISABLE_DHT - save_struct(e["dht"], &dht_settings(), dht_settings_map + save_struct(e["dht"], &m_dht_settings, dht_settings_map , sizeof(dht_settings_map)/sizeof(dht_settings_map[0])); - save_struct(e["dht proxy"], &dht_proxy(), proxy_settings_map + save_struct(e["dht proxy"], &m_dht_proxy, proxy_settings_map , sizeof(proxy_settings_map)/sizeof(proxy_settings_map[0])); #endif #if TORRENT_USE_I2P @@ -602,15 +602,15 @@ namespace aux { , sizeof(proxy_settings_map)/sizeof(proxy_settings_map[0])); #endif #ifndef TORRENT_DISABLE_ENCRYPTION - save_struct(e["encryption"], &get_pe_settings(), pe_settings_map + save_struct(e["encryption"], &m_pe_settings, pe_settings_map , sizeof(pe_settings_map)/sizeof(pe_settings_map[0])); #endif - save_struct(e["peer proxy"], &peer_proxy(), proxy_settings_map + save_struct(e["peer proxy"], &m_peer_proxy, proxy_settings_map , sizeof(proxy_settings_map)/sizeof(proxy_settings_map[0])); - save_struct(e["web proxy"], &web_seed_proxy(), proxy_settings_map + save_struct(e["web proxy"], &m_web_seed_proxy, proxy_settings_map , sizeof(proxy_settings_map)/sizeof(proxy_settings_map[0])); - save_struct(e["tracker proxy"], &tracker_proxy(), proxy_settings_map + save_struct(e["tracker proxy"], &m_tracker_proxy, proxy_settings_map , sizeof(proxy_settings_map)/sizeof(proxy_settings_map[0])); } diff --git a/test/setup_transfer.cpp b/test/setup_transfer.cpp index fe1487141..9486ea29e 100644 --- a/test/setup_transfer.cpp +++ b/test/setup_transfer.cpp @@ -85,7 +85,7 @@ bool print_alerts(libtorrent::session& ses, char const* name && a->message() != "block finished" && a->message() != "piece finished") { - fprintf(stderr, "%s: %s\n", name, p->message().c_str()); + fprintf(stderr, "%s: %s\n", name, a->message().c_str()); } TEST_CHECK(dynamic_cast(a.get()) == 0 || allow_failed_fastresume); diff --git a/test/test_fast_extension.cpp b/test/test_fast_extension.cpp index d9f0aeba8..069888f47 100644 --- a/test/test_fast_extension.cpp +++ b/test/test_fast_extension.cpp @@ -163,13 +163,15 @@ void test_reject_fast() sha1_hash ih = t->info_hash(); session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48900, 49000), "0.0.0.0", 0); error_code ec; - ses1.add_torrent(t, "./tmp1_fast", ec); + add_torrent_params p; + p.ti = t; + p.save_path = "./tmp1_fast"; + ses1.add_torrent(p, ec); test_sleep(2000); io_service ios; stream_socket s(ios); - error_code ec; s.connect(tcp::endpoint(address::from_string("127.0.0.1", ec), ses1.listen_port()), ec); char recv_buffer[1000]; @@ -220,8 +222,12 @@ void test_respect_suggest() boost::intrusive_ptr t = ::create_torrent(); sha1_hash ih = t->info_hash(); session ses1(fingerprint("LT", 0, 1, 0, 0), std::make_pair(48900, 49000), "0.0.0.0", 0); + error_code ec; - ses1.add_torrent(t, "./tmp1_fast", ec); + add_torrent_params p; + p.ti = t; + p.save_path = "./tmp1_fast"; + ses1.add_torrent(p, ec); test_sleep(2000); diff --git a/test/test_http_connection.cpp b/test/test_http_connection.cpp index 69d5ad805..76dcb707d 100644 --- a/test/test_http_connection.cpp +++ b/test/test_http_connection.cpp @@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "test.hpp" #include "libtorrent/socket.hpp" +#include "libtorrent/socket_io.hpp" // print_endpoint #include "libtorrent/connection_queue.hpp" #include "libtorrent/http_connection.hpp" #include "setup_transfer.hpp" diff --git a/test/test_storage.cpp b/test/test_storage.cpp index 7959504fa..9efe04bfe 100644 --- a/test/test_storage.cpp +++ b/test/test_storage.cpp @@ -735,9 +735,13 @@ void test_fastresume(std::string const& test_path) ses.set_alert_mask(alert::all_categories); error_code ec; - torrent_handle h = ses.add_torrent(boost::intrusive_ptr(new torrent_info(*t), ec) - , combine_path(test_path, "tmp1"), entry(), storage_mode_compact); + add_torrent_params p; + p.ti = new torrent_info(*t); + p.save_path = combine_path(test_path, "tmp1"); + p.storage_mode = storage_mode_compact; + torrent_handle h = ses.add_torrent(p, ec); + for (int i = 0; i < 10; ++i) { print_alerts(ses, "ses"); @@ -761,8 +765,15 @@ void test_fastresume(std::string const& test_path) { session ses(fingerprint(" ", 0,0,0,0), 0); ses.set_alert_mask(alert::all_categories); - torrent_handle h = ses.add_torrent(t, combine_path(test_path, "tmp1"), resume - , storage_mode_compact); + + add_torrent_params p; + p.ti = new torrent_info(*t); + p.save_path = combine_path(test_path, "tmp1"); + p.storage_mode = storage_mode_compact; + std::vector resume_buf; + bencode(std::back_inserter(resume_buf), resume); + p.resume_data = &resume_buf; + torrent_handle h = ses.add_torrent(p, ec); std::auto_ptr a = ses.pop_alert(); ptime end = time_now() + seconds(20); @@ -807,9 +818,12 @@ void test_rename_file_in_fastresume(std::string const& test_path) session ses(fingerprint(" ", 0,0,0,0), 0); ses.set_alert_mask(alert::all_categories); - torrent_handle h = ses.add_torrent(boost::intrusive_ptr(new torrent_info(*t, ec)) - , combine_path(test_path, "tmp2"), entry() - , storage_mode_compact); + + add_torrent_params p; + p.ti = new torrent_info(*t); + p.save_path = combine_path(test_path, "tmp2"); + p.storage_mode = storage_mode_compact; + torrent_handle h = ses.add_torrent(p, ec); h.rename_file(0, "testing_renamed_files"); std::cout << "renaming file" << std::endl; @@ -838,9 +852,16 @@ void test_rename_file_in_fastresume(std::string const& test_path) { session ses(fingerprint(" ", 0,0,0,0), 0); ses.set_alert_mask(alert::all_categories); - torrent_handle h = ses.add_torrent(t, combine_path(test_path, "tmp2"), resume - , storage_mode_compact); - + + add_torrent_params p; + p.ti = new torrent_info(*t); + p.save_path = combine_path(test_path, "tmp2"); + p.storage_mode = storage_mode_compact; + std::vector resume_buf; + bencode(std::back_inserter(resume_buf), resume); + p.resume_data = &resume_buf; + torrent_handle h = ses.add_torrent(p, ec); + for (int i = 0; i < 5; ++i) { print_alerts(ses, "ses"); diff --git a/test/test_upnp.cpp b/test/test_upnp.cpp index 0504a2738..fc9d0ca8c 100644 --- a/test/test_upnp.cpp +++ b/test/test_upnp.cpp @@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/upnp.hpp" #include "libtorrent/socket.hpp" +#include "libtorrent/socket_io.hpp" // print_endpoint #include "libtorrent/connection_queue.hpp" #include "test.hpp" #include "setup_transfer.hpp" diff --git a/test/test_web_seed.cpp b/test/test_web_seed.cpp index 3b79153cb..fc368661d 100644 --- a/test/test_web_seed.cpp +++ b/test/test_web_seed.cpp @@ -78,7 +78,11 @@ void test_transfer(boost::intrusive_ptr torrent_file, int proxy) ses.set_web_seed_proxy(ps); } - torrent_handle th = ses.add_torrent(*torrent_file, "./tmp2_web_seed", ec); + add_torrent_params p; + p.ti = torrent_file; + p.save_path = "./tmp2_web_seed"; + p.storage_mode = storage_mode_compact; + torrent_handle th = ses.add_torrent(p, ec); std::vector empty; th.replace_trackers(empty);