cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_WRITEDATA Question

From: Guillaume MARTIN <guillaume_at_eurovox.fr>
Date: Tue, 27 Apr 2004 17:32:44 +0200

Ok, Thanks ...

Now i have an other question :

    If I use a callback Function ... What is the necessity of the "void
*stream" ?

    It's just a param if I want to use the same callback func for others
transfer ?
        If yes, I can put NULL for CURLOPT_WRITEDATA ?

Guillaume

----- Original Message -----
From: "Daniel Stenberg" <daniel-curl_at_haxx.se>
To: "libcurl development" <curl-library_at_cool.haxx.se>
Sent: Tuesday, April 27, 2004 3:31 PM
Subject: Re: CURLOPT_WRITEDATA Question

> On Tue, 27 Apr 2004, Guillaume MARTIN wrote:
>
> > I'm under Linux and want to use CURLOPT_WRITEDATA Option
> >
> > If I understand, I have to make a fopen with "wb" option then pass the
"FILE
> > *" reference to curl_easy_setopt ?
>
> The pointer you set with CURLOPT_WRITEDATA is the pointer that ends up in
the
> callback you set with CURLOPT_WRITEFUNCTION.
>
> If you don't set a callback, libcurl has a default "callback" that calls
> fwrite() and then you need to pass on a working FILE *, yes.
>
> > Does the curl_easy_perform function waits for the http transfer to
finish
> > before continuing ?
>
> Yes.
>
> > If yes, The file opened is full with the http response ? Right ?
>
> If you ask for it with CURLOPT_HEADER. You can also opt to get the headers
> passed to a different callback with CURLOPT_HEADERFUNCTION.
>
> --
> Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
> Dedicated custom curl help for hire: http://haxx.se/curl.html
>
Received on 2004-04-27