diff --git a/libtorrent/include/libtorrent/session_settings.hpp b/libtorrent/include/libtorrent/session_settings.hpp index a8b2091f6..d7a4f88c1 100644 --- a/libtorrent/include/libtorrent/session_settings.hpp +++ b/libtorrent/include/libtorrent/session_settings.hpp @@ -106,6 +106,7 @@ namespace libtorrent , lazy_bitfields(true) , inactivity_timeout(600) , unchoke_interval(20) + , num_want(200) #ifndef TORRENT_DISABLE_DHT , use_dht_as_fallback(true) #endif @@ -242,6 +243,9 @@ namespace libtorrent // tracker in the ip= parameter. address announce_ip; + // the num want sent to trackers + int num_want; + #ifndef TORRENT_DISABLE_DHT // while this is true, the dht will note be used unless the // tracker is online diff --git a/libtorrent/include/libtorrent/storage.hpp b/libtorrent/include/libtorrent/storage.hpp index 552b6e89f..8a10c7148 100755 --- a/libtorrent/include/libtorrent/storage.hpp +++ b/libtorrent/include/libtorrent/storage.hpp @@ -211,7 +211,9 @@ namespace libtorrent fs::path save_path() const; void async_release_files( - boost::function const& handler); + boost::function const& handler + = boost::function()); + void async_move_storage(fs::path const& p , boost::function const& handler); diff --git a/libtorrent/src/bt_peer_connection.cpp b/libtorrent/src/bt_peer_connection.cpp index 7264899a5..2483b4a2a 100755 --- a/libtorrent/src/bt_peer_connection.cpp +++ b/libtorrent/src/bt_peer_connection.cpp @@ -2286,4 +2286,3 @@ namespace libtorrent } - diff --git a/libtorrent/src/identify_client.cpp b/libtorrent/src/identify_client.cpp index 44be2d60f..26ddb51dc 100755 --- a/libtorrent/src/identify_client.cpp +++ b/libtorrent/src/identify_client.cpp @@ -193,7 +193,7 @@ namespace , {"TT", "TuoTu"} , {"U", "UPnP"} , {"UL", "uLeecher"} - , {"UT", "MicroTorrent"} + , {"UT", "uTorrent"} , {"XT", "XanTorrent"} , {"XX", "Xtorrent"} , {"ZT", "ZipTorrent"} diff --git a/libtorrent/src/torrent.cpp b/libtorrent/src/torrent.cpp index 629045cce..fe1bf8091 100755 --- a/libtorrent/src/torrent.cpp +++ b/libtorrent/src/torrent.cpp @@ -1007,8 +1007,7 @@ namespace libtorrent // disconnect all peers and close all // files belonging to the torrents disconnect_all(); - if (m_owning_storage.get()) m_storage->async_release_files( - bind(&torrent::on_files_released, shared_from_this(), _1, _2)); + if (m_owning_storage.get()) m_storage->async_release_files(); m_owning_storage = 0; } @@ -1352,7 +1351,7 @@ namespace libtorrent if (m_event != tracker_request::stopped) m_event = tracker_request::none; req.url = m_trackers[m_currently_trying_tracker].url; - req.num_want = 50; + req.num_want = m_settings.num_want; // if we are aborting. we don't want any new peers if (req.event == tracker_request::stopped) req.num_want = 0; @@ -2041,8 +2040,7 @@ namespace libtorrent , bind(&peer_connection::disconnect, _1)); assert(m_storage); - m_storage->async_release_files( - bind(&torrent::on_files_released, shared_from_this(), _1, _2)); + m_storage->async_release_files(); } // called when torrent is complete (all pieces downloaded)