cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: non-blocking FTP

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 13 May 2008 15:29:19 -0700

On Tue, May 13, 2008 at 05:13:49PM -0500, Jeff Weber wrote:
> I need to make nonblocking uploads of multiple files using either the
> scp:// or ftp:// protocols. In some cases, the code must upload via
> scp://, in other cases ftp://.
>
> Given the comment in the libcurl-multi.3 -- man page, that ftp://
> still contains some blocking code, even in the multi interface, I
> decided to use the easy interface, and split my transfer into
> pthreads. Most of the code is in the parent thread, and only the
> curl_easy_perform() in a child thread. If the child thread "takes too
> long", I cancel it. Regardless, the parent always calls

How do you cancel it? Unless you do so cleanly, from a libcurl
callback, you will get leaks and potentially other strange effects.

> Are there any other suggestions for implementing nonblocking
> ftp:// transfers?

You could submit patches to libcurl to fix the problem, or convince someone
else to do so!

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-05-14