upstream: Don't misuse the sftp limits extension's open-handles

field. This value is supposed to be the number of handles a server will allow
to be opened and not a number of outstanding read/write requests that can be
sent during an upload/download.

ok markus@

OpenBSD-Commit-ID: 14ebb6690acbd488e748ce8ce3302bd7e1e8a5b0
This commit is contained in:
djm@openbsd.org
2025-12-22 01:20:39 +00:00
committed by Damien Miller
parent daf6bdd34b
commit aaac8c61c1

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: sftp-client.c,v 1.180 2025/09/30 00:10:42 djm Exp $ */
/* $OpenBSD: sftp-client.c,v 1.181 2025/12/22 01:20:39 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -571,17 +571,6 @@ sftp_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests,
(unsigned long long)limits.read_length,
ret->upload_buflen, ret->download_buflen);
}
/* Use the server limit to scale down our value only */
if (num_requests == 0 && limits.open_handles) {
ret->num_requests =
MINIMUM(DEFAULT_NUM_REQUESTS, limits.open_handles);
if (ret->num_requests == 0)
ret->num_requests = 1;
debug3("server handle limit %llu; using %u",
(unsigned long long)limits.open_handles,
ret->num_requests);
}
}
/* Some filexfer v.0 servers don't support large packets */