- 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
This commit is contained in:
Damien Miller 2007-09-17 16:12:03 +10:00
parent 35e18dba89
commit 8b3fdfb6af
2 changed files with 12 additions and 6 deletions

View File

@ -55,6 +55,10 @@
- djm@cvs.openbsd.org 2007/09/13 04:39:04
[sftp-server.c]
fix incorrect test when setting syslog facility; from Jan Pechanec
- 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
20070914
- (dtucker) [openbsd-compat/bsd-asprintf.c] Plug mem leak in error path.
@ -3252,4 +3256,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
$Id: ChangeLog,v 1.4755 2007/09/17 06:11:33 djm Exp $
$Id: ChangeLog,v 1.4756 2007/09/17 06:12:03 djm Exp $

View File

@ -1,4 +1,4 @@
/* $OpenBSD: sftp-client.c,v 1.76 2007/01/22 11:32:50 djm Exp $ */
/* $OpenBSD: sftp-client.c,v 1.77 2007/09/16 00:55:52 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@ -994,7 +994,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
{
int local_fd, status;
u_int handle_len, id, type;
u_int64_t offset;
off_t offset;
char *handle, *data;
Buffer msg;
struct stat sb;
@ -1004,7 +1004,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
struct outstanding_ack {
u_int id;
u_int len;
u_int64_t offset;
off_t offset;
TAILQ_ENTRY(outstanding_ack) tq;
};
TAILQ_HEAD(ackhead, outstanding_ack) acks;
@ -1143,12 +1143,14 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
status = -1;
goto done;
}
debug3("In write loop, ack for %u %u bytes at %llu",
ack->id, ack->len, (unsigned long long)ack->offset);
debug3("In write loop, ack for %u %u bytes at %lld",
ack->id, ack->len, (long long)ack->offset);
++ackid;
xfree(ack);
}
offset += len;
if (offset < 0)
fatal("%s: offset < 0", __func__);
}
if (showprogress)
stop_progress_meter();