mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Correct useragent in http queries
Net struct init
This commit is contained in:
parent
6f44492238
commit
8903c68460
5 changed files with 13 additions and 4 deletions
|
@ -345,6 +345,8 @@ void UDPSocket::Bind(u16 port)
|
|||
if(m_addr_family == AF_INET6)
|
||||
{
|
||||
struct sockaddr_in6 address;
|
||||
memset(&address, 0, sizeof(address));
|
||||
|
||||
address.sin6_family = AF_INET6;
|
||||
address.sin6_addr = in6addr_any;
|
||||
address.sin6_port = htons(port);
|
||||
|
@ -360,6 +362,8 @@ void UDPSocket::Bind(u16 port)
|
|||
else
|
||||
{
|
||||
struct sockaddr_in address;
|
||||
memset(&address, 0, sizeof(address));
|
||||
|
||||
address.sin_family = AF_INET;
|
||||
address.sin_addr.s_addr = INADDR_ANY;
|
||||
address.sin_port = htons(port);
|
||||
|
@ -454,6 +458,7 @@ int UDPSocket::Receive(Address & sender, void * data, int size)
|
|||
if(m_addr_family == AF_INET6)
|
||||
{
|
||||
struct sockaddr_in6 address;
|
||||
memset(&address, 0, sizeof(address));
|
||||
socklen_t address_len = sizeof(address);
|
||||
|
||||
received = recvfrom(m_handle, (char *) data,
|
||||
|
@ -470,6 +475,8 @@ int UDPSocket::Receive(Address & sender, void * data, int size)
|
|||
else
|
||||
{
|
||||
struct sockaddr_in address;
|
||||
memset(&address, 0, sizeof(address));
|
||||
|
||||
socklen_t address_len = sizeof(address);
|
||||
|
||||
received = recvfrom(m_handle, (char *) data,
|
||||
|
@ -568,5 +575,3 @@ bool UDPSocket::WaitData(int timeout_ms)
|
|||
// There is data
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue