Refactor IpAddressImpl.cpp (Windows) + update changelog
This commit is contained in:
parent
63ee3ca8d4
commit
e8e3c29f37
|
|
@ -78,6 +78,7 @@ Nazara Engine:
|
||||||
- Added Collider3D::ForEachPolygon method, allowing construction of a debug mesh based on the physics collider
|
- Added Collider3D::ForEachPolygon method, allowing construction of a debug mesh based on the physics collider
|
||||||
- Fixed ConvexCollider3D::GetType returning Compound instead of ConvexHull.
|
- Fixed ConvexCollider3D::GetType returning Compound instead of ConvexHull.
|
||||||
- Dual-stack sockets are now supported (by using NetProtocol_Any at creation/opening)
|
- Dual-stack sockets are now supported (by using NetProtocol_Any at creation/opening)
|
||||||
|
- Fixed IPv6 addresses not being correctly encoded/decoded from the socket API.
|
||||||
|
|
||||||
Nazara Development Kit:
|
Nazara Development Kit:
|
||||||
- Added ImageWidget (#139)
|
- Added ImageWidget (#139)
|
||||||
|
|
|
||||||
|
|
@ -93,21 +93,14 @@ namespace Nz
|
||||||
{
|
{
|
||||||
sockaddr_in* ipv4 = reinterpret_cast<sockaddr_in*>(info->ai_addr);
|
sockaddr_in* ipv4 = reinterpret_cast<sockaddr_in*>(info->ai_addr);
|
||||||
|
|
||||||
auto& rawIpV4 = ipv4->sin_addr;
|
return FromSockAddr(ipv4);
|
||||||
return IpAddress(rawIpV4.s_net, rawIpV4.s_host, rawIpV4.s_lh, rawIpV4.s_impno, ntohs(ipv4->sin_port));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
{
|
{
|
||||||
sockaddr_in6* ipv6 = reinterpret_cast<sockaddr_in6*>(info->ai_addr);
|
sockaddr_in6* ipv6 = reinterpret_cast<sockaddr_in6*>(info->ai_addr);
|
||||||
|
|
||||||
auto& rawIpV6 = ipv6->sin6_addr.s6_addr;
|
return FromSockAddr(ipv6);
|
||||||
|
|
||||||
IpAddress::IPv6 structIpV6;
|
|
||||||
for (unsigned int i = 0; i < 8; ++i)
|
|
||||||
structIpV6[i] = UInt16(rawIpV6[i * 2]) << 8 | UInt16(rawIpV6[i * 2 + 1]);
|
|
||||||
|
|
||||||
return IpAddress(structIpV6, ntohs(ipv6->sin6_port));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -164,7 +157,7 @@ namespace Nz
|
||||||
|
|
||||||
IpAddress::IPv6 ipv6;
|
IpAddress::IPv6 ipv6;
|
||||||
for (unsigned int i = 0; i < 8; ++i)
|
for (unsigned int i = 0; i < 8; ++i)
|
||||||
ipv6[i] = rawIpV6[i*2] << 8 | rawIpV6[i*2+1];
|
ipv6[i] = rawIpV6[i * 2] << 8 | rawIpV6[i * 2 + 1];
|
||||||
|
|
||||||
return IpAddress(ipv6, ntohs(addressv6->sin6_port));
|
return IpAddress(ipv6, ntohs(addressv6->sin6_port));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue