From fddd1ee8e20ce6bf2ed5b6b803873d4595f0985c Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 7 Sep 2008 01:01:25 +0000 Subject: [PATCH] fixed assert when connecting to upload-only peers --- include/libtorrent/peer_connection.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index c9fd1ec5c..4be5d772b 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -215,7 +215,12 @@ namespace libtorrent bool is_seed() const; - void set_upload_only(bool u) { m_upload_only = u; } + void set_upload_only(bool u) + { + m_upload_only = u; + disconnect_if_redundant(); + } + bool upload_only() const { return m_upload_only; } // will send a keep-alive message to the peer