socks5 update
This commit is contained in:
parent
483da2483e
commit
bed008b512
|
@ -220,8 +220,7 @@ namespace libtorrent
|
||||||
write_uint8(1, p); // CONNECT command
|
write_uint8(1, p); // CONNECT command
|
||||||
write_uint8(0, p); // reserved
|
write_uint8(0, p); // reserved
|
||||||
write_uint8(m_remote_endpoint.address().is_v4()?1:4, p); // address type
|
write_uint8(m_remote_endpoint.address().is_v4()?1:4, p); // address type
|
||||||
write_address(m_remote_endpoint.address(), p);
|
write_endpoint(m_remote_endpoint, p);
|
||||||
write_uint16(m_remote_endpoint.port(), p);
|
|
||||||
TORRENT_ASSERT(p - &m_buffer[0] == int(m_buffer.size()));
|
TORRENT_ASSERT(p - &m_buffer[0] == int(m_buffer.size()));
|
||||||
|
|
||||||
asio::async_write(m_sock, asio::buffer(m_buffer)
|
asio::async_write(m_sock, asio::buffer(m_buffer)
|
||||||
|
|
|
@ -151,13 +151,12 @@ void udp_socket::unwrap(asio::error_code const& e, char const* buf, int size)
|
||||||
if (atyp == 1)
|
if (atyp == 1)
|
||||||
{
|
{
|
||||||
// IPv4
|
// IPv4
|
||||||
sender.address(address_v4(read_uint32(p)));
|
sender = read_v4_endpoint<udp::endpoint>(p);
|
||||||
sender.port(read_uint16(p));
|
|
||||||
}
|
}
|
||||||
else if (atyp == 4)
|
else if (atyp == 4)
|
||||||
{
|
{
|
||||||
// IPv6
|
// IPv6
|
||||||
TORRENT_ASSERT(false && "not supported yet");
|
sender = read_v6_endpoint<udp::endpoint>(p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue