curl_easy_setopt(curl_easy, CURLOPT_URL, pui->src_str);
curl_easy_setopt(curl_easy, CURLOPT_WRITEDATA, f);
g_hash_table_insert(pui_by_easy, curl_easy, pui);
- if (!_curl_multi) {
- /* Initialize CURL. */
- _curl_multi = curl_multi_init();
- /*curl_multi_setopt(_curl_multi, CURLMOPT_PIPELINING, 1); */
- }
curl_multi_add_handle(_curl_multi, curl_easy);
num_transfers++;
} else {
while ((curr = g_queue_pop_tail(curl_easy_queue)))
curl_easy_cleanup(curr);
- curl_multi_cleanup(_curl_multi);
- _curl_multi = NULL;
-
_curl_sid = 0;
return FALSE;
}
pui_tree = g_tree_new_full((GCompareDataFunc)download_comparefunc, NULL, (GDestroyNotify) progress_update_info_free, NULL);
downloading_tree = g_tree_new_full((GCompareDataFunc)download_comparefunc, NULL, (GDestroyNotify) progress_update_info_free, NULL);
pui_by_easy = g_hash_table_new(g_direct_hash, g_direct_equal);
+_curl_multi = curl_multi_init();
+/* curl_multi_setopt(_curl_multi, CURLMOPT_PIPELINING, 1); */
}
gboolean
g_debug("Stopping downloads");
while ((curr = g_queue_pop_tail(curl_easy_queue)))
curl_easy_cleanup(curr);
- curl_multi_cleanup(_curl_multi);
- _curl_multi = NULL;
return TRUE;
}
g_debug("No downloads to stop");
g_hash_table_destroy(pui_by_easy);
if (curl_easy_queue)
g_queue_free(curl_easy_queue);
+ curl_multi_cleanup(_curl_multi);
+ _curl_multi = NULL;
}
if (_curl_sid) {