AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
CurlHandleContainer.h
1
6#pragma once
7
8#include <aws/core/utils/ResourceManager.h>
9#include <aws/core/http/Version.h>
10
11#include <utility>
12#include <curl/curl.h>
13
14namespace Aws
15{
16namespace Http
17{
18
26{
27public:
32 CurlHandleContainer(unsigned maxSize = 50, long httpRequestTimeout = 0, long connectTimeout = 1000, bool tcpKeepAlive = true,
33 unsigned long tcpKeepAliveIntervalMs = 30000, long lowSpeedTime = 3000, unsigned long lowSpeedLimit = 1,
36
45 void ReleaseCurlHandle(CURL* handle);
46
50 void DestroyCurlHandle(CURL* handle);
51
52private:
54 const CurlHandleContainer& operator = (const CurlHandleContainer&) = delete;
56 const CurlHandleContainer& operator = (const CurlHandleContainer&&) = delete;
57
58 CURL* CreateCurlHandleInPool();
59 bool CheckAndGrowPool();
60 void SetDefaultOptionsOnHandle(CURL* handle);
61 static long ConvertHttpVersion(Version version);
62
64 unsigned m_maxPoolSize;
65 unsigned long m_httpRequestTimeout;
66 unsigned long m_connectTimeout;
67 bool m_enableTcpKeepAlive;
68 unsigned long m_tcpKeepAliveIntervalMs;
69 unsigned long m_lowSpeedTime;
70 unsigned long m_lowSpeedLimit;
71 unsigned m_poolSize;
72 std::mutex m_containerLock;
73 Version m_version;
74};
75
76} // namespace Http
77} // namespace Aws
78
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)
void ReleaseCurlHandle(CURL *handle)
void DestroyCurlHandle(CURL *handle)