From 9a63d4696ebec5743418181ef3411371d8e31b04 Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Tue, 28 Feb 2017 20:25:41 -0800 Subject: [PATCH] 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. --- src/web_connection_base.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/web_connection_base.cpp b/src/web_connection_base.cpp index 9391db38e..a3f0683d6 100644 --- a/src/web_connection_base.cpp +++ b/src/web_connection_base.cpp @@ -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(); }