mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-09-22 19:29:21 +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:
@ -8,6 +8,7 @@
|
||||
#include "Table.h"
|
||||
|
||||
#include "Cfg.h"
|
||||
#include "DNS.h"
|
||||
#include "FileIO.h"
|
||||
#include "Internat.h"
|
||||
#include "Mayaqua.h"
|
||||
@ -1206,9 +1207,9 @@ bool LoadUnicodeCache(wchar_t *strfilename, UINT strfilesize, UCHAR *hash)
|
||||
Zero(&c, sizeof(c));
|
||||
UniToStr(c.StrFileName, sizeof(c.StrFileName), strfilename);
|
||||
c.StrFileSize = strfilesize;
|
||||
DisableNetworkNameCache();
|
||||
DnsCacheToggle(false);
|
||||
GetMachineName(c.MachineName, sizeof(c.MachineName));
|
||||
EnableNetworkNameCache();
|
||||
DnsCacheToggle(true);
|
||||
c.OsType = GetOsInfo()->OsType;
|
||||
Copy(c.hash, hash, MD5_SIZE);
|
||||
|
||||
|
Reference in New Issue
Block a user