made redundant connction closing optional (defaults to on)
This commit is contained in:
parent
a01c412f9e
commit
971ead4a44
|
@ -2820,6 +2820,7 @@ that will be sent to the tracker. The user-agent is a good way to identify your
|
|||
float share_ratio_limit;
|
||||
float seed_time_ratio_limit;
|
||||
int seed_time_limit;
|
||||
bool close_redundant_connections;
|
||||
};
|
||||
|
||||
``user_agent`` this is the client identification to the tracker.
|
||||
|
@ -3040,6 +3041,11 @@ for considering a seeding torrent to have met the seed limit criteria. See queui
|
|||
(specified in seconds) before it is considered having met the seed limit criteria.
|
||||
See queuing_.
|
||||
|
||||
``close_redundant_connections`` specifies whether libtorrent should close
|
||||
connections where both ends have no utility in keeping the connection open.
|
||||
For instance if both ends have completed their downloads, there's no point
|
||||
in keeping it open. This defaults to ``true``.
|
||||
|
||||
|
||||
pe_settings
|
||||
===========
|
||||
|
|
|
@ -1109,7 +1109,7 @@ namespace libtorrent
|
|||
{
|
||||
TORRENT_ASSERT(m_peer_info);
|
||||
m_peer_info->seed = true;
|
||||
if (t->is_finished())
|
||||
if (t->is_finished() && m_ses.settings().close_redundant_connections)
|
||||
{
|
||||
disconnect("seed to seed connection redundant");
|
||||
return;
|
||||
|
@ -1186,7 +1186,7 @@ namespace libtorrent
|
|||
// if this is a web seed. we don't have a peer_info struct
|
||||
if (m_peer_info) m_peer_info->seed = true;
|
||||
// if we're a seed too, disconnect
|
||||
if (t->is_finished())
|
||||
if (t->is_finished() && m_ses.settings().close_redundant_connections)
|
||||
{
|
||||
disconnect("seed to seed connection redundant, disconnecting");
|
||||
return;
|
||||
|
@ -1751,7 +1751,7 @@ namespace libtorrent
|
|||
#endif
|
||||
|
||||
// if we're a seed too, disconnect
|
||||
if (t->is_finished())
|
||||
if (t->is_finished() && m_ses.settings().close_redundant_connections)
|
||||
{
|
||||
disconnect("seed to seed connection redundant, disconnecting");
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue