summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2013-06-01 22:34:51 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2013-06-01 22:34:51 +0000
commitde5716eff1af7ea1746819cc5466b26cdcb06bbc (patch)
treea35abcd9330831586b7555680b8376d44e19d6d3
parent86db52ef5b5a59e654c209e52fd06afa076a9c68 (diff)
Update progressmeter when data is acked, not when it's sent. bz#2108, from
Debian via Colin Watson, ok djm@
-rw-r--r--usr.bin/ssh/sftp-client.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/ssh/sftp-client.c b/usr.bin/ssh/sftp-client.c
index e35950a8133..5c3725f6cb4 100644
--- a/usr.bin/ssh/sftp-client.c
+++ b/usr.bin/ssh/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.99 2013/06/01 20:59:25 dtucker Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.100 2013/06/01 22:34:50 dtucker Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -1329,7 +1329,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
int local_fd;
int status = SSH2_FX_OK;
u_int handle_len, id, type;
- off_t offset;
+ off_t offset, progress_counter;
char *handle, *data;
Buffer msg;
struct stat sb;
@@ -1397,9 +1397,10 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
data = xmalloc(conn->transfer_buflen);
/* Read from local and write to remote */
- offset = 0;
+ offset = progress_counter = 0;
if (showprogress)
- start_progress_meter(local_path, sb.st_size, &offset);
+ start_progress_meter(local_path, sb.st_size,
+ &progress_counter);
for (;;) {
int len;
@@ -1469,6 +1470,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
debug3("In write loop, ack for %u %u bytes at %lld",
ack->id, ack->len, (long long)ack->offset);
++ackid;
+ progress_counter += ack->len;
free(ack);
}
offset += len;