[openssh-commits] [openssh] 05/10: upstream: factor out a structure duplicated between downloading
git+noreply at mindrot.org
git+noreply at mindrot.org
Sat Aug 7 10:27:19 AEST 2021
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
commit 48cd39b7a4e5e7c25101c6d1179f98fe544835cd
Author: djm at openbsd.org <djm at openbsd.org>
Date: Sat Aug 7 00:07:18 2021 +0000
upstream: factor out a structure duplicated between downloading
and crossloading; ok markus@
OpenBSD-Commit-ID: 96eede24d520569232086a129febe342e4765d39
---
sftp-client.c | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/sftp-client.c b/sftp-client.c
index 9f777e43..dc9a9a80 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.145 2021/08/07 00:02:41 djm Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.146 2021/08/07 00:07:18 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm at openbsd.org>
*
@@ -100,6 +100,15 @@ struct sftp_conn {
struct bwlimit bwlimit_in, bwlimit_out;
};
+/* Tracks in-progress requests during file transfers */
+struct request {
+ u_int id;
+ size_t len;
+ u_int64_t offset;
+ TAILQ_ENTRY(request) tq;
+};
+TAILQ_HEAD(requests, request);
+
static u_char *
get_handle(struct sftp_conn *conn, u_int expected_id, size_t *len,
const char *errfmt, ...) __attribute__((format(printf, 4, 5)));
@@ -1339,13 +1348,7 @@ do_download(struct sftp_conn *conn, const char *remote_path,
off_t progress_counter;
size_t handle_len;
struct stat st;
- struct request {
- u_int id;
- size_t len;
- u_int64_t offset;
- TAILQ_ENTRY(request) tq;
- };
- TAILQ_HEAD(reqhead, request) requests;
+ struct requests requests;
struct request *req;
u_char type;
@@ -2127,13 +2130,7 @@ do_crossload(struct sftp_conn *from, struct sftp_conn *to,
off_t progress_counter;
u_char *from_handle, *to_handle;
size_t from_handle_len, to_handle_len;
- struct request {
- u_int id;
- size_t len;
- u_int64_t offset;
- TAILQ_ENTRY(request) tq;
- };
- TAILQ_HEAD(reqhead, request) requests;
+ struct requests requests;
struct request *req;
u_char type;
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list