Mailing Lists
![]() |
|
![]() |
|
cURL ![]() ![]() ![]() curlpp mailing list Archives
[cURLpp] non blocking single transfers and callbacks to progress bar updates
From: Leigh <leighm_at_linuxbandwagon.com>
Date: Wed, 15 Jun 2005 12:10:59 +1000
Hi all!
just working off the form post example, have read a fair bit about adding a
Also, any ideas on making the whole show non-blocking so my UI can keep ticking
-- if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; else result = Curl_speedcheck(data, k->now); if (result) return result; --- Heres the code i am using.. connection::connection() { curl_global_init(CURL_GLOBAL_ALL); curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "sendfile", CURLFORM_FILE, infile, CURLFORM_END); curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "filename", CURLFORM_COPYCONTENTS, infile, CURLFORM_END); curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "submit", CURLFORM_COPYCONTENTS, "send", CURLFORM_END); curl = curl_easy_init(); headerlist = curl_slist_append(headerlist, buf); if(curl) { /* what URL that receives this POST */ curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE); curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); res = curl_easy_perform(curl); --- } int connection::progress_callback(void *nothing, double dltotal, double dlnow, double ultotal, double ulnow) { // printf("dltotal: %d, dlnow: %d, ultotal: %d, ulnow: %d \n", dltotal, dlnow, ultotal, ulnow); return 0; } thanks leigh ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info