-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow loading of directory content via SFTP when timeout is set #3506
Comments
Noticed the very same problem and for me it works very slow even without any additional arguments just: In version 7.61.0 that command takes (for a folder with 4 entries) 0.7s and in 7.61.1 (first affected version) it takes 6.7s for a localhost sftp server. |
Same for me, 7.61.1 is way slower than version 7.61.0 when doing a simple sftp listing. It seems curl-7.61.1 does exactly one line of print-out per second as one can see with --trace-time:
So there is somewhere an artificial 1 second delay per printed line! Hope this rings some bells... |
I can reproduce. Fix pending. |
If the state machine isn't complete, didn't fail and it didn't return due to blocking it can just as well loop again. This addresses the problem with SFTP directory listings where we would otherwise return back to the parent and as the multi state machine doesn't have any code for using CURLM_CALL_MULTI_PERFORM for as long the doing phase isn't complete, it would return out when in reality there was more data to deal with. Fixes #3506
Works for me, version 7.64.0 plus this patch. |
Thanks for confirming! |
Directory listing is wery slow when connecting to a SFTP server with CURLOPT_TIMEOUT or -m cmd option. Without a timeout everything works fast.
Tested on my Mac (macos 10.14.2) when connecting to other Mac with curl v7.64.0 (or with daily snapshot 20190129) with following command:
curl sftp://<host>/ -m 20 -u <user>
There is some delay for loading of each subdirectory/file.
In curl v7.61.0 the same command performs almost instantly.
After some investigation I found that the bug was introduced with changes to lib/ssh.c in commit 1a89099
The text was updated successfully, but these errors were encountered: