summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sftp.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2021-03-31 22:16:34 +0000
committerdjm <djm@openbsd.org>2021-03-31 22:16:34 +0000
commit5428fda9912ff4dc07d453dd4fca3fe2960f82a4 (patch)
treef7c70dddba5436100e8960032c4d2b10d557c6d3 /usr.bin/ssh/sftp.c
parentcannot effectively test posix-rename extension after changes in (diff)
downloadwireguard-openbsd-5428fda9912ff4dc07d453dd4fca3fe2960f82a4.tar.xz
wireguard-openbsd-5428fda9912ff4dc07d453dd4fca3fe2960f82a4.zip
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@
Diffstat (limited to 'usr.bin/ssh/sftp.c')
-rw-r--r--usr.bin/ssh/sftp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index 1f2a2ba0107..f42c43b30d4 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/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>
*
@@ -50,9 +50,6 @@
#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;
@@ -2294,8 +2291,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 */