01Adaptive connections
Adds connections while speed grows, backs off when the server objects
A download starts on 4 connections. Every two seconds the engine checks the total speed: if the new connections added at least 10%, it opens two more, up to 32. When the server answers 429 or 503, it halves the count and keeps that as the ceiling.
- Parts are re-split on the fly: when one finishes, the slowest remaining part is cut in half.
- Bytes go straight to their place in a preallocated file; there is no merge step at the end.
- Checkpoints every 250 ms in one SQLite transaction; a crash costs at most a fraction of a second.
adaptive.rs






