Singleton curlstore to save/reuse curl handles.
More...
#include <AampCurlStore.h>
|
| AampCurlStoreErrorCode | GetFromCurlStore (const std::string &hostname, AampCurlInstance CurlIndex, CURL **curl) |
| |
| AampCurlStoreErrorCode | GetFromCurlStoreBulk (const std::string &hostname, AampCurlInstance CurlIndex, int count, void *priv, bool HostCurlFd) |
| |
| void | KeepInCurlStore (const std::string &hostname, AampCurlInstance CurlIndex, CURL *curl) |
| |
| void | KeepInCurlStoreBulk (const std::string &hostname, AampCurlInstance CurlIndex, int count, void *priv, bool HostCurlFd) |
| |
| void | RemoveCurlSock (void) |
| |
| void | ShowCurlStoreData (bool trace=true) |
| |
| void | CurlInit (void *privContext, AampCurlInstance startIdx, unsigned int instanceCount, std::string proxyName, const std::string &remotehost=std::string("")) |
| |
| void | CurlTerm (void *privContext, AampCurlInstance startIdx, unsigned int instanceCount, const std::string &remotehost=std::string("")) |
| |
| CURL * | GetCurlHandle (void *pAamp, std::string url, AampCurlInstance startIdx) |
| |
| void | SaveCurlHandle (void *pAamp, std::string url, AampCurlInstance startIdx, CURL *curl) |
| |
| CurlSocketStoreStruct * | CreateCurlStore (const std::string &hostname) |
| |
| CURL * | CurlEasyInitWithOpt (void *privContext, const std::string &proxyName, int instId) |
| |
| CURL * | GetCurlHandleFromFreeQ (CurlSocketStoreStruct *CurlSock, int instId) |
| |
|
| CurlStore (const CurlStore &)=delete |
| |
|
CurlStore & | operator= (const CurlStore &)=delete |
| |
|
|
CurlSockData | umCurlSockDataStore |
| |
|
|
static CurlStore * | CurlInstance = NULL |
| |
|
static pthread_mutex_t | mCurlInstLock = PTHREAD_MUTEX_INITIALIZER |
| |
| static int | MaxCurlSockStore = 10 |
| |
Singleton curlstore to save/reuse curl handles.
Definition at line 100 of file AampCurlStore.h.
◆ GetFromCurlStore()
- Parameters
-
| [in] | hostname | - hostname part from url |
| [in] | CurlIndex | - Index of Curl instance |
| [out] | curl | - curl easy handle from curl store. |
- Returns
- AampCurlStoreErrorCode enum type
Definition at line 669 of file AampCurlStore.cpp.
◆ GetFromCurlStoreBulk()
- Parameters
-
| [in] | hostname | - hostname part from url |
| [in] | CurlIndex | - Index of Curl instance |
| [in] | count | - No of curl handles |
| [out] | priv | - curl easy handle from curl store will get stored in priv instance |
- Returns
- AampCurlStoreErrorCode enum type
Definition at line 590 of file AampCurlStore.cpp.
◆ KeepInCurlStore()
| void CurlStore::KeepInCurlStore |
( |
const std::string & |
hostname, |
|
|
AampCurlInstance |
CurlIndex, |
|
|
CURL * |
curl |
|
) |
| |
- Parameters
-
| [in] | hostname | - hostname part from url |
| [in] | CurlIndex | - Index of Curl instance |
| [in] | curl | - curl easy handle to save in curl store. |
- Returns
- void
Definition at line 782 of file AampCurlStore.cpp.
◆ KeepInCurlStoreBulk()
| void CurlStore::KeepInCurlStoreBulk |
( |
const std::string & |
hostname, |
|
|
AampCurlInstance |
CurlIndex, |
|
|
int |
count, |
|
|
void * |
priv, |
|
|
bool |
HostCurlFd |
|
) |
| |
- Parameters
-
| [in] | hostname | - hostname part from url |
| [in] | CurlIndex | - Index of Curl instance |
| [in] | count | - No of curl handles |
| [out] | priv | - curl easy handles in priv instance, saved in curl store |
- Returns
- void
Definition at line 729 of file AampCurlStore.cpp.
◆ RemoveCurlSock()
| void CurlStore::RemoveCurlSock |
( |
void |
| ) |
|
◆ ShowCurlStoreData()
| void CurlStore::ShowCurlStoreData |
( |
bool |
trace = true | ) |
|
- Parameters
-
| trace | - true to print curl store data, otherwise false. |
- Returns
- void
Definition at line 873 of file AampCurlStore.cpp.
◆ CurlInit()
| void CurlStore::CurlInit |
( |
void * |
privContext, |
|
|
AampCurlInstance |
startIdx, |
|
|
unsigned int |
instanceCount, |
|
|
std::string |
proxyName, |
|
|
const std::string & |
remotehost = std::string("") |
|
) |
| |
- Parameters
-
| [out] | privContext | - priv aamp instance in which created curl handles will be assigned |
| [in] | startIdx | - Index of Curl instance |
| [in] | instanceCount | - No of curl handles |
| [in] | proxyName | - proxy name |
- Returns
- void
Definition at line 393 of file AampCurlStore.cpp.
◆ CurlTerm()
| void CurlStore::CurlTerm |
( |
void * |
privContext, |
|
|
AampCurlInstance |
startIdx, |
|
|
unsigned int |
instanceCount, |
|
|
const std::string & |
remotehost = std::string("") |
|
) |
| |
- Parameters
-
| [out] | privContext | - priv aamp instance from which curl handles will be terminated or stored |
| [in] | startIdx | - Index of Curl instance |
| [in] | instanceCount | - No of curl handles |
- Returns
- void
Definition at line 468 of file AampCurlStore.cpp.
◆ GetCurlHandle()
| CURL * CurlStore::GetCurlHandle |
( |
void * |
pAamp, |
|
|
std::string |
url, |
|
|
AampCurlInstance |
startIdx |
|
) |
| |
- Parameters
-
| [in] | pAamp | - Private aamp instance |
| [in] | url | - request url |
| [in] | startIdx | - Index of curl instance. |
- Returns
- - curl easy handle
Definition at line 276 of file AampCurlStore.cpp.
◆ SaveCurlHandle()
| void CurlStore::SaveCurlHandle |
( |
void * |
pAamp, |
|
|
std::string |
url, |
|
|
AampCurlInstance |
startIdx, |
|
|
CURL * |
curl |
|
) |
| |
- Parameters
-
| [in] | pAamp | - Private aamp instance |
| [in] | url | - request url |
| [in] | startIdx | - Index of curl instance. |
| [in] | curl | - curl handle to be saved |
- Returns
- void
Definition at line 301 of file AampCurlStore.cpp.
◆ CreateCurlStore()
- Parameters
-
| [in] | hostname | - Host name to create a curl store |
- Returns
- - Curl store struct pointer
Definition at line 238 of file AampCurlStore.cpp.
◆ CurlEasyInitWithOpt()
| CURL * CurlStore::CurlEasyInitWithOpt |
( |
void * |
privContext, |
|
|
const std::string & |
proxyName, |
|
|
int |
instId |
|
) |
| |
- Parameters
-
| [in] | privContext | - Aamp context |
| [in] | proxyName | - Network proxy Name |
| [in] | instId | - Curl instance id |
- Returns
- - Curl easy handle
Definition at line 323 of file AampCurlStore.cpp.
◆ GetCurlHandleFromFreeQ()
- Parameters
-
| [in] | CurlSock | - Curl socket struct |
| [in] | instId | - Curl instance id |
- Returns
- - Curl easy handle
Definition at line 545 of file AampCurlStore.cpp.
◆ GetCurlStoreInstance()
| CurlStore * CurlStore::GetCurlStoreInstance |
( |
void * |
pContext | ) |
|
|
static |
◆ MaxCurlSockStore
| int CurlStore::MaxCurlSockStore = 10 |
|
staticprivate |
Maximum no of host to be maintained in curl store
Definition at line 105 of file AampCurlStore.h.
The documentation for this class was generated from the following files: