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=1patch:libtorrentlibtorrent:is_fallocatable: if a file hasflag_fallocateflagis_fallocatable_file: if a file hasflag_fallocateandflag_resize_queuedflagsDownloadList::create()to take into accountsystem.file.allocatesettingd.update_prioritiesto 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_fallocateflagf.is_fallocatable_file: boolean, returns true if a file both hasflag_fallocateandflag_resize_queuedflagsf.set_fallocate,f.unset_fallocate: setters forflag_fallocateAdditional fix:
free_diskspace()method inlibtorrentto report back proper size even if a download is stoppedNote:
Unfortunately, this patch isn't complete yet, rtorrent can be still crashed: