summaryrefslogtreecommitdiff
path: root/sftp-client.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-03-31 22:16:34 +0000
committerDamien Miller <djm@mindrot.org>2021-04-01 09:20:57 +1100
commit1339800fef8d0dfbfeabff71b34670105bcfddd2 (patch)
tree05cc31045d88e72d7effb264a23b3b1302d0d496 /sftp-client.h
parent6653c61202d104e59c8e741329fcc567f7bc36b8 (diff)
downloadopenssh-git-1339800fef8d0dfbfeabff71b34670105bcfddd2.tar.gz
upstream: 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@ OpenBSD-Commit-ID: ebd61c80d85b951b794164acc4b2f2fd8e88606c
Diffstat (limited to 'sftp-client.h')
-rw-r--r--sftp-client.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sftp-client.h b/sftp-client.h
index 32a24a3c..6f6c49fb 100644
--- a/sftp-client.h
+++ b/sftp-client.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.h,v 1.29 2020/12/04 02:41:10 djm Exp $ */
+/* $OpenBSD: sftp-client.h,v 1.30 2021/03/31 22:16:34 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
@@ -53,6 +53,14 @@ struct sftp_statvfs {
u_int64_t f_namemax;
};
+/* Used for limits response on the wire from the server */
+struct sftp_limits {
+ u_int64_t packet_length;
+ u_int64_t read_length;
+ u_int64_t write_length;
+ u_int64_t open_handles;
+};
+
/*
* Initialise a SSH filexfer connection. Returns NULL on error or
* a pointer to a initialized sftp_conn struct on success.
@@ -61,6 +69,9 @@ struct sftp_conn *do_init(int, int, u_int, u_int, u_int64_t);
u_int sftp_proto_version(struct sftp_conn *);
+/* Query server limits */
+int do_limits(struct sftp_conn *, struct sftp_limits *);
+
/* Close file referred to by 'handle' */
int do_close(struct sftp_conn *, const u_char *, u_int);