summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2007-09-17 16:12:03 +1000
committerDamien Miller <djm@mindrot.org>2007-09-17 16:12:03 +1000
commit8b3fdfb6af2b945b250b5d414225cc6c4be0df5a (patch)
treed8d7c891f5ca20d03bd210c91384f77c6648962b /sftp-client.c
parent35e18dba89ac0fd068f16388563861dccbeb527c (diff)
- djm@cvs.openbsd.org 2007/09/16 00:55:52
[sftp-client.c] use off_t instead of u_int64_t for file offsets, matching what the progressmeter code expects; bz #842
Diffstat (limited to 'sftp-client.c')
-rw-r--r--sftp-client.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sftp-client.c b/sftp-client.c
index 2746f3245..c12d1d38e 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-client.c,v 1.76 2007/01/22 11:32:50 djm Exp $ */ 1/* $OpenBSD: sftp-client.c,v 1.77 2007/09/16 00:55:52 djm 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 *
@@ -994,7 +994,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
994{ 994{
995 int local_fd, status; 995 int local_fd, status;
996 u_int handle_len, id, type; 996 u_int handle_len, id, type;
997 u_int64_t offset; 997 off_t offset;
998 char *handle, *data; 998 char *handle, *data;
999 Buffer msg; 999 Buffer msg;
1000 struct stat sb; 1000 struct stat sb;
@@ -1004,7 +1004,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1004 struct outstanding_ack { 1004 struct outstanding_ack {
1005 u_int id; 1005 u_int id;
1006 u_int len; 1006 u_int len;
1007 u_int64_t offset; 1007 off_t offset;
1008 TAILQ_ENTRY(outstanding_ack) tq; 1008 TAILQ_ENTRY(outstanding_ack) tq;
1009 }; 1009 };
1010 TAILQ_HEAD(ackhead, outstanding_ack) acks; 1010 TAILQ_HEAD(ackhead, outstanding_ack) acks;
@@ -1143,12 +1143,14 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1143 status = -1; 1143 status = -1;
1144 goto done; 1144 goto done;
1145 } 1145 }
1146 debug3("In write loop, ack for %u %u bytes at %llu", 1146 debug3("In write loop, ack for %u %u bytes at %lld",
1147 ack->id, ack->len, (unsigned long long)ack->offset); 1147 ack->id, ack->len, (long long)ack->offset);
1148 ++ackid; 1148 ++ackid;
1149 xfree(ack); 1149 xfree(ack);
1150 } 1150 }
1151 offset += len; 1151 offset += len;
1152 if (offset < 0)
1153 fatal("%s: offset < 0", __func__);
1152 } 1154 }
1153 if (showprogress) 1155 if (showprogress)
1154 stop_progress_meter(); 1156 stop_progress_meter();