cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: download with http

From: Pingkui HOU <kou_h_at_sunflare.co.jp>
Date: Tue, 30 Mar 2004 10:33:34 +0900

hi, Eduardo,
Thanks for your message.
You are right. Now I can get the file correctly.

Pingkui Hou

----- Original Message -----
From: "Eduardo García" <garedagmad_at_telefonica.net>
To: "libcurl development" <curl-library_at_cool.haxx.se>
Sent: Monday, March 29, 2004 4:27 PM
Subject: Re: download with http

> I think I can guess your error:
>
> Write callback function must return exactly the size of the received
> buffer, in bytes. In your code you always return 0 as far as you are
> returnning 'nrcv' variable which has been decreased up to 0. Try to return
> 'size*nmemb' instead.
>
> size_t write_callback( void *ptr, size_t size, size_t nmemb, void *stream)
> >{
> >...
> > size_t nrcv ;
> > nrcv = size*nmemb;
> ...
> > char* rcvptr = (char*) ptr;
> > for( ; nrcv > 0; nrcv-- )
> > {
> ...
> > }
> ...
> > return nrcv;
> >};
>
>
Received on 2004-03-30