cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libssh2 patch 10/15

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 19 Nov 2006 23:14:58 +0100 (CET)

On Wed, 15 Nov 2006, James Housley wrote:

> By looking at file:// I figured out how to do a sftp:// download.

Unfortunately, the file:// code is useless as template (together with ldap,
dict, telnet and tftp :-/). The file code is somewhat excused though, since
several operating systems can't mix file descriptors with socket
descriptors...

I still can't make any SFTP downloads to work, and I did some further edits of
your work rather blindly and more to be like it is supposed to be. Anyway,
with my edits and minor changes I made an updated patch and I've attached it
here.

If you don't find any major problems with this, I'll be ready to commit again
to take us forward. I've figured out three libcurl issues to fix and two in
libssh2. Both the first issue for libcurl and the first for libssh2 below will
cause fatal (crashing) problems in the wild.

Left to do in libcurl:

* Connection-related data in the SessionHandle. When a connection is re-used,
   in can in fact get "owned" by a different SessionHandle than what
   previousely used it, so the connection must survive and keep data it needs
   within the connectdata struct. (This behaviour is new since 7.16.0 and is so
   because in a multi handle, all easy handles share a common connection
   cache.) Verify that tests/libtest/lib526.c works fine with SCP and SFTP
   URLs.

* Blocking: the SFTP directory reading function is blocking and thus will hang
   libcurl until the directory has completed. This should be fixed by switching
   the reading into a state-machine.

* Remove the "#ifndef LIBSSH2_SFTP_S_IRUSR" kludge (that I've just added) when
   we can require a public libssh2 release version that have those defines set.

Fixes for libssh2:

* libssh2_userauth_keyboard_interactive_ex() must allow a custom pointer to
   private data to get passed to the callback

* Make libssh2_sftp_read() and libssh2_sftp_write() return ssize_t and not
   size_t like they do now.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Received on 2006-11-19