diff options
Diffstat (limited to 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sftp-client.c b/sftp-client.c index 9fa8376e6..0d42696ae 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.30 2002/04/01 22:07:17 markus Exp $"); | 31 | RCSID("$OpenBSD: sftp-client.c,v 1.31 2002/04/06 00:30:08 djm Exp $"); |
32 | 32 | ||
33 | #include "openbsd-compat/fake-queue.h" | 33 | #include "openbsd-compat/fake-queue.h" |
34 | 34 | ||
@@ -1061,10 +1061,12 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, | |||
1061 | 1061 | ||
1062 | if (id == startid || len == 0 || | 1062 | if (id == startid || len == 0 || |
1063 | id - ackid >= conn->num_requests) { | 1063 | id - ackid >= conn->num_requests) { |
1064 | u_int r_id; | ||
1065 | |||
1064 | buffer_clear(&msg); | 1066 | buffer_clear(&msg); |
1065 | get_msg(conn->fd_in, &msg); | 1067 | get_msg(conn->fd_in, &msg); |
1066 | type = buffer_get_char(&msg); | 1068 | type = buffer_get_char(&msg); |
1067 | id = buffer_get_int(&msg); | 1069 | r_id = buffer_get_int(&msg); |
1068 | 1070 | ||
1069 | if (type != SSH2_FXP_STATUS) | 1071 | if (type != SSH2_FXP_STATUS) |
1070 | fatal("Expected SSH2_FXP_STATUS(%d) packet, " | 1072 | fatal("Expected SSH2_FXP_STATUS(%d) packet, " |
@@ -1075,11 +1077,11 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, | |||
1075 | 1077 | ||
1076 | /* Find the request in our queue */ | 1078 | /* Find the request in our queue */ |
1077 | for(ack = TAILQ_FIRST(&acks); | 1079 | for(ack = TAILQ_FIRST(&acks); |
1078 | ack != NULL && ack->id != id; | 1080 | ack != NULL && ack->id != r_id; |
1079 | ack = TAILQ_NEXT(ack, tq)) | 1081 | ack = TAILQ_NEXT(ack, tq)) |
1080 | ; | 1082 | ; |
1081 | if (ack == NULL) | 1083 | if (ack == NULL) |
1082 | fatal("Can't find request for ID %d", id); | 1084 | fatal("Can't find request for ID %d", r_id); |
1083 | TAILQ_REMOVE(&acks, ack, tq); | 1085 | TAILQ_REMOVE(&acks, ack, tq); |
1084 | 1086 | ||
1085 | if (status != SSH2_FX_OK) { | 1087 | if (status != SSH2_FX_OK) { |