fix socks5 error handling

This commit is contained in:
Arvid Norberg 2010-08-08 04:11:59 +00:00
parent cbc7bd078d
commit ceb5700588
1 changed files with 9 additions and 1 deletions

View File

@ -79,7 +79,15 @@ namespace libtorrent
return;
}
m_sock.open(i->endpoint().protocol());
error_code ec;
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
// target endpoint is of the proxy
m_sock.async_connect(i->endpoint(), boost::bind(