mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-18 14:26:24 +00:00
lt sync 2598
This commit is contained in:
parent
a997758eb2
commit
939c9f34a9
@ -617,6 +617,7 @@ namespace libtorrent
|
|||||||
size -= to_copy;
|
size -= to_copy;
|
||||||
block_offset = 0;
|
block_offset = 0;
|
||||||
buffer_offset += to_copy;
|
buffer_offset += to_copy;
|
||||||
|
++block;
|
||||||
}
|
}
|
||||||
ret = j.buffer_size;
|
ret = j.buffer_size;
|
||||||
++m_cache_stats.blocks_read;
|
++m_cache_stats.blocks_read;
|
||||||
|
@ -167,6 +167,7 @@ namespace
|
|||||||
, {"HL", "Halite"}
|
, {"HL", "Halite"}
|
||||||
, {"HN", "Hydranode"}
|
, {"HN", "Hydranode"}
|
||||||
, {"KT", "KTorrent"}
|
, {"KT", "KTorrent"}
|
||||||
|
, {"LC", "LeechCraft"}
|
||||||
, {"LK", "Linkage"}
|
, {"LK", "Linkage"}
|
||||||
, {"LP", "lphant"}
|
, {"LP", "lphant"}
|
||||||
, {"LT", "libtorrent"}
|
, {"LT", "libtorrent"}
|
||||||
|
@ -177,15 +177,15 @@ void natpmp::try_next_mapping(int i)
|
|||||||
|
|
||||||
#if defined(TORRENT_LOGGING) || defined(TORRENT_VERBOSE_LOGGING)
|
#if defined(TORRENT_LOGGING) || defined(TORRENT_VERBOSE_LOGGING)
|
||||||
ptime now = time_now();
|
ptime now = time_now();
|
||||||
for (std::vector<mapping_t>::iterator i = m_mappings.begin()
|
for (std::vector<mapping_t>::iterator m = m_mappings.begin()
|
||||||
, end(m_mappings.end()); i != end; ++i)
|
, end(m_mappings.end()); m != end; ++m)
|
||||||
{
|
{
|
||||||
m_log << " " << (i - m_mappings.begin()) << " [ "
|
m_log << " " << (m - m_mappings.begin()) << " [ "
|
||||||
"proto: " << (i->protocol == none ? "none" : i->protocol == tcp ? "tcp" : "udp")
|
"proto: " << (m->protocol == none ? "none" : m->protocol == tcp ? "tcp" : "udp")
|
||||||
<< " port: " << i->external_port
|
<< " port: " << m->external_port
|
||||||
<< " local-port: " << i->local_port
|
<< " local-port: " << m->local_port
|
||||||
<< " action: " << (i->action == mapping_t::action_none ? "none" : i->action == mapping_t::action_add ? "add" : "delete")
|
<< " action: " << (m->action == mapping_t::action_none ? "none" : m->action == mapping_t::action_add ? "add" : "delete")
|
||||||
<< " ttl: " << total_seconds(i->expires - now)
|
<< " ttl: " << total_seconds(m->expires - now)
|
||||||
<< " ]" << std::endl;
|
<< " ]" << std::endl;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1212,14 +1212,16 @@ namespace libtorrent
|
|||||||
// if this is a web seed. we don't have a peer_info struct
|
// if this is a web seed. we don't have a peer_info struct
|
||||||
if (m_peer_info) m_peer_info->seed = true;
|
if (m_peer_info) m_peer_info->seed = true;
|
||||||
m_upload_only = true;
|
m_upload_only = true;
|
||||||
disconnect_if_redundant();
|
|
||||||
if (is_disconnecting()) return;
|
|
||||||
|
|
||||||
m_have_piece.set_all();
|
m_have_piece.set_all();
|
||||||
m_num_pieces = num_pieces;
|
m_num_pieces = num_pieces;
|
||||||
t->peer_has_all();
|
t->peer_has_all();
|
||||||
if (!t->is_finished())
|
if (!t->is_finished())
|
||||||
t->get_policy().peer_is_interesting(*this);
|
t->get_policy().peer_is_interesting(*this);
|
||||||
|
|
||||||
|
disconnect_if_redundant();
|
||||||
|
if (is_disconnecting()) return;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1841,6 +1843,10 @@ namespace libtorrent
|
|||||||
// (since it doesn't exist yet)
|
// (since it doesn't exist yet)
|
||||||
if (!t->ready_for_connections())
|
if (!t->ready_for_connections())
|
||||||
{
|
{
|
||||||
|
// assume seeds are interesting when we
|
||||||
|
// don't even have the metadata
|
||||||
|
t->get_policy().peer_is_interesting(*this);
|
||||||
|
|
||||||
disconnect_if_redundant();
|
disconnect_if_redundant();
|
||||||
// TODO: this might need something more
|
// TODO: this might need something more
|
||||||
// so that once we have the metadata
|
// so that once we have the metadata
|
||||||
|
@ -848,6 +848,8 @@ namespace libtorrent
|
|||||||
|
|
||||||
restart_tracker_timer(time_now() + seconds(tracker_retry_delay_max));
|
restart_tracker_timer(time_now() + seconds(tracker_retry_delay_max));
|
||||||
|
|
||||||
|
if (m_abort) e = tracker_request::stopped;
|
||||||
|
|
||||||
if (e == tracker_request::none)
|
if (e == tracker_request::none)
|
||||||
{
|
{
|
||||||
if (!m_start_sent) e = tracker_request::started;
|
if (!m_start_sent) e = tracker_request::started;
|
||||||
@ -3393,6 +3395,20 @@ namespace libtorrent
|
|||||||
{
|
{
|
||||||
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
|
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
|
||||||
|
|
||||||
|
if (!m_ses.m_queued_for_checking.empty())
|
||||||
|
{
|
||||||
|
// if there are torrents waiting to be checked
|
||||||
|
// assert that there's a torrent that is being
|
||||||
|
// processed right now
|
||||||
|
int found = 0;
|
||||||
|
for (aux::session_impl::torrent_map::iterator i = m_ses.m_torrents.begin()
|
||||||
|
, end(m_ses.m_torrents.end()); i != end; ++i)
|
||||||
|
if (i->second->m_state == torrent_status::checking_files) ++found;
|
||||||
|
// the case of 2 is in the special case where one switches over from
|
||||||
|
// checking to complete
|
||||||
|
TORRENT_ASSERT(found == 1 || found == 2);
|
||||||
|
}
|
||||||
|
|
||||||
TORRENT_ASSERT(m_resume_entry.type() == lazy_entry::dict_t
|
TORRENT_ASSERT(m_resume_entry.type() == lazy_entry::dict_t
|
||||||
|| m_resume_entry.type() == lazy_entry::none_t);
|
|| m_resume_entry.type() == lazy_entry::none_t);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user