Subject: Re: curl / libssh2 sftp write performance (with patch)

Re: curl / libssh2 sftp write performance (with patch)

From: Daniel Jeliński <>
Date: Tue, 28 Aug 2018 13:57:28 +0200

wt., 28 sie 2018 o 12:10 Peter Stuge <> napisał(a):
> Can you use channel windowing in the transport protocol here? If not, why not?

Channel windowing is used, and under normal circumstances should limit
the number of outstanding packets without further intervention.
However, an evil server could send window increases without sending
status responses, which would bloat our number of outstanding buffers,
as we only remove buffers from the list when we receive corresponding
status response. Is that what you're referring to?

> Add a new API which would be used to enable the new behavior. The API
> should probably not be too specific to this behavior, but should also
> not be too generic.

Something like:
typedef enum {
} SftpOption;

libssh2_sftp_setopt(LIBSSH2_SFTP_HANDLE *handle, SftpOption option, ...);

used like:
libssh2_sftp_setopt(handle, SFTPOPT_USESENDBUFFER , 1L) to enable the
new behavior?

> Also consider whether a new API really belongs on SFTP level or perhaps
> rather on channel level.

Wouldn't we want to enable this behavior on every file handle independently?


Received on 2018-08-28