diff options
Diffstat (limited to 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sftp-client.c b/sftp-client.c index f3d752cdb..ca4669e19 100644 --- a/sftp-client.c +++ b/sftp-client.c | |||
@@ -28,7 +28,7 @@ | |||
28 | /* XXX: copy between two remote sites */ | 28 | /* XXX: copy between two remote sites */ |
29 | 29 | ||
30 | #include "includes.h" | 30 | #include "includes.h" |
31 | RCSID("$OpenBSD: sftp-client.c,v 1.25 2002/03/08 06:10:16 itojun Exp $"); | 31 | RCSID("$OpenBSD: sftp-client.c,v 1.26 2002/03/11 03:18:49 itojun Exp $"); |
32 | 32 | ||
33 | #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) | 33 | #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) |
34 | #include <sys/queue.h> | 34 | #include <sys/queue.h> |
@@ -861,8 +861,9 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, | |||
861 | break; | 861 | break; |
862 | case SSH2_FXP_DATA: | 862 | case SSH2_FXP_DATA: |
863 | data = buffer_get_string(&msg, &len); | 863 | data = buffer_get_string(&msg, &len); |
864 | debug3("Received data %llu -> %llu", req->offset, | 864 | debug3("Received data %llu -> %llu", |
865 | req->offset + len - 1); | 865 | (unsigned long long)req->offset, |
866 | (unsigned long long)req->offset + len - 1); | ||
866 | if (len > req->len) | 867 | if (len > req->len) |
867 | fatal("Received more data than asked for " | 868 | fatal("Received more data than asked for " |
868 | "%d > %d", len, req->len); | 869 | "%d > %d", len, req->len); |
@@ -882,8 +883,10 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, | |||
882 | } else { | 883 | } else { |
883 | /* Resend the request for the missing data */ | 884 | /* Resend the request for the missing data */ |
884 | debug3("Short data block, re-requesting " | 885 | debug3("Short data block, re-requesting " |
885 | "%llu -> %llu (%2d)", req->offset + len, | 886 | "%llu -> %llu (%2d)", |
886 | req->offset + req->len - 1, num_req); | 887 | (unsigned long long)req->offset + len, |
888 | (unsigned long long)req->offset + req->len - 1, | ||
889 | num_req); | ||
887 | req->id = conn->msg_id++; | 890 | req->id = conn->msg_id++; |
888 | req->len -= len; | 891 | req->len -= len; |
889 | req->offset += len; | 892 | req->offset += len; |
@@ -898,7 +901,8 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, | |||
898 | /* Only one request at a time | 901 | /* Only one request at a time |
899 | * after the expected EOF */ | 902 | * after the expected EOF */ |
900 | debug3("Finish at %llu (%2d)", | 903 | debug3("Finish at %llu (%2d)", |
901 | offset, num_req); | 904 | (unsigned long long)offset, |
905 | num_req); | ||
902 | max_req = 1; | 906 | max_req = 1; |
903 | } | 907 | } |
904 | else if (max_req < conn->num_requests + 1) { | 908 | else if (max_req < conn->num_requests + 1) { |
@@ -1052,7 +1056,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, | |||
1052 | buffer_put_string(&msg, data, len); | 1056 | buffer_put_string(&msg, data, len); |
1053 | send_msg(conn->fd_out, &msg); | 1057 | send_msg(conn->fd_out, &msg); |
1054 | debug3("Sent message SSH2_FXP_WRITE I:%d O:%llu S:%u", | 1058 | debug3("Sent message SSH2_FXP_WRITE I:%d O:%llu S:%u", |
1055 | id, (u_int64_t)offset, len); | 1059 | id, (unsigned long long)offset, len); |
1056 | } else if (TAILQ_FIRST(&acks) == NULL) | 1060 | } else if (TAILQ_FIRST(&acks) == NULL) |
1057 | break; | 1061 | break; |
1058 | 1062 | ||
@@ -1090,7 +1094,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, | |||
1090 | goto done; | 1094 | goto done; |
1091 | } | 1095 | } |
1092 | debug3("In write loop, ack for %u %d bytes at %llu", | 1096 | debug3("In write loop, ack for %u %d bytes at %llu", |
1093 | ack->id, ack->len, ack->offset); | 1097 | ack->id, ack->len, (unsigned long long)ack->offset); |
1094 | ++ackid; | 1098 | ++ackid; |
1095 | free(ack); | 1099 | free(ack); |
1096 | } | 1100 | } |