mark connection as upload only manually instead of with set_upload_only()

We can't call set_upload_only() in this context because it can trigger an invariant
check in the torrent and m_num_connecting is not consistent.
This commit is contained in:
Steven Siloti 2017-02-28 20:25:41 -08:00 committed by Arvid Norberg
parent a42d4390c0
commit 9a63d4696e
1 changed files with 5 additions and 1 deletions

View File

@ -113,7 +113,11 @@ namespace libtorrent
void web_connection_base::start()
{
set_upload_only(true);
// avoid calling torrent::set_seed because it calls torrent::check_invariant
// which fails because the m_num_connecting count is not consistent until
// after we call peer_connection::start
m_upload_only = true;
disconnect_if_redundant();
if (is_disconnecting()) return;
peer_connection::start();
}