-
-
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
parallel downloaded files with some of them to be 0 byte #4937
Comments
I can confirm the bug on
Also this problem is not because of the compressed flag |
What happens if you do multiple runs (delete the files before each iteration), is it timing sensitive? Is it the server, perhaps? Did you check the verbose output to see what was actually being received? |
@jay It is not timing sensitive and has nothing to do with the server. |
@jay @emilengler Thanks for reply. Otherwise,when the |
Thanks it is. Bisected to e59371a. @bagder queued handles seem to be indefinitely skipped at the beginning of parallel transfers, was there a reason for that? Lines 2041 to 2061 in b8d1366
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 4b3caa8..ab06b71 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -2055,7 +2055,7 @@ static CURLcode add_parallel_transfers(struct GlobalConfig
*addedp = FALSE;
*morep = FALSE;
result = create_transfer(global, share, addedp);
- if(result || !*addedp)
+ if(result)
return result;
for(per = transfers; per && (all_added < global->parallel_max);
per = per->next) { |
I really can't recall my thinking with that logic off the top of my head... |
@flashercs most/all of those links give 404s with no body content so I presume they no longer reproduce the problem? Can you provide a set that does repro the problem again? |
404,maybe because it's a Chinese website,but the problem can be reproduced easily.For example,several pictures source from different websites. --remote-name-all --location --compressed --user-agent "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092416 Firefox/3.0.3" --url https://assets3.thrillist.com/v1/image/1679696/size/tmg-facebook_social.jpg --url https://weneedfun.com/wp-content/uploads/2016/09/Amazing-Photos-Of-Nature-15.jpg --url https://cdn.lolwot.com/wp-content/uploads/2016/04/10-scenic-valleys-that-you-need-to-visit-1.jpg --url https://www.iliketowastemytime.com/sites/default/files/south-africa-hougaard-malan12.jpg --url https://weneedfun.com/wp-content/uploads/2016/07/Most-Beautiful-Sunset-Pictures-15.jpg --url https://s2.best-wallpaper.net/wallpaper/1280x1024/1209/Latvian-autumn-forest-river-mist-in-the-morning_1280x1024.jpg --url https://weneedfun.com/wp-content/uploads/2016/07/Most-Beautiful-Sunset-Pictures-3-1024x631.jpg --url https://cdn.thecrazytourist.com/wp-content/uploads/2018/07/ccimage-shutterstock_178412015.jpg --url https://weneedfun.com/wp-content/uploads/2016/08/Beautiful-Ocean-Sunrise-Sunset-Photos-10.jpg --url http://beautyharmonylife.com/wp-content/uploads/2014/04/distant-rain-cloud-on-highway.jpg --url http://wallpapersdsc.net/wp-content/uploads/2016/09/Rio-De-Janeiro-High-Definition-Wallpapers.jpg --parallel --parallel-max 3 |
Thanks |
Trying to return early from the funtion if no new transfers were added would break the "morep" argument and cause issues. This could to zero content "transfers" (within quotes since they would never be started) when parallel-max was reduced. Reported-by: Gavin Wong Analyzed-by: Jay Satiro Fixes #4937
I did this
When I tried to download some html files with this command
curl --config config.txt
,the last 4 downloaded html files are 0 byte,and other files are all right.However it will be allright without
--parallel-max 3
in config.txt.The config.txt content:
I expected the following
I expect all downloaded files are OK in parallel mode,with no 0 byte files.
curl 7.66 does not have this problem.
curl/libcurl version
curl 7.68.0 (x86_64-pc-win32) libcurl/7.68.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 WinIDN libssh2/1.9.0 nghttp2/1.40.0 Release-Date: 2020-01-08 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp Features: AsynchDNS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile MultiSSL NTLM SPNEGO SSL SSPI TLS-SRP brotli libz
operating system
Windows 10 17134
The text was updated successfully, but these errors were encountered: