forked from premiere/premiere-libtorrent
fixed reconnect delay when leaving upload only mode
This commit is contained in:
parent
d493b0f1a0
commit
65943e7ff7
|
@ -85,6 +85,7 @@
|
||||||
incoming connection
|
incoming connection
|
||||||
* added more detailed instrumentation of the disk I/O thread
|
* added more detailed instrumentation of the disk I/O thread
|
||||||
|
|
||||||
|
* fixed reconnect delay when leaving upload only mode
|
||||||
* fixed default values being set incorrectly in add_torrent_params through add_magnet_uri in python bindings
|
* fixed default values being set incorrectly in add_torrent_params through add_magnet_uri in python bindings
|
||||||
* implemented unaligned write (for unbuffered I/O)
|
* implemented unaligned write (for unbuffered I/O)
|
||||||
* fixed broadcast_lsd option
|
* fixed broadcast_lsd option
|
||||||
|
|
|
@ -1868,7 +1868,7 @@ namespace libtorrent
|
||||||
// don't close connections in share mode, we don't know if we need them
|
// don't close connections in share mode, we don't know if we need them
|
||||||
if (t->share_mode()) return;
|
if (t->share_mode()) return;
|
||||||
|
|
||||||
if (m_upload_only && t->is_finished())
|
if (m_upload_only && t->is_upload_only())
|
||||||
{
|
{
|
||||||
disconnect(errors::upload_upload_connection);
|
disconnect(errors::upload_upload_connection);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -986,6 +986,13 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// reset last_connected, to force fast reconnect after leaving upload mode
|
||||||
|
for (policy::iterator i = m_policy.begin_peer()
|
||||||
|
, end(m_policy.end_peer()); i != end; ++i)
|
||||||
|
{
|
||||||
|
(*i)->last_connected = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// send_block_requests on all peers
|
// send_block_requests on all peers
|
||||||
for (std::set<peer_connection*>::iterator i = m_connections.begin()
|
for (std::set<peer_connection*>::iterator i = m_connections.begin()
|
||||||
, end(m_connections.end()); i != end; ++i)
|
, end(m_connections.end()); i != end; ++i)
|
||||||
|
@ -5593,6 +5600,11 @@ namespace libtorrent
|
||||||
TORRENT_ASSERT(found >= 1);
|
TORRENT_ASSERT(found >= 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_finished())
|
||||||
|
{
|
||||||
|
TORRENT_ASSERT(is_upload_only());
|
||||||
|
}
|
||||||
|
|
||||||
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…
Reference in New Issue