cURL / Mailing Lists / curl-library / Single Mail

curl-library

Losing a byte with 7.10.5

From: Ben <nascarben_at_excite.com>
Date: Tue, 5 Aug 2003 11:48:07 -0400 (EDT)

 Hello,I am using libcurl 7.10.5 with the easy interface in VC6. I am trying to download a binary file from one of our servers. I have checked to make sure that everything starts properly, but for some reason I'm losing one byte, which is corrupting the binary. Below is what I have for my write function and the curlopt calls i'm using.int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) { struct FtpFile *out=(struct FtpFile *)stream; if(out &amp;&amp; !out-&gt;stream) { /* open file for writing */ out-&gt;stream=fopen(out-&gt;filename, "wb"); if(!out-&gt;stream) return -1; /* failure, can't open file to write */ } return fwrite(buffer, size, nmemb, out-&gt;stream); } curlopt calls curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, connecttimeout); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, location); curl_easy_setopt(curl, CURLOPT_BUFFERSIZE, nobuf
 fer); curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, speedtime); curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, speedlimit); curl_easy_setopt(curl, CURLOPT_RESUME_FROM, resume); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, myprogress); curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, progress); curl_easy_setopt(curl, CURLOPT_FILE, &amp;ftpfile); curl_easy_setopt(curl, CURLOPT_URL, urls[0]);Your Friend,BenBefore you get led astray. Check those new "virus" emails to make sure you aren't being used.McAfeehttp://vil.mcafee.com/hoax.aspSymantec/Nortonhttp://www.symantec.com/avcenter/HoaxBustershttp://hoaxbusters.ciac.org/Generalhttp://www.internet-101.com/hoax/

_______________________________________________
Express Yourself - Share Your Mood in Emails!
Visit www.SmileyCentral.com - the happiest place on the Web.

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-05