Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/aws-cpp-sdk-core/include/aws/core/client/ClientConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,16 @@ namespace Aws
*/
bool disableExpectHeader = false;

/**
* Only works for Curl http client.
* Sets the timeout in milliseconds that Curl will wait for a 100-Continue response from the server
* before sending the request body. This corresponds to CURLOPT_EXPECT_100_TIMEOUT_MS.
* Useful when operating behind proxies that introduce network delays, where the default 1000ms
* may be too short and cause IncompleteBody errors.
* Default 1000ms (Curl's built-in default).
*/
long expect100ContinueTimeoutMs = 1000;

/**
* If set to true clock skew will be adjusted after each http attempt, default to true.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CurlHandleContainer
*/
CurlHandleContainer(unsigned maxSize = 50, long httpRequestTimeout = 0, long connectTimeout = 1000, bool tcpKeepAlive = true,
unsigned long tcpKeepAliveIntervalMs = 30000, long lowSpeedTime = 3000, unsigned long lowSpeedLimit = 1,
Version version = Version::HTTP_VERSION_2TLS);
Version version = Version::HTTP_VERSION_2TLS, long expect100ContinueTimeoutMs = 1000);
~CurlHandleContainer();

/**
Expand Down Expand Up @@ -71,6 +71,7 @@ class CurlHandleContainer
unsigned m_poolSize;
std::mutex m_containerLock;
Version m_version;
long m_expect100ContinueTimeoutMs;
};

} // namespace Http
Expand Down
1 change: 1 addition & 0 deletions src/aws-cpp-sdk-core/source/client/ClientConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ void setLegacyClientConfigurationParameters(ClientConfiguration& clientConfig)
clientConfig.httpClientChunkedMode = HttpClientChunkedMode::CLIENT_IMPLEMENTATION;
clientConfig.followRedirects = FollowRedirectsPolicy::DEFAULT;
clientConfig.disableExpectHeader = false;
clientConfig.expect100ContinueTimeoutMs = 1000;
clientConfig.enableClockSkewAdjustment = true;
clientConfig.enableHostPrefixInjection = true;
clientConfig.enableHttpClientTrace = false;
Expand Down
5 changes: 3 additions & 2 deletions src/aws-cpp-sdk-core/source/http/curl/CurlHandleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ static const char* CURL_HANDLE_CONTAINER_TAG = "CurlHandleContainer";

CurlHandleContainer::CurlHandleContainer(unsigned maxSize, long httpRequestTimeout, long connectTimeout, bool enableTcpKeepAlive,
unsigned long tcpKeepAliveIntervalMs, long lowSpeedTime, unsigned long lowSpeedLimit,
Version version) :
Version version, long expect100ContinueTimeoutMs) :
m_maxPoolSize(maxSize), m_httpRequestTimeout(httpRequestTimeout), m_connectTimeout(connectTimeout), m_enableTcpKeepAlive(enableTcpKeepAlive),
m_tcpKeepAliveIntervalMs(tcpKeepAliveIntervalMs), m_lowSpeedTime(lowSpeedTime), m_lowSpeedLimit(lowSpeedLimit), m_poolSize(0),
m_version(version)
m_version(version), m_expect100ContinueTimeoutMs(expect100ContinueTimeoutMs)
{
AWS_LOGSTREAM_INFO(CURL_HANDLE_CONTAINER_TAG, "Initializing CurlHandleContainer with size " << maxSize);
}
Expand Down Expand Up @@ -174,6 +174,7 @@ void CurlHandleContainer::SetDefaultOptionsOnHandle(CURL* handle)
curl_easy_setopt(handle, CURLOPT_TCP_KEEPIDLE, m_tcpKeepAliveIntervalMs / 1000);
curl_easy_setopt(handle, CURLOPT_HTTP_VERSION, ConvertHttpVersion(m_version));
curl_easy_setopt(handle, CURLOPT_MAXCONNECTS, m_maxPoolSize);
curl_easy_setopt(handle, CURLOPT_EXPECT_100_TIMEOUT_MS, m_expect100ContinueTimeoutMs);
}

long CurlHandleContainer::ConvertHttpVersion(Version version) {
Expand Down
3 changes: 2 additions & 1 deletion src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,8 @@ const bool FORCE_ENABLE_CURL_LOGGING = false;
CurlHttpClient::CurlHttpClient(const ClientConfiguration& clientConfig) :
Base(),
m_curlHandleContainer(clientConfig.maxConnections, clientConfig.httpRequestTimeoutMs, clientConfig.connectTimeoutMs, clientConfig.enableTcpKeepAlive,
clientConfig.tcpKeepAliveIntervalMs, clientConfig.requestTimeoutMs, clientConfig.lowSpeedLimit, clientConfig.version),
clientConfig.tcpKeepAliveIntervalMs, clientConfig.requestTimeoutMs, clientConfig.lowSpeedLimit, clientConfig.version,
clientConfig.expect100ContinueTimeoutMs),
m_isAllowSystemProxy(clientConfig.allowSystemProxy), m_isUsingProxy(!clientConfig.proxyHost.empty()), m_proxyUserName(clientConfig.proxyUserName),
m_proxyPassword(clientConfig.proxyPassword), m_proxyScheme(SchemeMapper::ToString(clientConfig.proxyScheme)), m_proxyHost(clientConfig.proxyHost),
m_proxySSLCertPath(clientConfig.proxySSLCertPath), m_proxySSLCertType(clientConfig.proxySSLCertType),
Expand Down
Loading