One last (better be last) fix for FXP_INIT

This commit is contained in:
Sara Golemon 2005-05-10 04:49:43 +00:00
parent ba2f21eb85
commit 023c54d95d
2 changed files with 4 additions and 2 deletions

2
README
View File

@ -6,6 +6,8 @@ Version 0.10
(Re)Fixed channel_write() to provide an opportunity for window space to become available again.
(Re)Fixed SFTP INIT to send the correct SFTP packet length.
Version 0.9
-----------

View File

@ -419,7 +419,7 @@ LIBSSH2_API LIBSSH2_SFTP *libssh2_sftp_init(LIBSSH2_SESSION *session)
{
LIBSSH2_SFTP *sftp;
LIBSSH2_CHANNEL *channel;
unsigned char *data, *s, buffer[13]; /* sftp_header(9) + version_id(4) */
unsigned char *data, *s, buffer[9]; /* sftp_header(5){excludes request_id} + version_id(4) */
unsigned long data_len;
channel = libssh2_channel_open_session(session);
@ -449,7 +449,7 @@ LIBSSH2_API LIBSSH2_SFTP *libssh2_sftp_init(LIBSSH2_SESSION *session)
buffer[4] = SSH_FXP_INIT;
libssh2_htonu32(buffer + 5, LIBSSH2_SFTP_VERSION);
if (13 != libssh2_channel_write(channel, buffer, 13)) {
if (9 != libssh2_channel_write(channel, buffer, 9)) {
libssh2_error(session, LIBSSH2_ERROR_SOCKET_SEND, "Unable to send SSH_FXP_INIT", 0);
libssh2_channel_free(channel);
LIBSSH2_FREE(session, sftp);