the seed flag in the peer struct is updated when connected to a seed (will avoid trying to reconnect to a seed when we're also a seed)

This commit is contained in:
Arvid Norberg 2007-04-13 00:22:03 +00:00
parent 1254e140f7
commit 3293bf9b6e
1 changed files with 6 additions and 0 deletions

View File

@ -286,6 +286,8 @@ namespace libtorrent
#ifdef TORRENT_VERBOSE_LOGGING
(*m_logger) << " *** THIS IS A SEED ***\n";
#endif
assert(m_peer_info);
m_peer_info->seed = true;
// if we're a seed too, disconnect
if (t->is_seed())
{
@ -722,6 +724,8 @@ namespace libtorrent
if (is_seed())
{
assert(m_peer_info);
m_peer_info->seed = true;
t->get_policy().set_seed(*this);
if (t->is_seed())
{
@ -810,6 +814,8 @@ namespace libtorrent
#ifdef TORRENT_VERBOSE_LOGGING
(*m_logger) << " *** THIS IS A SEED ***\n";
#endif
assert(m_peer_info);
m_peer_info->seed = true;
t->get_policy().set_seed(*this);
// if we're a seed too, disconnect
if (t->is_seed())