You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for on-time re-implementation of great idea of abusing google script JSON fetch from masterking32
i rather this implementation in rust over the original one in python but i don't know why from the last version that i know which worked well for me(1.1.3) even the newest update can't download any file bigger than 256Kb
i created this issue since i saw no one else has nagged about this so far
please fix your great re-implementation
i didn't even try to take a look at it because i can't fetch from crates.io, sorry
@ehsan thanks for the report. 256K matches our RANGE_PARALLEL_CHUNK_BYTES = 256 * 1024 constant exactly, which is suspicious — sounds like the range-parallel relay is probing once and never planning the remaining chunks. Two paths can produce that symptom:
1. Origin doesn't return Content-Range on the probe (or returns it malformed)
The relay sends Range: bytes=0-262143 first. If origin responds with 200 instead of 206, range-parallel returns whatever came back (just the first 256K? No — a real 200 returns the full body). If origin responds with 206 but no Content-Range header, our validate_probe_range returns None and we fall back to the probe response — which is the 256K slice.
2. Origin advertises an absurd Content-Range total (just hardened in v1.4.0 / #151)
If Content-Range: bytes 0-262143/<huge>, we now bail out and re-fetch as a single GET. Pre-v1.4.0 we'd OOM trying to allocate the stitched buffer. v1.4.0 should fall through cleanly.
To diagnose, please share:
Exact mhrv-rs version (mhrv-rs --version). You said "even the newest" — current latest is v1.4.1, just shipped.
A specific URL where this fails. Even a public test URL (e.g. github releases / cloud storage) helps me reproduce.
Output of curl -i -H 'Range: bytes=0-262143' '<your-url>' | head -20 — that shows me what the origin returns to a probe request, which is the input to our range-parallel logic.
Live log snippet during the failed download. If we're falling back early, tracing::debug lines mention range-parallel decisions; bumping log_level to debug in your config and reproducing once would surface them.
Re crates.io reachability — totally fine that you can't fetch. The Rust source is right here in the repo if you want to look at the algorithm: src/domain_fronter.rsrelay_parallel_range.
Side note: thanks for filing this even though no one else had. It IS odd that no one else has reported it — which makes me think the failure is specific to either the origin or your config. The diagnostic info above will narrow it.
[reply via Anthropic Claude | reviewed by @therealaleph]
@Recruit1992 thanks for the confirmation — that closed the loop. Two independent reports of "every download capped at 256 KB" was enough to chase down.
Bug found and fixed. Diagnostic walkthrough:
In relay_parallel_range, the probe (a Range: bytes=0-262143 request) succeeds, the relay parses the response and sees a 206. It then plans the remaining chunks and fetches them in parallel. When a chunk fetch fails validation — common reasons being Apps Script stripping the Content-Range header on follow-up chunks, the origin returning a flat 200 on later range requests, or mismatched totals — the fallback called rewrite_206_to_200(&first). That helper converted the probe response itself (256 KiB body) into a clean HTTP 200 with Content-Length: 262144, and returned that as if it were the full file. Browsers saw a normal 200 and treated the download as complete.
The fix: when chunk validation fails or the stitched body doesn't match total, fall back to a fresh single GET without the Range header instead. Apps Script then fetches the whole URL once (up to its 50 MiB per-fetch cap) and returns a complete 200 response. Slower than the parallel path for big files, but produces a correct response which is the minimum bar.
Shipped in v1.6.2 (commit 3f014b0). CI workflow building now; APK + binaries on the release page in ~15 minutes.
@ehsan thanks for the original report. The "no one else has nagged" line in your message was me being wrong — the bug was real and others probably hit it but didn't recognize it as a bug because the download "looked complete" in the browser.
If after upgrading you still see truncated downloads, that's a different bug — please reopen with a specific URL and a debug-level log snippet showing the range-parallel: lines around the failing fetch.
Closing.
[reply via Anthropic Claude | reviewed by @therealaleph]
Activity
therealaleph commentedon Apr 25, 2026
@ehsan thanks for the report. 256K matches our
RANGE_PARALLEL_CHUNK_BYTES = 256 * 1024constant exactly, which is suspicious — sounds like the range-parallel relay is probing once and never planning the remaining chunks. Two paths can produce that symptom:1. Origin doesn't return
Content-Rangeon the probe (or returns it malformed)The relay sends
Range: bytes=0-262143first. If origin responds with 200 instead of 206, range-parallel returns whatever came back (just the first 256K? No — a real 200 returns the full body). If origin responds with 206 but noContent-Rangeheader, ourvalidate_probe_rangereturnsNoneand we fall back to the probe response — which is the 256K slice.2. Origin advertises an absurd Content-Range total (just hardened in v1.4.0 / #151)
If
Content-Range: bytes 0-262143/<huge>, we now bail out and re-fetch as a single GET. Pre-v1.4.0 we'd OOM trying to allocate the stitched buffer. v1.4.0 should fall through cleanly.To diagnose, please share:
mhrv-rs --version). You said "even the newest" — current latest is v1.4.1, just shipped.curl -i -H 'Range: bytes=0-262143' '<your-url>' | head -20— that shows me what the origin returns to a probe request, which is the input to our range-parallel logic.tracing::debuglines mention range-parallel decisions; bumpinglog_leveltodebugin your config and reproducing once would surface them.Re crates.io reachability — totally fine that you can't fetch. The Rust source is right here in the repo if you want to look at the algorithm:
src/domain_fronter.rsrelay_parallel_range.Side note: thanks for filing this even though no one else had. It IS odd that no one else has reported it — which makes me think the failure is specific to either the origin or your config. The diagnostic info above will narrow it.
[reply via Anthropic Claude | reviewed by @therealaleph]
Recruit1992 commentedon Apr 25, 2026
I have the same issue. Everything I downloaded via MHRV has been limited to 256 KB.
I had this issue with 1.2.10, 1.2.13 and now with 1.4.1. I only used the Windows client.
URL: any github url. for example: https://github.com/therealaleph/MasterHttpRelayVPN-RUST/releases/download/v1.6.1/mhrv-rs-windows-amd64.zip
I had to uplod the log file somewhere else :)
https://uplod.ir/mksb6if69hm0/log-20260425-140848.txt.htm
therealaleph commentedon Apr 25, 2026
@Recruit1992 thanks for the confirmation — that closed the loop. Two independent reports of "every download capped at 256 KB" was enough to chase down.
Bug found and fixed. Diagnostic walkthrough:
In
relay_parallel_range, the probe (aRange: bytes=0-262143request) succeeds, the relay parses the response and sees a 206. It then plans the remaining chunks and fetches them in parallel. When a chunk fetch fails validation — common reasons being Apps Script stripping theContent-Rangeheader on follow-up chunks, the origin returning a flat 200 on later range requests, or mismatched totals — the fallback calledrewrite_206_to_200(&first). That helper converted the probe response itself (256 KiB body) into a clean HTTP 200 withContent-Length: 262144, and returned that as if it were the full file. Browsers saw a normal 200 and treated the download as complete.The fix: when chunk validation fails or the stitched body doesn't match
total, fall back to a fresh single GET without the Range header instead. Apps Script then fetches the whole URL once (up to its 50 MiB per-fetch cap) and returns a complete 200 response. Slower than the parallel path for big files, but produces a correct response which is the minimum bar.Shipped in v1.6.2 (commit 3f014b0). CI workflow building now; APK + binaries on the release page in ~15 minutes.
@ehsan thanks for the original report. The "no one else has nagged" line in your message was me being wrong — the bug was real and others probably hit it but didn't recognize it as a bug because the download "looked complete" in the browser.
If after upgrading you still see truncated downloads, that's a different bug — please reopen with a specific URL and a debug-level log snippet showing the
range-parallel:lines around the failing fetch.Closing.
[reply via Anthropic Claude | reviewed by @therealaleph]
id4ehsan commentedon Apr 25, 2026
congratulation, you already fixed it before i had a chance to replay, the latest version (1.6.2) works fine for me
thank you, you are the best