25#define _HandlePool_h 1
46 pthread_mutex_t &m_mutex;
53 Lock(pthread_mutex_t &lock);
67 std::shared_ptr<http::url> d_url;
69 char d_errbuf[CURL_ERROR_SIZE];
71 curl_slist *d_request_headers;
97 unsigned int d_max_easy_handles;
98 std::vector<dmrpp_easy_handle *> d_easy_handles;
99 pthread_mutex_t d_get_easy_handle_mutex;
110 for (
auto i = d_easy_handles.begin(), e = d_easy_handles.end(); i != e; ++i) {
117 {
return d_max_easy_handles; }
119 unsigned int get_handles_available()
const
122 for (
auto i = d_easy_handles.begin(), e = d_easy_handles.end(); i != e; ++i) {
123 if (!(*i)->d_in_use) {
150 std::vector<dmrpp_easy_handle *> d_handles;
157 d_handles.push_back(h);
162 for (
auto i = d_handles.begin(), e = d_handles.end(); i != e; ++i) {
169 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.