cURL / Mailing Lists / curl-library / Single Mail


Re: Multi-handle hanging up immediately after creating FTP data socket (using GCD)

From: Bill Doyle <>
Date: Wed, 7 Aug 2013 17:39:57 -0400

On Wed, Aug 7, 2013 at 4:31 PM, Daniel Stenberg <> wrote:
> That's MacOS then, right? Which libcurl version are you using?

Yep, libcurl 7.30.0 on OS X, built using the MacOSX-Framework script.

> Those weird-looking lines combined with your words about threading makes me
> scared. What are you doing multi-threaded?

This is where it gets a bit tricky: GCD is outwardly queue-based, but
manages threads internally. I have little control over what it chooses
to do thread-wise, though I have told it to use a serial queue, so
everything should be getting executed in the proper order. Evidently,
something isn't working quite as I expected it to, though. I'm
continuing to poke around at that aspect of it.

> I did quickly glance over the code you attached but it was very complicated
> to follow.

Yeah, sorry about that. I'm still in the process of learning GCD, so
this has been patched together as I translated it from C to
Objective-C. I'm planning on re-writing this, but I need it working
prior to doing so. :)

> Can you try to implement your logic in a plain (non-threaded) C program and
> see if that works?

That would essentially just be the crash-test program that I linked,
since I did the opposite to get it into this state. But, like I said
above, I'm not actually doing anything with threads, GCD is, so that
code *should* have roughly the same behavior. I'm currently trying to
get that program compiled and running to ensure that it does in fact
work, but given that it was written in March of this year, I can't see
there being any libcurl-version-related issues there.

>> Another interesting note is that libcurl never asks to adjust the timeout
> Never? For every handle you add it will set a 1 ms timeout so it certainly
> should...

Well, never after initially setting it to 1ms. I wasn't certain
whether it was supposed to attempt changing the timeout again later in
the process.
List admin:
Received on 2013-08-07