upstream: fix off-by-one error that caused sftp downloads to make

one more concurrent request that desired. This prevented using sftp(1) in
unpipelined request/response mode, which is useful when debugging. Patch from
Stephen Goetze in bz#3054

OpenBSD-Commit-ID: 41b394ebe57037dbc43bdd0eef21ff0511191f28
This commit is contained in:
djm@openbsd.org 2020-05-15 03:57:33 +00:00 committed by Damien Miller
parent d7d753e297
commit af8b16fb2c
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: sftp-client.c,v 1.135 2019/10/04 04:31:59 djm Exp $ */
/* $OpenBSD: sftp-client.c,v 1.136 2020/05/15 03:57:33 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@ -1415,7 +1415,7 @@ do_download(struct sftp_conn *conn, const char *remote_path,
(unsigned long long)offset,
num_req);
max_req = 1;
} else if (max_req <= conn->num_requests) {
} else if (max_req < conn->num_requests) {
++max_req;
}
}