mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-06 18:39:47 +00:00
A 19MB video download traveled as one ~26MB base64 socket ack. On a remote runner behind a slow tunnel (measured ~0.35MB/s k2lab->mini) that exceeds the hub's RPC budget and Bun's HTTP idle cutoff, so the request died with an empty reply at ~50s (and at ~240s after the first timeout bump). The route now probes with a 1MB read that reports total size + mime, then streams the rest chunk by chunk with Content-Length, honours Range/206 for players and download tools (416 on unsatisfiable ranges), and falls back to the legacy full payload when the session process predates this change (it ignores offset/length and reports no size). Also gives media/files/upload RPCs a 300s budget and raises the hub HTTP idle timeout to 240s so a slow transfer is not killed while waiting on the CLI round-trip.