Commit Graph
113 Commits
Author SHA1 Message Date
Konstantin OstrovskiiandLevi a34383a7e2 fix(http): wait for the prefetch goroutine to exit before reusing its file (#1606)
* fix(http): wait for the prefetch goroutine to exit before reusing its file

stopPrefetchAndCopyData waited at most 10 s for the Resolve prefetch, but a
stalled body read only times out after readTimeout (15 s). The caller then
closed and removed the temporary file while the prefetch goroutine could
still write to it.

Stopping the prefetch now closes the Resolve body, which interrupts a
pending read, and waits on a channel closed when the goroutine exits. Pause
uses the same path. The stop channel is closed under resolveRespLock so a
concurrent Pause and first-connection takeover cannot close it twice.

The proxy test helper now calls Setup before Resolve, as the downloader
does, so the Resolve request also goes through the proxy.

Fixes #1563

* refactor(http): wait on prefetchExitCh in completeFromResolveFallback

Replaces the 10 ms polling loop with the exit channel added in the
previous commit, so every place that waits for the prefetch uses it.

---------

Co-authored-by: Levi <[email protected]>
2026-11-09 11:14:49 +08:00
Konstantin Ostrovskii d873cd411c fix(http): copy a fully prefetched body when Start runs before prefetchDone (#1608)
The prefetch goroutine sets prefetchDone only after one more read and
closing the body. A Start in that window took the whole file as the
fallback snapshot, expandConnections marked the task done, and the temp
file was never copied, leaving a zero-filled target.

Read prefetchSize once and treat the prefetch as complete when it reached
the known size.
2026-11-06 09:24:19 +08:00
Junker der Provinz cd19772099 fix(bt): races between building and closing the shared client (#1587) 2026-11-02 21:03:16 +08:00
Silas Mariusz c0b70d319d feat(protocol): add FTP, FTPS and FTPES downloads (#1569) 2026-10-30 17:01:46 +08:00
Arpit Khandelwal 91edba9af6 perf(http): replace per-read goroutine in TimeoutReader with a timer (#1597) 2026-10-28 13:58:06 +08:00
Levi d125d4ab75 feat(http): support advisory extension download sizes (#1599) 2026-10-22 23:35:01 +08:00
Levi 4214765d39 refactor: remove proxy API (#1596) 2026-10-21 22:48:17 +08:00
Arpit Khandelwal 47cafb7575 perf(http): use 64 KiB connection read buffers (#1588) 2026-10-21 14:19:01 +08:00
Levi de65149b29 refactor(downloader): remove opts parameter from Resolve (#1595) 2026-10-19 21:40:57 +08:00
Junker der Provinz 5462b14705 feat(bt): support disabling DHT and PEX (#1555) 2026-10-17 11:22:34 +08:00
Ashish Goswami 6f20790b17 feat(protocol/http, mcpserver, download): add checksum verification, MCP speed tool, pause webhook, and CLI flags (#1542) 2026-10-13 08:28:56 +08:00
Kunpeng Xie fa622a4063 fix(http): skip prefetch wait for restored downloads (#1584) 2026-10-12 11:13:42 +08:00
Levi c6619794fc fix: preserve Cookie headers in extension requests (#1581) 2026-10-10 22:10:08 +08:00
JiangJiang 363153fa33 fix(http): use Content-Range total size for 206 responses (#1545) 2026-09-23 09:52:59 +08:00
Levi 88d150b933 test(bt): isolate cleanup fixtures from part-file promotion (#1531) 2026-09-21 22:30:54 +08:00
Levi 8301b1f9ce feat(http): accelerate connection expansion with squared batches (#1530) 2026-09-18 23:22:57 +08:00
Levi 1ab452ced8 fix(bt): honor selected files when creating resolved tasks (#1523) 2026-09-18 22:32:09 +08:00
Levi b1dd46cc7c feat: spool media inputs to disk and report producer progress (#1520) 2026-09-18 22:17:22 +08:00
Levi c667f097dc feat: add FFmpeg WASM runtime (#1512) 2026-09-16 00:38:22 +08:00
sun 46c34f2e92 feat(hls): add native HLS (m3u8) download protocol (#1515) 2026-09-15 23:40:31 +08:00
Wu Shuwen 04b9aa18ec fix(http): infer extension for opaque URLs (#1495) 2026-09-11 08:01:32 +08:00
Levi 177c225f16 feat: new ui (#1455) 2026-09-05 19:53:41 +08:00
Levi 3be8db664c fix(http): resume ranged downloads with unknown size (#1467) 2026-09-03 23:16:38 +08:00
Levi 9b704f6f14 fix(http): keep Resolve response until Range takeover succeeds (#1465) 2026-09-02 23:49:37 +08:00
ggg f49e2510f5 fix(http): re-probe range support after sequential retry (#1464) 2026-09-02 14:29:48 +08:00
Levi c5c8bb2bf5 fix(http): reset discarded prefetch progress on resume (#1462) 2026-08-31 23:05:01 +08:00
ggg 962ff4dc98 fix(http): fall back when servers ignore range requests (#1459) 2026-08-31 22:32:14 +08:00
Levi 59f3aa7028 test: enforce async extension API contract (#1452) 2026-08-27 12:51:37 +08:00
Levi cfdf87c3b8 feat: HTTP add TLS fingerprint fallback (#1444) 2026-08-20 20:21:02 +08:00
Levi 9fb3758203 feat: replace gblob with blob http transport (#1407) 2026-07-14 20:05:33 +08:00
Levi def54f8998 feat: add WebView support for extension (#1359) 2026-04-24 22:16:33 +08:00
Levi a205c0b8d7 feat: add gblob scheme support for extension (#1358) 2026-04-19 19:15:48 +08:00
Levi 847e88881d fix: non-range HTTP downloaded bytes exceeding total file size (#1317) 2026-03-18 18:53:49 +08:00
Levi 09f7c88ed3 feat: ed2k protocol support (#1316) 2026-03-17 19:42:16 +08:00
Levi 3eb6df55df feat: implement task patching functionality (#1267) 2026-02-06 23:42:57 +08:00
Levi 93088b22f1 fix: improve retry handling for expired HTTP redirect url (#1263) 2026-01-29 22:13:42 +08:00
Levi c9626cb389 perf: slow down DHT announcing on errors (#1186) 2026-01-14 20:04:21 +08:00
Levi a9eee26be7 refactor: fethcer interface & download flow (#1229) 2026-01-08 21:50:47 +08:00
Copilot abd16d5326 fix: filename truncation for HTML-encoded ampersands in Content-Disposition (#1215) 2026-01-05 22:56:04 +08:00
Copilot 6756d82ffa fix: use PathUnescape for filename URL decoding (#1214) 2026-01-05 21:46:50 +08:00
Matteo Pietro Dazzi b0e133b554 feat: show extraction progress (#1217) 2025-12-31 09:25:21 +08:00
Copilot 2f5fbfb17c fix: HTTP filename parsing for mixed encodings and GBK-encoded (#1189) 2025-11-29 11:34:50 +08:00
Levi 75a8a3a9ac ci: downgrade to Ubuntu 22.04 (#1128) 2025-10-09 21:01:06 +08:00
Levi 20a70d7f91 fix: certain special single-file torrent downloads (#1136) 2025-09-29 22:52:06 +08:00
Levi 46c379d556 fix: resolve incorrect download path for single file torrent (#1111) 2025-09-10 07:59:10 +08:00
Krau cfdcb586ee fix: decode URL-encoded filename from contentDisposition header (#1099) 2025-09-04 18:22:30 +08:00
Levi 3451f577ab fix: remove invalid characters in HTTP headers (#1053) 2025-07-15 22:34:10 +08:00
Charles Huang 3262e5a11b fix: do not add external tracker to a private torrent (#1011) 2025-04-23 22:53:15 +08:00
Charles Huang ff43a373cd fix: json syntax error in bt config (#1014) 2025-04-23 13:48:46 +08:00
Levi b0ef2c2a87 fix: bt seed cause crash (#985) 2025-04-08 18:38:17 +08:00