cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: File Download

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 24 Mar 2011 12:50:02 -0700

On Thu, Mar 24, 2011 at 11:47:43AM +0530, lakshmi wrote:
> Can you just let me know what the below piece of code does ?? A
> sample program from curl ..
>
> When the out->stream is NULL, it enters only once inside the if
> condition but if it's not NULL, it keeps looping for many number of
> times !
>
> Please suggest ??

Let me guess--you used this snippet of code from the ftpget.c example
program in your own code and it's not working? You probably missed
also copying the CURLOPT_WRITEDATA option to set the "out" pointer while
setting up the easy handle. This write callback needs a data struct to
hold the file handle that it opens. Without setting it, it will either
get a NULL pointer or stdout, both of which are wrong in this context.

Also, please direct further libcurl questions to the curl-library mailing
list instead of this one.

>>> Dan
-------------------------------------------------------------------
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 2011-03-24