Skip to content
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

HTTP Range Download cannot be used when http-accept-gzip is enabled #2210

Open
eudore opened this issue May 9, 2024 · 0 comments
Open

HTTP Range Download cannot be used when http-accept-gzip is enabled #2210

eudore opened this issue May 9, 2024 · 0 comments

Comments

@eudore
Copy link

eudore commented May 9, 2024

If the http-accept-gzip=true option is used, the download request contains the Header Accept-Encoding: deflate, gzip,
When the server responds to Compress, the length of the Body after Compress is uncertain, the response header does not exist Content-Length, and the file size cannot be obtained.

At this time, if the server supports Range, it will not be used accordingly and the aria2 file will not be created, making it impossible to use breakpoint resume and gzip at the same time.

You can use Header Range: bytes=0- or Range: bytes=0-0 when requesting,
Determine whether Range is supported and obtain the file size by responding to Header Accept-Ranges: bytes and Content-Range: bytes 0-0/Size.

example:

Administrator@{name} MINGW64 /d/Program Files/Motrix/resources/engine
$ ./aria2c.exe {url}/down/910533.txt --http-accept-gzip=true

05/09 23:53:20 [NOTICE] Downloading 1 item(s)
[#2af666 15MiB/0B CN:1 DL:1.0MiB]
05/09 23:53:26 [NOTICE] Download complete: D:/Program Files/Motrix/resources/engine/910533.txt

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
2af666|OK  |   1.0MiB/s|D:/Program Files/Motrix/resources/engine/910533.txt

Status Legend:
(OK):download completed.

Administrator@{name} MINGW64 /d/Program Files/Motrix/resources/engine
$ ./aria2c.exe {url}/down/910533.txt --http-accept-gzip=false

05/09 23:53:32 [NOTICE] Downloading 1 item(s)

05/09 23:53:32 [NOTICE] File already exists. Renamed to D:/Program Files/Motrix/resources/engine/910533.1.txt.

05/09 23:53:32 [NOTICE] Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
[#6ada17 15MiB/16MiB(96%) CN:1 DL:0.9MiB]
05/09 23:53:49 [NOTICE] Download complete: D:/Program Files/Motrix/resources/engine/910533.1.txt

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
6ada17|OK  |   0.9MiB/s|D:/Program Files/Motrix/resources/engine/910533.1.txt

Status Legend:
(OK):download completed.

If --http-accept-gzip=true cannot get the file size and does not create the aria2 file.
If --http-accept-gzip=false gzip compression is not used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant