diff --git a/include/libssh2_sftp.h b/include/libssh2_sftp.h index 47b91525..74884fbf 100644 --- a/include/libssh2_sftp.h +++ b/include/libssh2_sftp.h @@ -54,7 +54,6 @@ extern "C" { * Let's start with Version 3 (The version found in OpenSSH) and go from there */ #define LIBSSH2_SFTP_VERSION 3 -#define LIBSSH2_SFTP_PACKET_MAXLEN 40000 typedef struct _LIBSSH2_SFTP LIBSSH2_SFTP; typedef struct _LIBSSH2_SFTP_HANDLE LIBSSH2_SFTP_HANDLE; diff --git a/src/sftp.c b/src/sftp.c index d8c508fa..32b215a4 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -89,6 +89,10 @@ #define SSH_FXE_STATVFS_ST_RDONLY 0x00000001 #define SSH_FXE_STATVFS_ST_NOSUID 0x00000002 +/* This is the maximum packet length to accept, as larger than this indicate + some kind of server problem. */ +#define LIBSSH2_SFTP_PACKET_MAXLEN 80000 + static int sftp_close_handle(LIBSSH2_SFTP_HANDLE *handle); static int sftp_packet_ask(LIBSSH2_SFTP *sftp, unsigned char packet_type, uint32_t request_id, unsigned char **data,