axel-download-accelerator / axel

Lightweight CLI download accelerator
GNU General Public License v2.0
2.85k stars 258 forks source link

Progress bar fixed on 0% #121

Closed hvsw closed 6 years ago

hvsw commented 6 years ago

The progress bar is fixed in 0% when installing from Homebrew on macOS High Sierra.

To test: $ axel https://repo.continuum.io/archive/Anaconda3-5.0.0-MacOSX-x86_64.pkg

Is there any correction for this?

ordex commented 6 years ago

@henriqueiv is it just a problem of "the bar"? I mean, does the download eventually complete or does it get stuck and never finishes?

hvsw commented 6 years ago

Yes, just the bar. The file is correctly downloaded. The % and the bar doesn’t update. The speed is ok also.

ordex commented 6 years ago

@henriqueiv thanks a lot for your reply. Can you clarify if your axelrc file contains alternate_output = 1 or not? That may point us to the right area of the code.

Thanks again!

ordex commented 6 years ago

I have been able to see the problem. It happens with both standard and alternate output

hvsw commented 6 years ago

@ordex I'm not with my Mac right now but my axelrc file has never been changed, so if there is a default value, this value is still there for sure.

ordex commented 6 years ago

thanks @henriqueiv . However I have been able to reproduce the issue, therefore I should be able to understand what's wrong now. Thanks again for reporting!

ordex commented 6 years ago

I take back what I said. I just tried downloading a 100MB file and the % increases as expected. I just made several tests.

The file you recommend is bigger than 100GB, which means that it will turn 1% after 1GB, which requires quite some time. @henriqueiv have you managed to complete this download (until 100GB) and the % was always 0?

hvsw commented 6 years ago

@ordex this file is only 567MB as you can see in here.

The output when executing axel https://repo.continuum.io/archive/Anaconda3-5.0.0-MacOSX-x86_64.pkg is:

Initializing download: https://repo.continuum.io/archive/Anaconda3-5.0.0-MacOSX-x86_64.pkg
Opening output file Anaconda3-5.0.0-MacOSX-x86_64.pkg.1
Server unsupported, starting from scratch with one connection.
Starting download

[  0%]  .......... .......... .......... .......... ..........  [  57.9KB/s]
.
.
.
[  0%]  .......... .......... .......... .......... ..........  [7035.5KB/s]
[  0%]  .......... ......^C.... .
Downloaded 185.9 Megabyte in 27 seconds. (7035.56 KB/s)

Ps. I canceled the download just to get the downloaded size.

It seems the problem is the file size axel is getting.

ordex commented 6 years ago

yeah, apparently something is fooling Axel. The problem exists also on Linux.

ordex commented 6 years ago

Apparently this server does not support range-requests (as reported by the output) and axel, as a fallback measure, was setting the size to LLONG_MAX.

This is meaningful if the server did not provide any size, but if it did (like in this case) it should be preserved.

I'll send a fix for this soon.

ordex commented 6 years ago

I have created PR #123. @henriqueiv would you be able to compile from source and test the fix?