cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: read function

From: Behnam Rashidian <BRashidian_at_zeugmasystems.com>
Date: Mon, 2 Oct 2006 13:52:10 -0700

Thanks, that actually helps but how do I point void *stream (to the
right stream/memory location?

The getinmemory.c example is easier since the void *stream points to an
empty chunk of memory but in my case I want to point to some actual data
(not a file of course). Just to make myself more clear: I am going to be
receiving data on the fly, and there is not enough space to actually
store the data into a file, therefore the data will be streamed over to
a server as it arrives. Also the data size N might not be fixed, will I
still experience that the server "hangs" waiting for the rest of the
data that won't come or is there a way to go around this?

Many Thanks

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Monday, October 02, 2006 12:31 PM
To: libcurl development
Subject: Re: read function

On Mon, 2 Oct 2006, Behnam Rashidian wrote:

> I am looking for hints or maybe sample code that would do the opposite

> of getinmemory.c, because I need to read a chunk of memory and then
> stream it over TCP instead of saving it into a file. I found this
> example in the tutorial but not sure how to use it or where to find
the read function.
>
> curl_easy_setopt(easyhandle, CURLOPT_READFUNCTION, read_function);

CURLOPT_READFUNCTION is documented in the curl_easy_setopt man page[1],
and the concept for using it is described in the tutorial[2].

[1] =
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTREADFUNCTION
[2] = http://curl.haxx.se/libcurl/c/libcurl-tutorial.html

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