Subject: [libssh2] Trouble w/ SFTP write and SSHD server

[libssh2] Trouble w/ SFTP write and SSHD server

From: Cary Fitzhugh <>
Date: Thu, 11 Oct 2007 01:08:32 -0400

Hello -

I'm trying to get curl w/ libssh2 working with an SSH server . I can
get a directory listing, even download files, but uploads just aren't
working. In curl nothing transfers, we get a failure.


This SSH server works with all the SFTP clients we could find.

And our version of curl (7.17.0) and libssh2 (0.18) seem to work on
every other sftp server we can find.


I'm writing the ssh2 group for suggestions since I have done some
experimenting w/ the example programs and they do more than curl does,
but still seem to have trouble. Hopefully I can get a bead from you all
on what the issue is so that when I talk to 3sp I can have a specific
bug they need to fix.


My experience tonight is:


scp_write copies a 7k file fine. If I run an scp url in curl, it fails
to transfer.

sftpdir gets the directory listing correctly.

sftp_write copies the first 1k of a 7k file. If I run the sftp url in
curl, it (55) failed sending data to peer.


Looking through the code, the call to libssh2_sftp_packet_read(sftp,0);
about line 310 in sftp.c returns a 101 the first time a buffer is sent,
but returns a -1 the rest of the time.


I'm guessing this is a bug in the SFTP server, but how can I
explain/categorize it?

Looking in the sftp draft, it says that

" The server responds to a write request with a SSH_FXP_STATUS



Could this be what the server is missing? But that seems like a pretty
standard thing that you wouldn't miss. But it's the only thing I can
think that libssh2 should be trying to read when it's writing data.


Thanks for any help!
Cary FitzHugh



This email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>

libssh2-devel mailing list
Received on 2007-10-11