summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-02-13 14:03:56 +1100
committerDamien Miller <djm@mindrot.org>2002-02-13 14:03:56 +1100
commit16a133339a40396064effee3de55f6b2a887d3d2 (patch)
tree6369f7bf93f345d8da84e8a2adbaf8ec475593a1 /sftp.c
parentafc7a5d7741ad59a2efe2db6b928c89bf0928098 (diff)
- djm@cvs.openbsd.org 2002/02/12 12:32:27
[sftp.1 sftp.c sftp-client.c sftp-client.h sftp-int.c] Perform multiple overlapping read/write requests in file transfer. Mostly done by Tobias Ringstrom <tori@ringstrom.mine.nu>; ok markus@
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sftp.c b/sftp.c
index 160851d7f..045e0766e 100644
--- a/sftp.c
+++ b/sftp.c
@@ -24,7 +24,7 @@
24 24
25#include "includes.h" 25#include "includes.h"
26 26
27RCSID("$OpenBSD: sftp.c,v 1.25 2002/02/06 14:27:23 mpech Exp $"); 27RCSID("$OpenBSD: sftp.c,v 1.26 2002/02/12 12:32:27 djm Exp $");
28 28
29/* XXX: short-form remote directory listings (like 'ls -C') */ 29/* XXX: short-form remote directory listings (like 'ls -C') */
30 30
@@ -47,6 +47,7 @@ char *__progname;
47 47
48FILE* infile; 48FILE* infile;
49size_t copy_buffer_len = 32768; 49size_t copy_buffer_len = 32768;
50size_t num_requests = 16;
50 51
51static void 52static void
52connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid) 53connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid)
@@ -125,7 +126,7 @@ main(int argc, char **argv)
125 ll = SYSLOG_LEVEL_INFO; 126 ll = SYSLOG_LEVEL_INFO;
126 infile = stdin; /* Read from STDIN unless changed by -b */ 127 infile = stdin; /* Read from STDIN unless changed by -b */
127 128
128 while ((ch = getopt(argc, argv, "1hvCo:s:S:b:B:F:P:")) != -1) { 129 while ((ch = getopt(argc, argv, "1hvCo:s:S:b:B:F:P:R:")) != -1) {
129 switch (ch) { 130 switch (ch) {
130 case 'C': 131 case 'C':
131 addargs(&args, "-C"); 132 addargs(&args, "-C");
@@ -168,6 +169,12 @@ main(int argc, char **argv)
168 if (copy_buffer_len == 0 || *cp != '\0') 169 if (copy_buffer_len == 0 || *cp != '\0')
169 fatal("Invalid buffer size \"%s\"", optarg); 170 fatal("Invalid buffer size \"%s\"", optarg);
170 break; 171 break;
172 case 'R':
173 num_requests = strtol(optarg, &cp, 10);
174 if (num_requests == 0 || *cp != '\0')
175 fatal("Invalid number of requests \"%s\"",
176 optarg);
177 break;
171 case 'h': 178 case 'h':
172 default: 179 default:
173 usage(); 180 usage();