cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SFTP and curl_multi_socket problem

From: Luboš Doležel <lubos_at_dolezel.info>
Date: Wed, 25 Jun 2008 00:34:04 +0200

Dne út 24. června 2008 Daniel Stenberg napsal(a):
> > I'm a developer of a download manager partially based on libcurl. It
> > works just great for HTTP, HTTPS and FTP, but it doesn't work when I use
> > SFTP.
>
> libcurl version? libssh2 version? Running on Linux?

libcurl: 7.18.2
libssh2: 0.18
...on Gentoo Linux

> > I add an easy SFTP download to the multi handle and when I call
> > curl_multi_socket_action(...CURL_SOCKET_TIMEOUT...), CURL calls
> > socket_callback with CURL_POLL_OUT (I return 0 = ok) and *immediately* -
> > during *the same* curl_multi_socket_action call - it tells me to remove
> > the very socket it has just told me to add.
>
> That sounds like a bug. Can you provide the source code to a complete
> example that repeats this problem? As simple as possible of course.

See the attachment.

$ gcc -osftpbug -lcurl sftpbug.c

> > CurlPoller::socket_callback - add/mod (CURL_POLL_OUT)
> > CurlPoller::socket_callback - remove
>
> Well this log doesn't mention what file descriptor it referred to.

Oh, it was the same one.

> > Do you have an idea what could be wrong?
>
> Set a break-point in lib/multi.c:singlesocket() and single-step through it.
> It should offer some amount of clues.

Did that, but I didn't figure out anything :-( The bug apparently isn't in
that function...

-- 
Luboš Doležel

Received on 2008-06-25