mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
lt sync 2613
This commit is contained in:
parent
d8b0fb5885
commit
90a4b3e1ed
3 changed files with 25 additions and 24 deletions
|
@ -166,7 +166,7 @@ namespace libtorrent
|
||||||
virtual std::string message() const
|
virtual std::string message() const
|
||||||
{
|
{
|
||||||
static char const* state_str[] =
|
static char const* state_str[] =
|
||||||
{"checking (q)", "checking", "connecting", "dl metadata"
|
{"checking (q)", "checking", "dl metadata"
|
||||||
, "downloading", "finished", "seeding", "allocating"};
|
, "downloading", "finished", "seeding", "allocating"};
|
||||||
|
|
||||||
return torrent_alert::message() + ": state changed to: "
|
return torrent_alert::message() + ": state changed to: "
|
||||||
|
|
|
@ -1099,7 +1099,7 @@ namespace libtorrent
|
||||||
p.piece_priority = new_piece_priority;
|
p.piece_priority = new_piece_priority;
|
||||||
int new_priority = p.priority(this);
|
int new_priority = p.priority(this);
|
||||||
|
|
||||||
if (prev_priority == new_priority) return false;
|
if (prev_priority == new_priority) return ret;
|
||||||
|
|
||||||
TORRENT_ASSERT(prev_priority < int(m_priority_boundries.size()));
|
TORRENT_ASSERT(prev_priority < int(m_priority_boundries.size()));
|
||||||
|
|
||||||
|
|
|
@ -1800,7 +1800,6 @@ namespace libtorrent
|
||||||
INVARIANT_CHECK;
|
INVARIANT_CHECK;
|
||||||
|
|
||||||
if (m_torrent_file->num_pieces() == 0) return;
|
if (m_torrent_file->num_pieces() == 0) return;
|
||||||
bool was_finished = is_finished();
|
|
||||||
|
|
||||||
size_type position = 0;
|
size_type position = 0;
|
||||||
int piece_length = m_torrent_file->piece_length();
|
int piece_length = m_torrent_file->piece_length();
|
||||||
|
@ -1826,7 +1825,6 @@ namespace libtorrent
|
||||||
, bind(&set_if_greater, _1, m_file_priority[i]));
|
, bind(&set_if_greater, _1, m_file_priority[i]));
|
||||||
}
|
}
|
||||||
prioritize_pieces(pieces);
|
prioritize_pieces(pieces);
|
||||||
update_peer_interest(was_finished);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is called when piece priorities have been updated
|
// this is called when piece priorities have been updated
|
||||||
|
@ -1836,16 +1834,18 @@ namespace libtorrent
|
||||||
for (peer_iterator i = begin(); i != end(); ++i)
|
for (peer_iterator i = begin(); i != end(); ++i)
|
||||||
(*i)->update_interest();
|
(*i)->update_interest();
|
||||||
|
|
||||||
// if we used to be finished, but we aren't anymore
|
|
||||||
// we may need to connect to peers again
|
|
||||||
if (!is_finished() && was_finished)
|
|
||||||
m_policy.recalculate_connect_candidates();
|
|
||||||
|
|
||||||
// the torrent just became finished
|
// the torrent just became finished
|
||||||
if (is_finished() && !was_finished)
|
if (is_finished() && !was_finished)
|
||||||
|
{
|
||||||
finished();
|
finished();
|
||||||
|
}
|
||||||
else if (!is_finished() && was_finished)
|
else if (!is_finished() && was_finished)
|
||||||
|
{
|
||||||
|
// if we used to be finished, but we aren't anymore
|
||||||
|
// we may need to connect to peers again
|
||||||
resume_download();
|
resume_download();
|
||||||
|
m_policy.recalculate_connect_candidates();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void torrent::filter_piece(int index, bool filter)
|
void torrent::filter_piece(int index, bool filter)
|
||||||
|
@ -3147,9 +3147,9 @@ namespace libtorrent
|
||||||
// to make sure we're cleared the piece picker
|
// to make sure we're cleared the piece picker
|
||||||
if (is_seed()) completed();
|
if (is_seed()) completed();
|
||||||
|
|
||||||
// disconnect all seeds
|
// disconnect all seeds
|
||||||
// TODO: should disconnect all peers that have the pieces we have
|
// TODO: should disconnect all peers that have the pieces we have
|
||||||
// not just seeds
|
// not just seeds
|
||||||
std::vector<peer_connection*> seeds;
|
std::vector<peer_connection*> seeds;
|
||||||
for (peer_iterator i = m_connections.begin();
|
for (peer_iterator i = m_connections.begin();
|
||||||
i != m_connections.end(); ++i)
|
i != m_connections.end(); ++i)
|
||||||
|
@ -3265,6 +3265,12 @@ namespace libtorrent
|
||||||
|
|
||||||
set_state(torrent_status::downloading);
|
set_state(torrent_status::downloading);
|
||||||
|
|
||||||
|
if (m_ses.m_alerts.should_post<torrent_checked_alert>())
|
||||||
|
{
|
||||||
|
m_ses.m_alerts.post_alert(torrent_checked_alert(
|
||||||
|
get_handle()));
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_seed())
|
if (!is_seed())
|
||||||
{
|
{
|
||||||
if (m_sequential_download)
|
if (m_sequential_download)
|
||||||
|
@ -3274,6 +3280,13 @@ namespace libtorrent
|
||||||
// likely to be unpaused
|
// likely to be unpaused
|
||||||
if (m_ses.m_auto_manage_time_scaler > 1)
|
if (m_ses.m_auto_manage_time_scaler > 1)
|
||||||
m_ses.m_auto_manage_time_scaler = 1;
|
m_ses.m_auto_manage_time_scaler = 1;
|
||||||
|
|
||||||
|
if (is_finished()) finished();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_complete_sent = true;
|
||||||
|
finished();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
@ -3290,12 +3303,6 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (is_seed())
|
|
||||||
{
|
|
||||||
m_complete_sent = true;
|
|
||||||
finished();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_connections_initialized)
|
if (!m_connections_initialized)
|
||||||
{
|
{
|
||||||
m_connections_initialized = true;
|
m_connections_initialized = true;
|
||||||
|
@ -3311,12 +3318,6 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_ses.m_alerts.should_post<torrent_checked_alert>())
|
|
||||||
{
|
|
||||||
m_ses.m_alerts.post_alert(torrent_checked_alert(
|
|
||||||
get_handle()));
|
|
||||||
}
|
|
||||||
|
|
||||||
m_files_checked = true;
|
m_files_checked = true;
|
||||||
|
|
||||||
start_announcing();
|
start_announcing();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue