fix bug in self connect detection
This commit is contained in:
parent
7fe6c474ce
commit
18809681be
|
@ -635,11 +635,6 @@ namespace libtorrent
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ec2)
|
|
||||||
{
|
|
||||||
i->second.connection->disconnect(ec2.message().c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self_connection)
|
if (self_connection)
|
||||||
{
|
{
|
||||||
c.disconnect("connected to ourselves", 1);
|
c.disconnect("connected to ourselves", 1);
|
||||||
|
@ -650,7 +645,11 @@ namespace libtorrent
|
||||||
TORRENT_ASSERT(i->second.connection != &c);
|
TORRENT_ASSERT(i->second.connection != &c);
|
||||||
// the new connection is a local (outgoing) connection
|
// the new connection is a local (outgoing) connection
|
||||||
// or the current one is already connected
|
// or the current one is already connected
|
||||||
if (!i->second.connection->is_connecting() || c.is_local())
|
if (ec2)
|
||||||
|
{
|
||||||
|
i->second.connection->disconnect(ec2.message().c_str());
|
||||||
|
}
|
||||||
|
else if (!i->second.connection->is_connecting() || c.is_local())
|
||||||
{
|
{
|
||||||
c.disconnect("duplicate connection, closing");
|
c.disconnect("duplicate connection, closing");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue