RE: Request To Memory Buffer
Date: Fri, 8 Jun 2007 11:05:20 +0300
Thanks for quick reply but that example shows saving to memory. My case is about reading from that memory block like reading from server url.
I saved data for http:///xxx.y to buffer as shown in example and than at second attempt to request http:///xxx.y do not make a curl request to server but read data from that buffer with curl callbacks (write callback actually) My code should be like this...
if(url not in cache)
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://cool.haxx.se/");
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk);
[do something to force curl read from memory]
I am doing this because there are some code blocks which assumes that "data will be given from CURLOPT_WRITEFUNCTION callback, not directly" and i don`t want to change that part because of possible changes by developers of that parts.
From: curl-library-bounces_at_cool.haxx.se on behalf of Aleksandar Lazic
Sent: Fri 6/8/2007 10:18 AM
To: libcurl development
Subject: Re: Request To Memory Buffer
On Fre 08.06.2007 09:40, Uygar Gümüs wrote:
>I need some help about libcurl interface. Please help me.
Have you try to look into the *excellent* examples dir:
>Can you please reply... Thanks a lot
Ht the urls help ;-)
- application/ms-tnef attachment: winmail.dat