merged close_redundant_connections fix from RC_0_16

This commit is contained in:
Arvid Norberg
2013-01-27 21:25:06 +00:00
parent a35c32bc51
commit bca1d62bbe
3 changed files with 23 additions and 13 deletions

View File

@@ -1853,6 +1853,11 @@ namespace libtorrent
if (m_upload_only_id == 0) return;
if (t->share_mode()) return;
// if we send upload-only, the other end is very likely to disconnect
// us, at least if it's a seed. If we don't want to close redundant
// connections, don't sent upload-only
if (!m_ses.settings().close_redundant_connections) return;
char msg[7] = {0, 0, 0, 3, msg_extended};
char* ptr = msg + 5;
detail::write_uint8(m_upload_only_id, ptr);