cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: HTTP GET

From: Sonia Subramanian <sonia_subramanian_at_symantec.com>
Date: Fri, 25 Aug 2006 10:02:32 -0700

Thanks very much - I didn't realize I was using the same variable.

I changed the global variable to sizebytes and it works fine.

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Friday, August 25, 2006 12:16 AM
To: libcurl development
Subject: Re: HTTP GET

On Thu, 24 Aug 2006, Sonia Subramanian wrote:

> 1. If I don't provide a call back function and just use WRITEDATA and
pass
> in a FILE* (-fopen with wb) I get a write failure. Would you please
let me
> know if I am using this correctly?

On windows using libcurl as DLL you can do that, but otherwise that it
should
work just fine.

> 2. If I use the NOBODY option the header content gets dumped on the
screen.

NOBODY doesn't change where the contents are directed.

> If I use the HEADERFUNCTION option where the function does something
like
>
> int headget(void *buffer, size_t size, size_t nmemb, void *stream)
> {

...

> if(strncmp("Content-Length:",bufferc,15) == 0)
> size = atoi(bufferc+16);

> return size*nmemb;

By changing 'size' you return a different value and by not returning the
same
value that was passed in to the callback you told libcurl there was an
error
in your callback. This is documented.

-- 
  Commercial curl and libcurl Technical Support:
http://haxx.se/curl.html
Received on 2006-08-25