summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp-client.c')
-rw-r--r--sftp-client.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sftp-client.c b/sftp-client.c
index fc60dd80d..ab035c713 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-client.c,v 1.99 2013/06/01 20:59:25 dtucker Exp $ */ 1/* $OpenBSD: sftp-client.c,v 1.100 2013/06/01 22:34:50 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -1340,7 +1340,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1340 int local_fd; 1340 int local_fd;
1341 int status = SSH2_FX_OK; 1341 int status = SSH2_FX_OK;
1342 u_int handle_len, id, type; 1342 u_int handle_len, id, type;
1343 off_t offset; 1343 off_t offset, progress_counter;
1344 char *handle, *data; 1344 char *handle, *data;
1345 Buffer msg; 1345 Buffer msg;
1346 struct stat sb; 1346 struct stat sb;
@@ -1408,9 +1408,10 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1408 data = xmalloc(conn->transfer_buflen); 1408 data = xmalloc(conn->transfer_buflen);
1409 1409
1410 /* Read from local and write to remote */ 1410 /* Read from local and write to remote */
1411 offset = 0; 1411 offset = progress_counter = 0;
1412 if (showprogress) 1412 if (showprogress)
1413 start_progress_meter(local_path, sb.st_size, &offset); 1413 start_progress_meter(local_path, sb.st_size,
1414 &progress_counter);
1414 1415
1415 for (;;) { 1416 for (;;) {
1416 int len; 1417 int len;
@@ -1481,6 +1482,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1481 debug3("In write loop, ack for %u %u bytes at %lld", 1482 debug3("In write loop, ack for %u %u bytes at %lld",
1482 ack->id, ack->len, (long long)ack->offset); 1483 ack->id, ack->len, (long long)ack->offset);
1483 ++ackid; 1484 ++ackid;
1485 progress_counter += ack->len;
1484 free(ack); 1486 free(ack);
1485 } 1487 }
1486 offset += len; 1488 offset += len;