cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curlpp mailing list Archives

[cURLpp] C - no more download of 9341 bytes

From: Marko MILICEVIC <markomilicevicfr_at_yahoo.fr>
Date: Sun, 24 Sep 2006 13:11:22 +0200 (CEST)

Hello,

I using lib curl in my project (Windows, GCC
(devcpp)), i use the libcurl-3.dll, and compile with
the argument -lcurl.

My problem is:

My software lunch one thread , in this thread,
while(0) initialise libcurl and download one file, the
problem: libcurl download only 9341 bytes ! (4 Ko in
french)

My code:

DWORD WINAPI task_a (LPVOID p) {
   CURL *curl;
   CURLcode res;
   ...
   while (1) {
      ...
      curl = curl_easy_init();
      if(curl) {
         curl_easy_setopt(curl,
                          CURLOPT_URL,
                         
"http://localhost/text.txt");
         curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
write_data);
         res = curl_easy_perform(curl);
         curl_easy_cleanup(curl);
      }
      ...
      sleep(1 hour);
   }
}

The function write_data:

size_t write_data(char *buffer, size_t size, size_t
len, void *userp) {
   ...
   char buff[255]; memset(buff,0,255);
sprintf(buff,"%d",len);

   MessageBox(NULL,buffmax,"MSG",MB_OK); // 3914
<-------
   ...
}

My text.txt content a list of line ( 194 lines ):
line1\n
line2\n
line3\n
...
The size of this file is 7,42 Ko (7 600 octets)

The lastest line of output (buffer) is "li"

Where is the error?

Thank you. (Libcurl is the best lib!)

Sorry for my bad english.

        

        
                
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com

_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2006-09-24

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET