25 #define _HandlePool_h 1
32 #include <curl/curl.h>
43 pthread_mutex_t &m_mutex;
50 Lock(pthread_mutex_t &lock);
66 char d_errbuf[CURL_ERROR_SIZE];
68 curl_slist *d_request_headers;
94 unsigned int d_max_easy_handles;
95 std::vector<dmrpp_easy_handle *> d_easy_handles;
96 pthread_mutex_t d_get_easy_handle_mutex;
107 for (
auto i = d_easy_handles.begin(), e = d_easy_handles.end(); i != e; ++i) {
114 {
return d_max_easy_handles; }
116 unsigned int get_handles_available()
const
119 for (
auto i = d_easy_handles.begin(), e = d_easy_handles.end(); i != e; ++i) {
120 if (!(*i)->d_in_use) {
147 std::vector<dmrpp_easy_handle *> d_handles;
154 d_handles.push_back(h);
159 for (
auto i = d_handles.begin(), e = d_handles.end(); i != e; ++i) {
166 d_handles.push_back(h);
void release_handle(dmrpp_easy_handle *h)
unsigned int get_max_handles() const
Get the number of handles in the pool.
void release_all_handles()
dmrpp_easy_handle * get_easy_handle(Chunk *chunk)
Add the given header & value to the curl slist.
Bundle a libcurl easy handle with other information.
void read_data()
This is the read_data() method for all transfers.
dmrpp_easy_handle()
Build a string with hex info about stuff libcurl gets.