Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

- Request compressed responses when querying the release index, shrinking the transfer from ~3.7MB to ~150KB.

# 4.2.4 - 2026-08-25

- `elan install`/`elan toolchain install` now report an already-installed toolchain as such and exit with code 0 instead of failing with `'...' is already installed`.
Expand Down
6 changes: 6 additions & 0 deletions src/download/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ pub mod curl {
.follow_location(true)
.chain_err(|| "failed to set follow redirects")?;

// The handle is shared with `fetch_url`, which asks for compressed responses; make
// sure we get the file's raw bytes here so that content length and resuming work.
handle
.accept_encoding("identity")
.chain_err(|| "failed to set accept encoding")?;

if resume_from > 0 {
handle
.resume_from(resume_from)
Expand Down
2 changes: 2 additions & 0 deletions src/elan-utils/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ pub fn fetch_url(url: &str) -> Result<String> {
let mut handle = handle.borrow_mut();
handle.url(url).unwrap();
handle.follow_location(true).unwrap();
// request transparent compression; the release index in particular is ~25x smaller gzipped
handle.accept_encoding("").unwrap();
let mut transfer = handle.transfer();
transfer
.write_function(|new_data| {
Expand Down
Loading