Lines Matching defs:handles
177 struct handle handles[HANDLECOUNT];
222 handles[i].idx = i;
223 handles[i].paused = 0;
224 handles[i].resumed = 0;
225 handles[i].h = curl_easy_init();
226 if(!handles[i].h ||
227 curl_easy_setopt(handles[i].h, CURLOPT_WRITEFUNCTION, cb) != CURLE_OK ||
228 curl_easy_setopt(handles[i].h, CURLOPT_WRITEDATA, &handles[i])
230 curl_easy_setopt(handles[i].h, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK ||
231 curl_easy_setopt(handles[i].h, CURLOPT_VERBOSE, 1L) != CURLE_OK ||
232 curl_easy_setopt(handles[i].h, CURLOPT_DEBUGFUNCTION, debug_cb)
234 curl_easy_setopt(handles[i].h, CURLOPT_SSL_VERIFYPEER, 0L) != CURLE_OK ||
235 curl_easy_setopt(handles[i].h, CURLOPT_RESOLVE, resolve) != CURLE_OK ||
236 curl_easy_setopt(handles[i].h, CURLOPT_URL, url) != CURLE_OK) {
246 if(curl_multi_add_handle(multi_handle, handles[i].h) != CURLM_OK)
257 fprintf(stderr, "INFO: no more handles running\n");
259 if(!handles[i].paused) {
263 else if(handles[i].paused != 1) {
265 i, handles[i].paused);
268 else if(!handles[i].resumed) {
274 fprintf(stderr, "ERROR: handles not in expected state "
287 if(msg->easy_handle == handles[i].h) {
288 if(handles[i].paused != 1 || !handles[i].resumed) {
290 "result %d - wtf?\n", i, handles[i].paused,
291 handles[i].resumed, msg->data.result);
303 if(!handles[i].paused) {
318 handles[i].resumed = 1;
319 curl_easy_pause(handles[i].h, CURLPAUSE_CONT);
326 curl_multi_remove_handle(multi_handle, handles[i].h);
327 curl_easy_cleanup(handles[i].h);