Commit 7b09256
fix(core): prevent skipped files from being allocated and written to disk
Two related issues when setting file priorities to Skip (0):
1. file_priorities were not included in add_torrent_params, so libtorrent
allocated storage for all files (including skipped ones) before
set_file_priorities() was called post-add. Now passed at add time for
torrents with metadata; magnets continue to use on_metadata_received().
2. Boundary pieces needed by adjacent wanted files leave corrupt partial
data on disk for newly-skipped files. set_file_priorities() now removes
any existing non-empty file when its priority is first set to 0.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e3825c8 commit 7b09256
2 files changed
+27
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
539 | | - | |
540 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
547 | 564 | | |
548 | 565 | | |
549 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
480 | 487 | | |
481 | 488 | | |
482 | 489 | | |
| |||
0 commit comments