AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
CurlHttpClient.h
1
7#pragma once
8
9#include <aws/core/Core_EXPORTS.h>
10#include <aws/core/http/HttpClient.h>
11#include <aws/core/http/curl/CurlHandleContainer.h>
12#include <aws/core/client/ClientConfiguration.h>
13#include <aws/core/utils/memory/stl/AWSString.h>
14#include <atomic>
15
16namespace Aws
17{
18namespace Http
19{
20namespace Standard
21{
23}
24
25//Curl implementation of an http client. Right now it is only synchronous.
26class AWS_CORE_API CurlHttpClient: public HttpClient
27{
28public:
29
31
32 //Creates client, initializes curl handle if it hasn't been created already.
34
35 //Makes request and receives response synchronously
36 std::shared_ptr<HttpResponse> MakeRequest(const std::shared_ptr<HttpRequest>& request,
38 Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter = nullptr) const override;
39
40 static void InitGlobalState();
41 static void CleanupGlobalState();
42
43protected:
48 virtual void OverrideOptionsOnConnectionHandle(CURL*) const {}
49
50private:
51 mutable CurlHandleContainer m_curlHandleContainer;
52 bool m_isAllowSystemProxy = false;
53 bool m_isUsingProxy = false;
54 Aws::String m_proxyUserName;
55 Aws::String m_proxyPassword;
56 Aws::String m_proxyScheme;
57 Aws::String m_proxyHost;
58 Aws::String m_proxySSLCertPath;
59 Aws::String m_proxySSLCertType;
60 Aws::String m_proxySSLKeyPath;
61 Aws::String m_proxySSLKeyType;
62 Aws::String m_proxyKeyPasswd;
63 unsigned m_proxyPort = 0;
64 Aws::String m_nonProxyHosts;
65 bool m_verifySSL = true;
66 Aws::String m_caPath;
67 Aws::String m_caFile;
68 Aws::String m_proxyCaPath;
69 Aws::String m_proxyCaFile;
70 bool m_disableExpectHeader = false;
71 bool m_allowRedirects = false;
72 bool m_enableHttpClientTrace = false;
73 Aws::Http::TransferLibPerformanceMode m_perfMode = TransferLibPerformanceMode::LOW_LATENCY;
74 static std::atomic<bool> isInit;
75 std::shared_ptr<smithy::components::tracing::TelemetryProvider> m_telemetryProvider;
76
77#if LIBCURL_VERSION_NUM >= 0x072000 // 7.32.0
78 static int CurlProgressCallback(void *userdata, curl_off_t, curl_off_t, curl_off_t, curl_off_t);
79#else
80 static int CurlProgressCallback(void *userdata, double, double, double, double);
81#endif
82};
83
85
86} // namespace Http
87} // namespace Aws
88
static void InitGlobalState()
virtual void OverrideOptionsOnConnectionHandle(CURL *) const
std::shared_ptr< HttpResponse > MakeRequest(const std::shared_ptr< HttpRequest > &request, Aws::Utils::RateLimits::RateLimiterInterface *readLimiter=nullptr, Aws::Utils::RateLimits::RateLimiterInterface *writeLimiter=nullptr) const override
static void CleanupGlobalState()
CurlHttpClient(const Aws::Client::ClientConfiguration &clientConfig)
TransferLibPerformanceMode
Definition HttpTypes.h:48
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition AWSString.h:97