cURL / Mailing Lists / curl-library / Single Mail


Re: Getting files from SFTP is slower at newer versions

From: Moti Avrahami <>
Date: Tue, 31 May 2016 17:10:11 +0300

On Sun, May 29, 2016 at 9:09 PM, Ray Satiro via curl-library <> wrote:

> On 5/29/2016 4:05 AM, Moti Avrahami wrote:
>> The weird fact is that I tried it also with curl.exe and it works, but
>> doesn't work with libcurl.
>> I tried it against 2 servers and got the same result.
>> I verified the libcurl commands by the "curl.exe --libcurl" option and
>> it's seems Ok.
>> I've also sent a question to the libssh2 development group and published
>> the below debug output from libssh2, but still didn't get an answer there.
>> Any idea?
> Please do not top post, it makes your threads harder to follow and
> discourages people from reading them [1].
> As I already told you on the libssh2 mailing list I've tried 1.7.0 and it
> works for me [2]. You should disclose the server type. You should check
> that the version of libcurl being used by your application is actually the
> same as what you think, and not some older DLL or something. printf("%s\n",
> curl_version());
> Also another thing you could try is a contributor's libcurl/libssh2 build
> [3].
> [1]:
> [2]:
> [3]:
> -------------------------------------------------------------------
> List admin:
> Etiquette:

Thanks for your comments.
I further investigated it and understood it's totally not related to the
server type but more a build issue:
I created a demo exe program which uses a demo static library project, that
run libCurl commands for connecting SFTP server - this is work, the return
code is "CURLE_OK".
In contrast, my real application that uses my real lib project which run
the same libCurl commands, doesn't work - the return code is
They both (real & demo) run the same libCurl commands and they both have
the same project properties and same configuration.
Of course, I pointed them to the same libs of libcurl and libssh2.
I've also checked the version by printf("%s\n", curl_version()) and got the
right versions: libcurl/7.49.0 mbedTLS/2.2.1 libssh2/1.7.0

These are the libCurl commands I told you about:
  CURLcode ret;
  CURL *hnd;

  hnd = curl_easy_init();
  curl_easy_setopt(hnd, CURLOPT_URL, "sftp://x.x.x.x/root/file.log");
  curl_easy_setopt(hnd, CURLOPT_USERPWD, "myuser:mypass");
  curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/7.49.0");
  curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
  curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L);
  curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L);
  curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);

  ret = curl_easy_perform(hnd);

Any new ideas?


List admin:
Received on 2016-05-31