socks5 update

This commit is contained in:
Arvid Norberg 2008-03-28 22:50:41 +00:00
parent 483da2483e
commit bed008b512
2 changed files with 3 additions and 5 deletions

View File

@ -220,8 +220,7 @@ namespace libtorrent
write_uint8(1, p); // CONNECT command
write_uint8(0, p); // reserved
write_uint8(m_remote_endpoint.address().is_v4()?1:4, p); // address type
write_address(m_remote_endpoint.address(), p);
write_uint16(m_remote_endpoint.port(), p);
write_endpoint(m_remote_endpoint, p);
TORRENT_ASSERT(p - &m_buffer[0] == int(m_buffer.size()));
asio::async_write(m_sock, asio::buffer(m_buffer)

View File

@ -151,13 +151,12 @@ void udp_socket::unwrap(asio::error_code const& e, char const* buf, int size)
if (atyp == 1)
{
// IPv4
sender.address(address_v4(read_uint32(p)));
sender.port(read_uint16(p));
sender = read_v4_endpoint<udp::endpoint>(p);
}
else if (atyp == 4)
{
// IPv6
TORRENT_ASSERT(false && "not supported yet");
sender = read_v6_endpoint<udp::endpoint>(p);
}
else
{