diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-10-10 02:17:19 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-10-10 02:17:19 -0300 |
| commit | cc4873e33866ba86561774a7e55449d59367661e (patch) | |
| tree | d9c60a3e3d5850e52aeb5b9a674871f8817012e9 /src/hostcache.cc | |
| parent | ddcba8ef56fe122a77e890a2740489045e3dc6a0 (diff) | |
| download | querymanager-cc4873e33866ba86561774a7e55449d59367661e.tar.gz querymanager-cc4873e33866ba86561774a7e55449d59367661e.zip | |
switch to blocking poll + fix config, signals, time, non-game login
Diffstat (limited to 'src/hostcache.cc')
| -rw-r--r-- | src/hostcache.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hostcache.cc b/src/hostcache.cc index 5cbc2fa..ef84def 100644 --- a/src/hostcache.cc +++ b/src/hostcache.cc @@ -62,10 +62,11 @@ bool ResolveHostName(const char *HostName, int *OutAddr){ THostCacheEntry *Entry = NULL; int LeastRecentlyUsedIndex = 0; int LeastRecentlyUsedTime = g_CachedHostNames[0].ResolveTime; + int TimeNow = GetMonotonicUptimeMS(); for(int i = 0; i < g_Config.MaxCachedHostNames; i += 1){ THostCacheEntry *Current = &g_CachedHostNames[i]; - if((g_MonotonicTimeMS - Current->ResolveTime) >= g_Config.HostNameExpireTime){ + if((TimeNow - Current->ResolveTime) >= g_Config.HostNameExpireTime){ memset(Current, 0, sizeof(THostCacheEntry)); } @@ -89,7 +90,7 @@ bool ResolveHostName(const char *HostName, int *OutAddr){ (int)strlen(HostName), (int)sizeof(Entry->HostName)); } Entry->Resolved = DoResolveHostName(HostName, &Entry->IPAddress); - Entry->ResolveTime = g_MonotonicTimeMS; + Entry->ResolveTime = TimeNow; } if(Entry && Entry->Resolved){ |
