Fix honoring system.file.allocate.set=1 rtorrent config setting #604
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on: rakshasa/libtorrent#152
Probably clashes with: #575 (it depends on it)
With the previous patch rtorrent could be easily crashed:
Modify fixing honoring
system.file.allocate.set=1
patch:libtorrent
libtorrent
:is_fallocatable
: if a file hasflag_fallocate
flagis_fallocatable_file
: if a file hasflag_fallocate
andflag_resize_queued
flagsDownloadList::create()
to take into accountsystem.file.allocate
settingd.update_priorities
to be able to pass along file flagsDownloadList::resume()
a bitNew commands in rtorrent:
d.is_enough_diskspace
: booleand.allocatable_size_bytes
: size in bytes needed to create the downloadf.is_fallocatable
, : boolean, returns true if a file hasflag_fallocate
flagf.is_fallocatable_file
: boolean, returns true if a file both hasflag_fallocate
andflag_resize_queued
flagsf.set_fallocate
,f.unset_fallocate
: setters forflag_fallocate
Additional fix:
free_diskspace()
method inlibtorrent
to report back proper size even if a download is stoppedNote:
Unfortunately, this patch isn't complete yet, rtorrent can be still crashed: