summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-02-08 22:04:05 +1100
committerDamien Miller <djm@mindrot.org>2002-02-08 22:04:05 +1100
commit8829d3669d154dbd06f9ee2cc779f14e2af8e15f (patch)
tree06c5dc3d5c2352c1466d76512d2d9cd5e6b6513a /sftp.c
parente8c9ed436a23d0fdbad1881092a3f9d2e7d5f822 (diff)
- djm@cvs.openbsd.org 2002/02/05 00:00:46
[sftp.1 sftp.c sftp-client.c sftp-client.h sftp-int.c] Add "-B" option to specify copy buffer length (default 32k); ok markus@
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sftp.c b/sftp.c
index 3748d055..c2282b50 100644
--- a/sftp.c
+++ b/sftp.c
@@ -24,7 +24,7 @@
#include "includes.h"
-RCSID("$OpenBSD: sftp.c,v 1.23 2002/02/04 21:53:12 djm Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.24 2002/02/05 00:00:46 djm Exp $");
/* XXX: short-form remote directory listings (like 'ls -C') */
@@ -46,6 +46,7 @@ char *__progname;
#endif
FILE* infile;
+size_t copy_buffer_len = 32768;
static void
connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid)
@@ -93,7 +94,8 @@ usage(void)
{
fprintf(stderr,
"usage: sftp [-1Cv] [-b batchfile] [-F config] [-o option] [-s subsystem|path]\n"
- " [-S program] [user@]host[:file [file]]\n");
+ " [-P direct server path] [-S program] \n"
+ " [-B buffer_size] [user@]host[:file [file]]\n");
exit(1);
}
@@ -121,7 +123,7 @@ main(int argc, char **argv)
ll = SYSLOG_LEVEL_INFO;
infile = stdin; /* Read from STDIN unless changed by -b */
- while ((ch = getopt(argc, argv, "1hvCo:s:S:b:F:P:")) != -1) {
+ while ((ch = getopt(argc, argv, "1hvCo:s:S:b:B:F:P:")) != -1) {
switch (ch) {
case 'C':
addargs(&args, "-C");
@@ -159,6 +161,11 @@ main(int argc, char **argv)
case 'P':
sftp_direct = optarg;
break;
+ case 'B':
+ copy_buffer_len = strtol(optarg, &cp, 10);
+ if (copy_buffer_len == 0 || *cp != '\0')
+ fatal("Invalid buffer size \"%s\"", optarg);
+ break;
case 'h':
default:
usage();