-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
CURLOPT_MAX_RECV_SPEED_LARGE < CURLOPT_BUFFERSIZE breaks SFTP download #13695
Comments
I cannot reproduce using the curl tool on Linux. Tested 8.7.1 and git master:
|
@bagder Well, it seems it's protocol specific. I can't reproduce it for HTTP protocol too. For me, it's reproducible for SFTP protocol. |
Are you using your curl command in Powershell, CMD prompt, WSL -- on your Win10 install -- can you explicitly tell us which? On Windows systems, sometimes commands such as |
@alexdconf I'm using libcurl in my own code and have this issue. However, I've just tried to test it with curl from official downloads and it has the same issue for SFTP link. I launched it from CMD, however I'm pretty sure it does not matter at all (cmd, powershell, etc.). |
@alervd Apologies, I missed that you were working with the library directly and not in a CLI environment — since you cited Windows, I know that I think I managed to reproduce the problem you have. I’m on a M1 Mac so I used a Docker container with a The test script in the Fedora environment:
The The output from the script in the Fedora environment:
|
What SSH library and version are you using? (curl -V output is always a good idea...) |
|
Any ETA on this issue fix? I've found that libcurl is too slow downloading from SFTP in case CURLOPT_BUFFERSIZE is set to default 16K. Now I have to increase it to 256K and found that my minimum speed limit is increased to this 256K also... :) |
For now, it seems there is a workaround (return CURL_WRITEFUNC_PAUSE in write func; didn't try it btw). But I would prefer to wait for a fix in case it appears in some reasonable time. |
I have not seen anyone working on this. There is no estimate. |
When aborting the transfer loop early, like when there is rate limiting in effect, there might be buffered data already read off the socket so the socket might not signal reability. Therefore we must set the CSELECT_IN manually if data_pending_() suggests there might be more data to get. This is particularly noticeable with SSH when the underlying library has drained the socket and holds pending data in its buffer. Reported-by: alervd on github Fixes #13695
I did this
I expected the following
I expect it to download with the speed limit I set with no limitations and to be able to change this limit at any time.
curl/libcurl version
libcurl 8.7.1.
operating system
Windows 10 22H2.
The text was updated successfully, but these errors were encountered: