Skip to content

Commit f98edcb

Browse files
Fixed issues #144, #154, #153.
1 parent ea9ff52 commit f98edcb

File tree

4 files changed

+1017
-1021
lines changed

4 files changed

+1017
-1021
lines changed

aws-cpp-sdk-core/source/http/windows/WinHttpConnectionPoolMgr.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ void* WinHttpConnectionPoolMgr::CreateNewConnection(const Aws::String& host, Hos
4343
{
4444
HINTERNET newConnection = WinHttpConnect(GetOpenHandle(), StringUtils::ToWString(host.c_str()).c_str(), connectionContainer.port, 0);
4545

46-
if (newConnection)
47-
{
48-
DWORD timeoutMs = GetConnectTimeout();
49-
DWORD requestMs = GetRequestTimeout();
50-
51-
WinHttpSetOption(newConnection, WINHTTP_OPTION_CONNECT_TIMEOUT, &timeoutMs, sizeof(timeoutMs));
52-
WinHttpSetOption(newConnection, WINHTTP_OPTION_RECEIVE_TIMEOUT, &requestMs, sizeof(requestMs));
53-
}
54-
5546
return newConnection;
5647
}
5748

aws-cpp-sdk-core/source/http/windows/WinHttpSyncHttpClient.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ WinHttpSyncHttpClient::WinHttpSyncHttpClient(const ClientConfiguration& config)
7777

7878
SetOpenHandle(WinHttpOpen(openString.c_str(), winhttpFlags, proxyString.c_str(), nullptr, 0));
7979

80+
if (!WinHttpSetTimeouts(GetOpenHandle(), config.connectTimeoutMs, config.connectTimeoutMs, -1, config.requestTimeoutMs))
81+
{
82+
AWS_LOGSTREAM_WARN(GetLogTag(), "Error setting timeouts " << GetLastError());
83+
}
84+
8085
//add proxy auth credentials to everything using this handle.
8186
if (isUsingProxy)
8287
{

aws-cpp-sdk-core/source/utils/OSVersionInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ Aws::String OSVersionInfo::ComputeOSVersionString() const
9090
return "non-windows/unknown";
9191

9292
#else
93-
OSVERSIONINFO versionInfo;
94-
ZeroMemory(&versionInfo, sizeof(OSVERSIONINFO));
95-
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
93+
OSVERSIONINFOA versionInfo;
94+
ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOA));
95+
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
9696
GetVersionExA(&versionInfo);
9797
Aws::StringStream ss;
9898
ss << "Windows/" << versionInfo.dwMajorVersion << "." << versionInfo.dwMinorVersion << "." << versionInfo.dwBuildNumber << "-" << versionInfo.szCSDVersion;

0 commit comments

Comments
 (0)