cURL / Mailing Lists / curl-library / Single Mail


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

From: Daniel Stenberg <>
Date: Wed, 7 Aug 2013 22:31:48 +0200 (CEST)

On Tue, 6 Aug 2013, Bill Doyle wrote:

> Hi! I'm in the process of building a simple libcurl FTP wrapper for a
> Cocoa app, and I'm using Grand Central Dispatch as the backing for a
> multi-handle.

That's MacOS then, right? Which libcurl version are you using?

> it gets as far as opening the data socket to the server and then immediately
> gives up and closes the control socket.

I can't say that I recall this problem but when we switched over to doing only
multi internally (before... was it 7.28?) I did fix a number of problems with
the multi interface.

> The duplicated messages, especially after the initial login, along with the
> small fragments of previous messages that are interspersed, lead me to
> believe that this is threading related, but I can't pick out what I've done
> wrong.

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

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

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

> 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

> It's entirely possible that this is more of a GCD issue than a libcurl
> issue, and if that's the case, I'd be happy to move this question elsewhere.

Perhaps, but I can't say. I know nothing about GCD and objective-C is mostly
confusing to me...

List admin:
Received on 2013-08-07