don't fail socks5 on 'socket already open'

This commit is contained in:
Arvid Norberg 2011-09-17 23:01:39 +00:00
parent 4e1af65fe0
commit 2a6b019431
1 changed files with 8 additions and 5 deletions

View File

@ -80,12 +80,15 @@ namespace libtorrent
}
error_code ec;
m_sock.open(i->endpoint().protocol(), ec);
if (ec)
if (!m_sock.is_open())
{
(*h)(ec);
close(ec);
return;
m_sock.open(i->endpoint().protocol(), ec);
if (ec)
{
(*h)(ec);
close(ec);
return;
}
}
// TOOD: we could bind the socket here, since we know what the