document deprecation of dynamic loading/unloading of torrents

This commit is contained in:
arvidn 2017-03-13 01:54:21 -04:00 committed by Arvid Norberg
parent 6d2d736cec
commit 6f650aa7d9
5 changed files with 9 additions and 17 deletions

View File

@ -1,3 +1,4 @@
* document deprecation of dynamic loading/unloading of torrents
* include user-agent in tracker announces in anonymous_mode for private torrents
* add support for IPv6 peers from udp trackers
* correctly URL encode the IPv6 argument to trackers

View File

@ -641,20 +641,6 @@ void signal_handler(int signo)
quit = true;
}
void load_torrent(libtorrent::sha1_hash const& ih, std::vector<char>& buf, libtorrent::error_code& ec)
{
files_t::iterator i = hash_to_filename.find(ih);
if (i == hash_to_filename.end())
{
// for magnet links and torrents downloaded via
// URL, the metadata is saved in the resume file
// TODO: pick up metadata from the resume file
ec.assign(boost::system::errc::no_such_file_or_directory, boost::system::generic_category());
return;
}
load_file(i->second, buf, ec);
}
// if non-empty, a peer that will be added to all torrents
std::string peer;
@ -1586,7 +1572,6 @@ int main(int argc, char* argv[])
}
ses.set_ip_filter(loaded_ip_filter);
ses.set_load_function(&load_torrent);
error_code ec;

View File

@ -259,6 +259,9 @@ namespace libtorrent
void resume();
bool is_paused() const;
// *the feature of dynamically loading/unloading torrents is deprecated
// and discouraged*
//
// This function enables dynamic-loading-of-torrent-files_. When a
// torrent is unloaded but needs to be availabe in memory, this function
// is called **from within the libtorrent network thread**. From within

View File

@ -3791,6 +3791,7 @@ retry:
else
{
t->resume();
if (!t->should_check_files()) continue;
t->start_checking();
--limit;
}
@ -7127,7 +7128,9 @@ retry:
TORRENT_ASSERT(is_single_thread());
int loaded_limit = m_settings.get_int(settings_pack::active_loaded_limit);
TORRENT_ASSERT(m_num_save_resume <= loaded_limit);
TORRENT_ASSERT(loaded_limit == 0
|| !m_user_load_torrent
|| m_num_save_resume <= loaded_limit);
// if (m_num_save_resume < loaded_limit)
// TORRENT_ASSERT(m_save_resume_queue.empty());

View File

@ -276,7 +276,7 @@ namespace libtorrent
SET(active_tracker_limit, 1600, 0),
SET(active_lsd_limit, 60, 0),
SET(active_limit, 15, &session_impl::trigger_auto_manage),
SET_NOPREV(active_loaded_limit, 100, &session_impl::trigger_auto_manage),
SET_NOPREV(active_loaded_limit, 0, &session_impl::trigger_auto_manage),
SET(auto_manage_interval, 30, 0),
SET(seed_time_limit, 24 * 60 * 60, 0),
SET(auto_scrape_interval, 1800, 0),