Subject: [libssh2] Two libssh2_sftp_read patches.

[libssh2] Two libssh2_sftp_read patches.

From: Elifant <>
Date: Thu, 29 Mar 2007 17:37:42 +0700

Hello all.

I have 2 patches for SFTP subsystem. Please review.
These patches are based on version 0.14. However CVS version still has
the same bugs.

1. libssh2_sftp_read.patch
     Function libssh2_sftp_read returns error if it receives
SSH_FXP_STATUS packet. But not all
     return codes in this packet are errors, there is also SSH_FX_EOF
code. I think libssh2_sftp_read
     should return 0 in such case.

2. libssh2_read_packet_size.patch
     libssh2_sftp_packet_read function has a limit of incoming packet
length. It is defined by
     LIBSSH2_SFTP_PACKET_MAXLEN macro and currently has value 40000. However
     libssh2_sftp_read function requests amount of data equal to passed
buffer size.
     Server sends all requested data with one packet and libssh2 gives
error "SFTP packet too large".
     This patch fixes libssh2_sftp_read function so it requests data by
pieces it can handle.

P.S. Btw, libssh2_sftp_read function (and many others) ignore error code
returned from libssh2_sftp_packet_requirev and replaces it with too
common ""Timeout waiting for status
message". So user doesn't see real error until he build and install
debug version. I haven't fixed it yet, but it's
very annoying...

Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash

libssh2-devel mailing list

Received on 2007-03-29