Repository navigation
DLS v0.3.0 — de-duplication and mirror self-verification
New
| Queue de-duplication | One destination is never fetched twice. Same source + same path returns the running job; if that job already finished and its file is still on disk, the finished job is returned instead. A different source claiming the same path fails with dest-in-use rather than starting a second writer. |
| Mirror self-verification | A mirror is HEADed before use: the length must equal the origin's, and when the origin advertises an ETag the mirror's must match after normalisation (W/"x" == x). Mirrors that fail are dropped and logged. |
Behaviour worth knowing
{ "ok": true, "jobId": "J#12", "state": "completed", "dest": "D:\\a.bin", "deduplicated": true }deduplicated: true appears when an existing job answered the request. The ownership rule is unchanged — the reused job still belongs to the session that started it, so another session can wait on it but cannot pause or cancel it.
A deleted file does not count as "already downloaded": the job is reused only while the file is still on disk, so a fresh download happens when it is not.
The honesty clause
Length and ETag are what a mirror claims. A malicious mirror can copy the origin's ETag and serve different bytes of the same size, and this check will accept it. What it does catch is the everyday failure: a mirror holding an older build, or answering with an HTML error page.
Only sha256 proves content. Mirrors are a fallback, not a guarantee.
Also fixed
Fairness had a bias: every scheduling pass started from the first session in iteration order, so the session served last kept losing ties. A rotating cursor now sends it to the back of the next pass.
Tests
23 offline cases (10 new here). No network, no aria2, no DSH needed.
Install
dsh plugin add dsh-dl-server@0.3.0