Skip to content

Stop one CDN host hanging up from failing a download - #3

Merged
beingsuz merged 1 commit into
mainfrom
claude/project-thread-p8xp41
Sep 26, 2026
Merged

beingsuz merged 1 commit into
mainfrom
claude/project-thread-p8xp41

Conversation

@beingsuz

Copy link
Copy Markdown
Contributor

Requested by beingsuz · project thread

Before: downloading a Workshop item from haru on Windows failed with "fetch failed: malformed response: headers ended early". A CDN server accepted the connection and closed it without answering, and the manifest fetch asked exactly one host once, so that one server failed the whole download.

After: the manifest is fetched from up to four hosts, failing hosts are demoted, and the host list excludes servers that close the connection on requests they will not serve.

How:

  • cdn_hosts builds the host list the way SteamKit and DepotDownloader do: drops ISP caches restricted to other apps (allowed_app_ids), Steam China servers, proxies, and types other than CDN/SteamCache, and addresses each server by its vhost (tapline recorded it but never used it). If the filter would leave nothing, it keeps every reachable server.
  • fetch_manifest_from_pool replaces the three single-host manifest fetches.
  • The HTTP pool discards connections idle for 15 s, and the client's retry always dials a fresh connection instead of popping another pooled one that may be just as dead.
  • Fetch errors now name the host.

Verified: cargo clippy --workspace --all-targets clean and cargo test passes for tapline, tapline-cdn and tapline-rt-tokio on Linux, with new tests for the host filter. Not verified: no live download (Steam is unreachable from the sandbox), nothing run on Windows, and which of the three causes hit the reporter is inferred, not observed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JPbjRcr2kuhRi1wBhGk1ax


Generated by Claude Code

haru on Windows failed a wallpaper download with "fetch failed: malformed
response: headers ended early": a CDN server accepted the TLS connection
and closed it without answering.

- Build the host list the way SteamKit and DepotDownloader do: drop ISP
  caches restricted to other apps, Steam China servers and proxies, and
  address each server by its vhost. Falls back to every reachable server
  if the filter would leave none.
- Fetch manifests from up to four hosts, demoting the ones that fail,
  instead of asking one host once.
- Throw away pooled connections idle for 15s, and make the HTTP retry
  dial a fresh connection rather than pop another pooled one.
- Name the host in fetch errors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPbjRcr2kuhRi1wBhGk1ax
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2cfe241c-aa5d-4b8f-8c0f-69d12d5b5494

📥 Commits

Reviewing files that changed from the base of the PR and between 3e638bf and 1b133b6.

📒 Files selected for processing (3)
  • crates/tapline-cdn/src/lib.rs
  • crates/tapline-rt-tokio/src/http.rs
  • crates/tapline/src/session.rs
 ____________________________________________________________________________________________________________________
< Always design for concurrency. Allow for concurrency, and you'll design cleaner interfaces with fewer assumptions. >
 --------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@beingsuz beingsuz self-assigned this Sep 26, 2026
@beingsuz
beingsuz marked this pull request as ready for review September 26, 2026 02:39
@beingsuz
beingsuz merged commit 8c439f1 into main Sep 26, 2026
8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants