cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curlopts_writedata not being passed to writefunction properly.

From: Joshua Kordani <jkordani_at_lsa2.com>
Date: Mon, 13 Jan 2014 11:16:07 -0500

On 1/10/14 5:38 PM, Daniel Stenberg wrote:
> On Fri, 10 Jan 2014, Joshua Kordani wrote:
>
>> http://paste.lisp.org/display/140855
>
> Please use the curl-library list for libcurl questions.
sorry about that, I'll be posting my question to that list.

> Problem 1 with your code:
>
> printf("Address of struct: %p\n", myPortInfo);
>
> This doesn't print the address of the struct. Use &myPortInfo there
> instead.
>
> Problem 2 with your code:
>
> my_curl_easy_setopt(curl, CURLOPT_WRITEDATA, myPortInfo);
>
> This doesn't pass in the address of the struct as an argument, but you
> pass the full struct. That won't have the effect you want.
>
for the sake of completeness,

   portinfo *myPortInfo;

defines a pointer. Originally I'd made a local struct and passed its
address to the curl call, then when that didn't work, I made it a
pointer, I didn't update the printf call.
If you wish to follow up, I'll be posting the question to the library
list instead.
Thanks

-- 
Joshua Kordani
LSA Autonomy

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-01-13