all: reword comments to state behavior directly

Comments (and one test comment) now describe the rules on their own terms
instead of by comparison to another downloader. No behavior change.
This commit is contained in:
2026-06-21 16:10:13 +09:00
parent 6c045999f2
commit 6e77cde4cc
5 changed files with 12 additions and 14 deletions

View File

@@ -313,8 +313,8 @@ func (d *Download) Run(ctx context.Context) (err error) {
}
// --check-integrity: re-hash the existing on-disk data BEFORE arming the
// request loop, so already-good pieces are not re-requested from peers (aria2
// verifies first, then fetches only what is missing).
// request loop, so already-good pieces are not re-requested from peers
// (verify first, then fetch only what is missing).
if d.opts.CheckIntegrity {
if err := t.VerifyDataContext(ctx); err != nil {
return err
@@ -376,8 +376,8 @@ func (d *Download) choose(t *torrent.Torrent) error {
// metadataTimeout bounds the magnet metadata-fetch phase. A magnet with no
// reachable peers — a dead link, or UDP trackers behind a firewall with no DHT —
// would otherwise hang forever, so awaitInfo gives up after this fixed window.
// It is not a user-facing flag: aria2 has no --bt-metadata-timeout, and 60s is a
// generous ceiling that a healthy swarm clears in well under a second.
// It is not a user-facing flag — 60s is a generous ceiling that a healthy swarm
// clears in well under a second.
const metadataTimeout = 60 * time.Second
// awaitInfo blocks until the torrent metadata arrives, giving up after