- 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@
diff --git a/sftp-int.c b/sftp-int.c
index d8eec3f..f86922d 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 @@
/* 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 @@
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 @@
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 @@
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 @@
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;
}