tests/server: fix initialization on Windows Vista+

Make sure to call `curlx_now_init()` before the first call to
`curlx_now()`.

Before this patch the first `curlx_now()` used the non-Vista code path
calling `GetTickCount()` on Vista+. This is harmless, but the upcoming
PR #18009 is going to drop the non-Vista code path, causing a division
by zero at startup in test servers, without this fix.

Bug: https://github.com/curl/curl/pull/18009#issuecomment-3652154307

Closes #19973
This commit is contained in:
Viktor Szakats 2025-12-15 00:05:15 +01:00
parent 2399ec74c3
commit b10b7c1fce
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
9 changed files with 5 additions and 40 deletions

View file

@ -83,11 +83,6 @@ static int test_resolve(int argc, char *argv[])
return 1;
}
#ifdef _WIN32
if(win32_init())
return 2;
#endif
#ifdef CURLRES_IPV6
if(use_ipv6) {
/* Check that the system has IPv6 enabled before checking the resolver */