mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-12 10:44:58 +03:00
Rewrite DNS API from scratch into dedicated file(s)
From a functional point of view, the main improvement is that GetIP() now always prioritizes IPv6 over IPv4. The previous implementation always returned an IPv4 address, unless not available: in such case it failed. This means that now connections to hostnames should be established via IPv6 if available. From a programmer point of view, getting rid of the insane wrappers is enough to justify a complete rewrite. As an extra, several unrelated unused global variables are removed.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
// TODO: Mayaqua should not depend on Cedar.
|
||||
#include "Cedar/WinUi.h"
|
||||
|
||||
#include "DNS.h"
|
||||
#include "Memory.h"
|
||||
#include "Str.h"
|
||||
|
||||
@ -550,8 +551,8 @@ UINT ProxySocks4Connect(PROXY_PARAM_OUT *out, PROXY_PARAM_IN *in, volatile bool
|
||||
|
||||
Zero(out, sizeof(PROXY_PARAM_OUT));
|
||||
|
||||
// Get the IP address of the destination server
|
||||
if (GetIP(&target_ip, in->TargetHostname) == false)
|
||||
// Get the IPv4 address of the destination server (SOCKS4 does not support IPv6).
|
||||
if (GetIP4(&target_ip, in->TargetHostname) == false)
|
||||
{
|
||||
return PROXY_ERROR_CONNECTION;
|
||||
}
|
||||
|
Reference in New Issue
Block a user