cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Progress During Large Posts

From: Dan Petitt <dan_at_digiguide.com>
Date: Sat, 15 Mar 2008 14:38:31 -0000

> It has too many windows-specific details for me to enjoy it, so I instead
crafted my own example - see attachment.

Ok, I tried your example which also works okay. But the difference between
your example and mine is that you use the read_callback function, if I
change your code to just pass in the post data directly then it stops
working on the smaller post.

Comment out: curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
Comment out: curl_easy_setopt(curl, CURLOPT_READDATA, &pooh);

Add: curl_easy_setopt(curl, CURLOPT_POSTFIELDS, ptr);

Undefine the file read thus:
//#ifndef FILE_BASED
  ptr= (char*)malloc(postsize);
  read(pooh.fd, ptr, postsize);
//#endif

This reproduces my problem with the two example files I sent you.

Hope this helps.

Dan
Received on 2008-03-15