AWS SDK for C++  1.9.123
AWS SDK for C++
WinSyncHttpClient.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 
10 #include <aws/core/utils/memory/stl/AwsStringStream.h>
14 
15 namespace Aws
16 {
17  namespace Client
18  {
19  struct ClientConfiguration;
20  } // namespace Client
21 
22  namespace Http
23  {
24 
25  class WinConnectionPoolMgr;
26 
32  {
33  public:
34  using Base = HttpClient;
35 
36  virtual ~WinSyncHttpClient();
37 
41  std::shared_ptr<HttpResponse> MakeRequest(const std::shared_ptr<HttpRequest>& request,
42  Aws::Utils::RateLimits::RateLimiterInterface* readLimiter = nullptr,
43  Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter = nullptr) const override;
44 
48  virtual const char* GetLogTag() const { return "WinSyncHttpClient"; }
49  protected:
53  void SetOpenHandle(void* handle);
57  void* GetOpenHandle() const { return m_openHandle; }
65  WinConnectionPoolMgr* GetConnectionPoolManager() const { return m_connectionPoolMgr; }
69  void* AllocateWindowsHttpRequest(const std::shared_ptr<Aws::Http::HttpRequest>& request, void* connection) const;
74  virtual void OverrideOptionsOnConnectionHandle(void*) const {}
79  virtual void OverrideOptionsOnRequestHandle(void*) const {}
84 
85  private:
86  virtual void* OpenRequest(const std::shared_ptr<HttpRequest>& request, void* connection, const Aws::StringStream& ss) const = 0;
87  virtual void DoAddHeaders(void* hHttpRequest, Aws::String& headerStr) const = 0;
88  virtual uint64_t DoWriteData(void* hHttpRequest, char* streamBuffer, uint64_t bytesRead, bool isChunked) const = 0;
89  virtual uint64_t FinalizeWriteData(void* hHttpRequest) const = 0;
90  virtual bool DoReceiveResponse(void* hHttpRequest) const = 0;
91  virtual bool DoQueryHeaders(void* hHttpRequest, std::shared_ptr<Aws::Http::HttpResponse>& response, Aws::StringStream& ss, uint64_t& read) const = 0;
92  virtual bool DoSendRequest(void* hHttpRequest) const = 0;
93  virtual bool DoReadData(void* hHttpRequest, char* body, uint64_t size, uint64_t& read) const = 0;
94  virtual void* GetClientModule() const = 0;
95 
96  bool StreamPayloadToRequest(const std::shared_ptr<HttpRequest>& request, void* hHttpRequest, Aws::Utils::RateLimits::RateLimiterInterface* writeLimiter) const;
97  void LogRequestInternalFailure() const;
98  bool BuildSuccessResponse(const std::shared_ptr<HttpRequest>& request, std::shared_ptr<Aws::Http::HttpResponse>& response, void* hHttpRequest, Aws::Utils::RateLimits::RateLimiterInterface* readLimiter) const;
99  void AddHeadersToRequest(const std::shared_ptr<HttpRequest>& request, void* hHttpRequest) const;
100 
101  void* m_openHandle;
102  //we need control over the order in which this gets cleaned up
103  //that's why I'm not using unique_ptr here.
104  WinConnectionPoolMgr* m_connectionPoolMgr;
105  };
106  } // namespace Http
107 } // namespace Aws
108 
Aws::DirectoryService::Model::LDAPSType::NOT_SET
@ NOT_SET
AWS_CORE_API
#define AWS_CORE_API
Definition: Core_EXPORTS.h:25
StandardHttpResponse.h
Aws::Http::WinSyncHttpClient::GetConnectionPoolManager
WinConnectionPoolMgr * GetConnectionPoolManager() const
Definition: WinSyncHttpClient.h:65
Aws::Http::WinSyncHttpClient::OverrideOptionsOnConnectionHandle
virtual void OverrideOptionsOnConnectionHandle(void *) const
Definition: WinSyncHttpClient.h:74
Aws::Http::WinSyncHttpClient::GetOpenHandle
void * GetOpenHandle() const
Definition: WinSyncHttpClient.h:57
Aws::Http::WinSyncHttpClient::SetConnectionPoolManager
void SetConnectionPoolManager(WinConnectionPoolMgr *connectionMgr)
Aws::Http::WinSyncHttpClient::SetOpenHandle
void SetOpenHandle(void *handle)
Aws::Http::WinConnectionPoolMgr
Definition: WinConnectionPoolMgr.h:27
Aws::Http::WinSyncHttpClient::~WinSyncHttpClient
virtual ~WinSyncHttpClient()
Aws::Http::WinSyncHttpClient::GetLogTag
virtual const char * GetLogTag() const
Definition: WinSyncHttpClient.h:48
Aws::Http::WinSyncHttpClient
Definition: WinSyncHttpClient.h:32
HttpClient.h
AWSAuthSigner.h
Aws::Http::WinSyncHttpClient::MakeRequest
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
Aws::Http::HttpClient
Definition: HttpClient.h:34
Core_EXPORTS.h
Aws
Definition: AccessManagementClient.h:15
Aws::Utils::RateLimits::RateLimiterInterface
Definition: RateLimiterInterface.h:24
Aws::String
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
Aws::Http::WinSyncHttpClient::m_allowRedirects
bool m_allowRedirects
Definition: WinSyncHttpClient.h:83
Aws::StringStream
std::basic_stringstream< char, std::char_traits< char >, Aws::Allocator< char > > StringStream
Definition: AWSStringStream.h:35
Aws::Http::WinSyncHttpClient::OverrideOptionsOnRequestHandle
virtual void OverrideOptionsOnRequestHandle(void *) const
Definition: WinSyncHttpClient.h:79
Aws::Http::WinSyncHttpClient::AllocateWindowsHttpRequest
void * AllocateWindowsHttpRequest(const std::shared_ptr< Aws::Http::HttpRequest > &request, void *connection) const