summaryrefslogtreecommitdiff
path: root/sftp-int.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-int.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-int.c')
-rw-r--r--sftp-int.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sftp-int.c b/sftp-int.c
index d8eec3f3..f86922d0 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -26,7 +26,7 @@
/* XXX: recursive operations */
#include "includes.h"
-RCSID("$OpenBSD: sftp-int.c,v 1.41 2001/12/19 07:18:56 deraadt Exp $");
+RCSID("$OpenBSD: sftp-int.c,v 1.42 2002/02/05 00:00:46 djm Exp $");
#include "buffer.h"
#include "xmalloc.h"
@@ -42,6 +42,9 @@ RCSID("$OpenBSD: sftp-int.c,v 1.41 2001/12/19 07:18:56 deraadt Exp $");
/* File to read commands from */
extern FILE *infile;
+/* Size of buffer used when copying files */
+extern size_t copy_buffer_len;
+
/* Version of server we are speaking to */
int version;
@@ -381,7 +384,8 @@ process_get(int in, int out, char *src, char *dst, char *pwd, int pflag)
goto out;
}
printf("Fetching %s to %s\n", g.gl_pathv[0], abs_dst);
- err = do_download(in, out, g.gl_pathv[0], abs_dst, pflag);
+ err = do_download(in, out, g.gl_pathv[0], abs_dst, pflag,
+ copy_buffer_len);
goto out;
}
@@ -405,7 +409,8 @@ process_get(int in, int out, char *src, char *dst, char *pwd, int pflag)
abs_dst = tmp;
printf("Fetching %s to %s\n", g.gl_pathv[i], abs_dst);
- if (do_download(in, out, g.gl_pathv[i], abs_dst, pflag) == -1)
+ if (do_download(in, out, g.gl_pathv[i], abs_dst, pflag,
+ copy_buffer_len) == -1)
err = -1;
xfree(abs_dst);
abs_dst = NULL;
@@ -463,7 +468,8 @@ process_put(int in, int out, char *src, char *dst, char *pwd, int pflag)
abs_dst = make_absolute(abs_dst, pwd);
}
printf("Uploading %s to %s\n", g.gl_pathv[0], abs_dst);
- err = do_upload(in, out, g.gl_pathv[0], abs_dst, pflag);
+ err = do_upload(in, out, g.gl_pathv[0], abs_dst, pflag,
+ copy_buffer_len);
goto out;
}
@@ -487,7 +493,8 @@ process_put(int in, int out, char *src, char *dst, char *pwd, int pflag)
abs_dst = make_absolute(tmp, pwd);
printf("Uploading %s to %s\n", g.gl_pathv[i], abs_dst);
- if (do_upload(in, out, g.gl_pathv[i], abs_dst, pflag) == -1)
+ if (do_upload(in, out, g.gl_pathv[i], abs_dst, pflag,
+ copy_buffer_len) == -1)
err = -1;
}