fixed reconnect delay when leaving upload only mode

This commit is contained in:
Arvid Norberg 2011-03-25 05:14:14 +00:00
parent d493b0f1a0
commit 65943e7ff7
3 changed files with 14 additions and 1 deletions

View File

@ -85,6 +85,7 @@
incoming connection
* 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
* implemented unaligned write (for unbuffered I/O)
* fixed broadcast_lsd option

View File

@ -1868,7 +1868,7 @@ namespace libtorrent
// don't close connections in share mode, we don't know if we need them
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);
return;

View File

@ -986,6 +986,13 @@ namespace libtorrent
}
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
for (std::set<peer_connection*>::iterator i = m_connections.begin()
, end(m_connections.end()); i != end; ++i)
@ -5593,6 +5600,11 @@ namespace libtorrent
TORRENT_ASSERT(found >= 1);
}
if (is_finished())
{
TORRENT_ASSERT(is_upload_only());
}
TORRENT_ASSERT(m_resume_entry.type() == lazy_entry::dict_t
|| m_resume_entry.type() == lazy_entry::none_t);