aboutsummaryrefslogtreecommitdiff
path: root/src/tool_doswin.h
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2020-01-24 03:34:52 -0500
committerJay Satiro <raysatiro@yahoo.com>2020-02-18 15:52:13 -0500
commit1fc0617dccc3fa138235f219e2eaa7b405d1162e (patch)
tree76d86ee1145e2e8dad7dc16f95c4a4b14f88898e /src/tool_doswin.h
parent3735107d62ad28d6e25bd94109ab9f2454c22116 (diff)
tool_util: Improve Windows version of tvnow()
- Change tool_util.c tvnow() for Windows to match more closely to timeval.c Curl_now(). - Create a win32 init function for the tool, since some initialization is required for the tvnow() changes. Prior to this change the monotonic time function used by curl in Windows was determined at build-time and not runtime. That was a problem because when curl was built targeted for compatibility with old versions of Windows (eg _WIN32_WINNT < 0x0600) it would use GetTickCount which wraps every 49.7 days that Windows has been running. This change makes curl behave similar to libcurl's tvnow function, which determines at runtime whether the OS is Vista+ and if so calls QueryPerformanceCounter instead. (Note QueryPerformanceCounter is used because it has higher resolution than the more obvious candidate GetTickCount64). The changes to tvnow are basically a copy and paste but the types in some cases are different. Ref: https://github.com/curl/curl/issues/3309 Closes https://github.com/curl/curl/pull/4847
Diffstat (limited to 'src/tool_doswin.h')
-rw-r--r--src/tool_doswin.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tool_doswin.h b/src/tool_doswin.h
index 457637665..aba31b0bd 100644
--- a/src/tool_doswin.h
+++ b/src/tool_doswin.h
@@ -61,6 +61,7 @@ CURLcode FindWin32CACert(struct OperationConfig *config,
curl_sslbackend backend,
const char *bundle_file);
struct curl_slist *GetLoadedModulePaths(void);
+CURLcode win32_init(void);
#endif /* WIN32 */