We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[root@california src]# du -sh curl-7.58.0.tar.gz 3.8M curl-7.58.0.tar.gz
[root@california src]# ./curl -V curl 7.57.0 (x86_64-pc-linux-gnu) libcurl/7.57.0 OpenSSL/1.0.2h Release-Date: 2017-11-29 Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy [root@california src]# time ./curl https://curl.haxx.se/download/curl-7.58.0.tar.gz -O --limit-rate 4M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3788k 100 3788k 0 0 3788k 0 0:00:01 --:--:-- 0:00:01 28.6M real 0m0.145s user 0m0.033s sys 0m0.021s
Real download time: real 0m0.145s
real 0m0.145s
[root@california src]# ./curl -V curl 7.36.0 (x86_64-unknown-linux-gnu) libcurl/7.36.0 OpenSSL/1.0.2h Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp Features: IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP [root@california src]# time ./curl https://curl.haxx.se/download/curl-7.58.0.tar.gz -O --limit-rate 4M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3788k 100 3788k 0 0 4110k 0 --:--:-- --:--:-- --:--:-- 4113k real 0m0.936s user 0m0.027s sys 0m0.013s
Real download time: real 0m0.936s
real 0m0.936s
long Curl_pgrsLimitWaitTime(curl_off_t cursize, curl_off_t startsize, curl_off_t limit, struct curltime start, struct curltime now) { ........... /* not enough data yet */ if(size < limit) return -1; .......... }
When the download file is less than the limit speed, it cannot be limited
[root@california src]# ./curl -V curl 7.57.0 (x86_64-pc-linux-gnu) libcurl/7.57.0 OpenSSL/1.0.2h Release-Date: 2017-11-29 Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy [root@california src]# time ./curl https://curl.haxx.se/download/curl-7.58.0.tar.gz -O --limit-rate 4M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 3788k 100 3788k 0 0 3788k 0 0:00:01 --:--:-- 0:00:01 4052k real 0m0.950s user 0m0.026s sys 0m0.015s
Real download time: real 0m0.950s
real 0m0.950s
Linux california 4.13.2-1.el7.elrepo.x86_64 #1 SMP Wed Sep 13 18:48:00 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
Maybe we should just make it
/* not enough data yet */ if(!limit) return -1;
What do you think?
Sorry, something went wrong.
Good idea!
limit-rate: kick in even before "limit" data has been received
44c4233
... and make sure to avoid integer overflows with really large values. Reported-by: 刘佩东 Fixes #2371
@liupeidong0620 give #2373 a try if you can
72a0f62
No branches or pull requests
I did this
Download file size:
Problems with the new version:
Real download time:
real 0m0.145s
I expected the following
Correct performance
Real download time:
real 0m0.936s
The reason for the problem is here
When the download file is less than the limit speed, it cannot be limited
After this code comment, execute the program:
Real download time:
real 0m0.950s
operating system
The text was updated successfully, but these errors were encountered: