mirror of
https://github.com/curl/curl.git
synced 2026-01-18 17:21:26 +01:00
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:
@@ -474,11 +474,6 @@ static int test_dnsd(int argc, char **argv)
|
||||
snprintf(loglockfile, sizeof(loglockfile), "%s/%s/dnsd-%s.lock",
|
||||
logdir, SERVERLOGS_LOCKDIR, ipv_inuse);
|
||||
|
||||
#ifdef _WIN32
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
#ifdef USE_IPV6
|
||||
if(!use_ipv6)
|
||||
#endif
|
||||
|
||||
@@ -51,5 +51,10 @@ int main(int argc, char **argv)
|
||||
return 99;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
return entry_func(argc - 1, argv + 1);
|
||||
}
|
||||
|
||||
@@ -822,11 +822,6 @@ static int test_mqttd(int argc, char *argv[])
|
||||
snprintf(loglockfile, sizeof(loglockfile), "%s/%s/mqtt-%s.lock",
|
||||
logdir, SERVERLOGS_LOCKDIR, ipv_inuse);
|
||||
|
||||
#ifdef _WIN32
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
CURLX_SET_BINMODE(stdout);
|
||||
CURLX_SET_BINMODE(stderr);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -1100,11 +1100,6 @@ static int test_rtspd(int argc, char *argv[])
|
||||
snprintf(loglockfile, sizeof(loglockfile), "%s/%s/rtsp-%s.lock",
|
||||
logdir, SERVERLOGS_LOCKDIR, ipv_inuse);
|
||||
|
||||
#ifdef _WIN32
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
install_signal_handlers(false);
|
||||
|
||||
#ifdef USE_IPV6
|
||||
|
||||
@@ -1313,11 +1313,6 @@ static int test_sockfilt(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
CURLX_SET_BINMODE(stdout);
|
||||
CURLX_SET_BINMODE(stderr);
|
||||
|
||||
@@ -875,11 +875,6 @@ static int test_socksd(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
CURLX_SET_BINMODE(stdout);
|
||||
CURLX_SET_BINMODE(stderr);
|
||||
|
||||
@@ -2159,11 +2159,6 @@ static int test_sws(int argc, char *argv[])
|
||||
logdir, SERVERLOGS_LOCKDIR, protocol_type,
|
||||
is_proxy ? "-proxy" : "", socket_type);
|
||||
|
||||
#ifdef _WIN32
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
install_signal_handlers(false);
|
||||
|
||||
req = calloc(1, sizeof(*req));
|
||||
|
||||
@@ -647,11 +647,6 @@ static int test_tftpd(int argc, char **argv)
|
||||
snprintf(loglockfile, sizeof(loglockfile), "%s/%s/tftp-%s.lock",
|
||||
logdir, SERVERLOGS_LOCKDIR, ipv_inuse);
|
||||
|
||||
#ifdef _WIN32
|
||||
if(win32_init())
|
||||
return 2;
|
||||
#endif
|
||||
|
||||
install_signal_handlers(true);
|
||||
|
||||
#ifdef USE_IPV6
|
||||
|
||||
Reference in New Issue
Block a user