1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

sftp: Use 16K for the transfer buffer size

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-09-08 08:40:18 +02:00
parent d2cc4eccc7
commit c070414309

View File

@@ -52,6 +52,7 @@
/* Buffer size maximum is 256M */ /* Buffer size maximum is 256M */
#define SFTP_PACKET_SIZE_MAX 0x10000000 #define SFTP_PACKET_SIZE_MAX 0x10000000
#define SFTP_BUFFER_SIZE_MAX 16384
struct sftp_ext_struct { struct sftp_ext_struct {
unsigned int count; unsigned int count;
@@ -328,7 +329,7 @@ int sftp_packet_write(sftp_session sftp, uint8_t type, ssh_buffer payload){
sftp_packet sftp_packet_read(sftp_session sftp) sftp_packet sftp_packet_read(sftp_session sftp)
{ {
unsigned char buffer[MAX_BUF_SIZE]; uint8_t buffer[SFTP_BUFFER_SIZE_MAX];
sftp_packet packet = sftp->read_packet; sftp_packet packet = sftp->read_packet;
uint32_t size; uint32_t size;
int r, s, is_eof; int r, s, is_eof;