summaryrefslogtreecommitdiffstats
path: root/sftp.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-04-01 00:16:34 +0200
committerDamien Miller <djm@mindrot.org>2021-04-01 00:20:57 +0200
commit1339800fef8d0dfbfeabff71b34670105bcfddd2 (patch)
tree05cc31045d88e72d7effb264a23b3b1302d0d496 /sftp.c
parentupstream: do not advertise protocol extensions that have been (diff)
downloadopenssh-1339800fef8d0dfbfeabff71b34670105bcfddd2.tar.xz
openssh-1339800fef8d0dfbfeabff71b34670105bcfddd2.zip
upstream: Use new limits@openssh.com protocol extension to let the
client select good limits based on what the server supports. Split the download and upload buffer sizes to allow them to be chosen independently. In practice (and assuming upgraded sftp/sftp-server at each end), this increases the download buffer 32->64KiB and the upload buffer 32->255KiB. Patches from Mike Frysinger; ok dtucker@ OpenBSD-Commit-ID: ebd61c80d85b951b794164acc4b2f2fd8e88606c
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sftp.c b/sftp.c
index fb3c08d19..b9804b566 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.206 2021/01/08 02:44:14 djm Exp $ */
+/* $OpenBSD: sftp.c,v 1.207 2021/03/31 22:16:34 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -70,9 +70,6 @@ typedef void EditLine;
#include "sftp-common.h"
#include "sftp-client.h"
-#define DEFAULT_COPY_BUFLEN 32768 /* Size of buffer for up/download */
-#define DEFAULT_NUM_REQUESTS 64 /* # concurrent outstanding requests */
-
/* File to read commands from */
FILE* infile;
@@ -2341,8 +2338,8 @@ main(int argc, char **argv)
extern int optind;
extern char *optarg;
struct sftp_conn *conn;
- size_t copy_buffer_len = DEFAULT_COPY_BUFLEN;
- size_t num_requests = DEFAULT_NUM_REQUESTS;
+ size_t copy_buffer_len = 0;
+ size_t num_requests = 0;
long long limit_kbps = 0;
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */