cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SFTP and multi interface

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 5 Jan 2010 00:27:38 +0100 (CET)

On Mon, 4 Jan 2010, Gil Weber wrote:

> Hi All, I am facing a problem using SFTP protocol and multi interface. I
> have done a simple program (based multi-single.c example of website) which
> create an easy handle and add it to the multi interface. Connection seems to
> be OK but when I call the function "curl_multi_fdset", no file descriptor is
> set even if the connection is opened (maxfd = -1). This append only during
> connection initialization, once the file is ready to be sent, fd_set are
> correctly initilized

I think this is because you're using the default (synchronous) name resolver
within libcurl, and during the name resolving libcurl has no socket handler to
"export". As soon as the resolving is done, libcurl creates a socket and then
it _can_ return something in curl_multi_fdset.

So, the best thing you can do when curl_multi_fdset() returns -1, is to do a
short sleep and then continue anyway. Or rebuild libcurl to use c-ares, as
then it will return a socket even during the resolving...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-01-05