1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-16 08:41:51 +03:00

Make the transfer buffer size configurable

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Change-Id: I5052bac703b5a0c289ca5c28569cadeb54d3d507
This commit is contained in:
Xiang Xiao
2021-05-10 02:00:24 +08:00
committed by Jakub Jelen
parent 14276f0b51
commit dbe504ea0a
11 changed files with 53 additions and 15 deletions

View File

@ -22,6 +22,10 @@ program.
#include <libssh/libssh.h>
#include "examples_common.h"
#ifndef BUF_SIZE
#define BUF_SIZE 16384
#endif
static char **sources;
static int nsources;
static char *destination;
@ -257,7 +261,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) {
socket_t fd;
struct stat s;
int w, r;
char buffer[16384];
char buffer[BUF_SIZE];
size_t total = 0;
mode_t mode;
char *filename = NULL;