merged RC_1_1 into master

This commit is contained in:
arvidn 2018-02-05 02:26:42 +01:00
commit 15a8a17a6f
6 changed files with 26 additions and 14 deletions

View File

@ -82,6 +82,8 @@
* resume data no longer has timestamps of files
* require C++11 to build libtorrent
* fix issue resuming 1.0.x downloads with a file priority 0
* fix torrent_status::next_announce
* fix pad-file scalability issue
* made coalesce_reads/coalesce_writes settings take effect on linux and windows
* restore support for incoming connections over SOCKS5 (disabled by default)

View File

@ -84,6 +84,8 @@ using lt::address_v4;
using lt::address_v6;
#endif
using std::chrono::duration_cast;
#ifdef _WIN32
#include <windows.h>
@ -1676,6 +1678,13 @@ COLUMN OPTIONS
if (print_trackers)
{
snprintf(str, sizeof(str), "next_announce: %4" PRId64 " | current tracker: %s\x1b[K\n"
, std::int64_t(duration_cast<seconds>(s.next_announce).count())
, s.current_tracker.c_str());
out += str;
pos += 1;
std::vector<lt::announce_entry> tr = h.trackers();
lt::time_point now = lt::clock_type::now();
for (lt::announce_entry const& ae : h.trackers())
{
auto best_ae = std::min_element(ae.endpoints.begin(), ae.endpoints.end()

View File

@ -444,6 +444,14 @@ namespace libtorrent {
aux::vector<download_priority_t, file_index_t> m_file_priority;
std::string m_save_path;
std::string m_part_file_name;
// if this is false, we're not using a part file to store priority-0
// pieces, but we instead look for them under their actual file names
// this defaults to true, but when checking resume data for a torrent
// where we would expect to have a part file, but there isn't one, we set
// this to false.
bool m_use_part_file = true;
// the file pool is a member of the disk_io_thread
// to make all storage instances share the pool
file_pool& m_pool;

View File

@ -747,10 +747,6 @@ namespace libtorrent {
// immediately
void do_connect_boost();
// returns the absolute time when the next tracker
// announce will take place.
time_point next_announce() const;
// forcefully sets next_announce to the current time
void force_tracker_request(time_point, int tracker_idx);
void scrape_tracker(int idx, bool user_triggered);

View File

@ -469,7 +469,8 @@ namespace libtorrent {
}
if (file_index < m_file_priority.end_index()
&& m_file_priority[file_index] == dont_download)
&& m_file_priority[file_index] == dont_download
&& m_use_part_file)
{
TORRENT_ASSERT(m_part_file);
@ -532,7 +533,8 @@ namespace libtorrent {
}
if (file_index < m_file_priority.end_index()
&& m_file_priority[file_index] == dont_download)
&& m_file_priority[file_index] == dont_download
&& m_use_part_file)
{
TORRENT_ASSERT(m_part_file);

View File

@ -3324,11 +3324,6 @@ namespace libtorrent {
if (want_peers()) m_ses.prioritize_connections(shared_from_this());
}
time_point torrent::next_announce() const
{
return m_waiting_tracker ? m_tracker_timer.expires_at() : min_time();
}
// this is the entry point for the client to force a re-announce. It's
// considered a client-initiated announce (as opposed to the regular ones,
// issued by libtorrent)
@ -10718,10 +10713,10 @@ namespace {
st->download_payload_rate = m_stat.download_payload_rate();
st->upload_payload_rate = m_stat.upload_payload_rate();
if (m_waiting_tracker && !is_paused())
st->next_announce = next_announce() - now;
else
if (is_paused() || m_tracker_timer.expires_at() < now)
st->next_announce = seconds(0);
else
st->next_announce = m_tracker_timer.expires_at() - now;
if (st->next_announce.count() < 0)
st->next_announce = seconds(0);