cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curlopt_writefunction Questions

From: Monica Lau <mllau2004_at_yahoo.com>
Date: Mon, 12 Apr 2004 21:02:47 -0700 (PDT)

Oops -- please disregard my second question -- the write function takes a void pointer, so I can pass it any data structure...
 
Regards,
Monica

Monica Lau <mllau2004_at_yahoo.com> wrote:
Hi all,

I'm using the curlopt_writefunction option to pass the
response data from the HTTP server to a string in my
application directly. I tried the example in the
"getinmemory.c" code, and it worked. However, I
realized that multiple calls to the write function may
be made per a single transaction. So, in this case, I
actually need a global string and keep appending to
this string whenever the write function is called.
Otherwise, I end up with a string that gets
overwritten. So, my first question is: Is keeping a
global string the correct way of handling this issue?

Secondly, for the CURLOPT_WRITEDATA option, the
example code passed in the address of a structure
"chunk" Does this option always expect a structure?
I tried passing in the address of a string, but when I
run the program, I get this error message:

"curlErrorCode: 56, errorBuffer: Received problem 3 in
the chunky parser"

Thanks for your time and help.

Regards,
Monica

__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html
                
---------------------------------
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today
Received on 2004-04-13