ddc
Classes | Typedefs | Functions | Variables
CCurl.h File Reference
#include "../CommonLib/utilit.h"
#include "../CommonLib/ddcString.h"
#include "../CommonLib/ddcConfig.h"
#include "../CommonLib/ddcThread.h"
#include "LRUCache.h"
#include <pthread.h>
#include <curl/curl.h>
Include dependency graph for CCurl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CCurl
 CCurl: abstract term expander using libcurl. More...
 

Typedefs

typedef CURL * CurlHandle
 
typedef struct curl_sockaddr struct_curl_sockaddr
 
typedef ddcLRUCache< std::string, std::string > CCurlCache
 curl response cache, maps URLs to responses More...
 

Functions

void ddcInitCurl (void)
 global initialization function (multiple calls should be safe) More...
 

Variables

pthread_mutex_t ddcCurlMutex
 global mutex for non-thread-safe curl operations (global init, lru-cached proxy) More...
 
int ddcCurlInitialized
 sentinel to determine whether curl_global_init() has been called More...
 
CCurlCache ddcCurlCache
 

Typedef Documentation

◆ CurlHandle

typedef CURL* CurlHandle

◆ struct_curl_sockaddr

typedef struct curl_sockaddr struct_curl_sockaddr

◆ CCurlCache

typedef ddcLRUCache<std::string,std::string> CCurlCache

curl response cache, maps URLs to responses

Function Documentation

◆ ddcInitCurl()

void ddcInitCurl ( void  )

global initialization function (multiple calls should be safe)

References DDC_IFPTHREAD, and ddcCurlMutex.

Referenced by CCurl::CCurl(), and ddcInitGlobal().

Here is the caller graph for this function:

Variable Documentation

◆ ddcCurlMutex

pthread_mutex_t ddcCurlMutex

global mutex for non-thread-safe curl operations (global init, lru-cached proxy)

Referenced by ddcInitCurl().

◆ ddcCurlInitialized

int ddcCurlInitialized

sentinel to determine whether curl_global_init() has been called

◆ ddcCurlCache

CCurlCache ddcCurlCache

global curl response cache to avoid TCP retransmissions due to multiple subcorpora converging on a single shared expander

Referenced by CDDCLeafServer::handle__clear_cache(), CDDCBranchServer::handle__clear_cache(), and CDDCLeafServer::handle__status().