mirror of
https://github.com/curl/curl.git
synced 2026-06-04 11:44:15 +03:00
libssh: Remove write limit capping for newer libssh versions.
Since version 0.11.0, libssh has started applying read/write length capping appropriately for both its sync and async API. The limit applied by libssh would be as per what the server imposes if the server supports sharing this info, otherwise the limits would be according to the protocol specified minimum limit that the servers should support. Hence, the calling code does not need to bother applying these limits as per the sftp protocol (libssh's newer versions since 0.11.0 would handle that) Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
parent
a2f93579b7
commit
1a655aee4e
1 changed files with 11 additions and 5 deletions
|
|
@ -3030,11 +3030,6 @@ static CURLcode sftp_send(struct Curl_easy *data, int sockindex,
|
|||
if(!sshc)
|
||||
return CURLE_FAILED_INIT;
|
||||
|
||||
/* limit the writes to the maximum specified in Section 3 of
|
||||
* https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-02
|
||||
*/
|
||||
if(len > 32768)
|
||||
len = 32768;
|
||||
#if LIBSSH_VERSION_INT > SSH_VERSION_INT(0, 11, 0)
|
||||
switch(sshc->sftp_send_state) {
|
||||
case 0:
|
||||
|
|
@ -3067,6 +3062,17 @@ static CURLcode sftp_send(struct Curl_easy *data, int sockindex,
|
|||
return CURLE_SEND_ERROR;
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* limit the writes to the maximum specified in Section 3 of
|
||||
* https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-02
|
||||
*
|
||||
* libssh started applying appropriate read/write length limits
|
||||
* internally since version 0.11.0, hence such an operation is
|
||||
* not needed for versions after (and including) 0.11.0.
|
||||
*/
|
||||
if(len > 32768)
|
||||
len = 32768;
|
||||
|
||||
nwrite = sftp_write(sshc->sftp_file, mem, len);
|
||||
|
||||
myssh_block2waitfor(conn, sshc, FALSE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue