Modify fixing honoring system.file.allocate.set=1 patch in git version
chros73 opened this issue · 0 comments
chros73 commented
With the previous patch (#39) rtorrent could be crashed:
- e.g. when a magnet link was loaded, started and there wasn't enough disk space for it
Modify fixing honoring system.file.allocate.set=1
patch:
- do not allow to start a torrent if there's not enough disk space for it
- notify the user about this
- modify priorities of files as well in
libtorrent
- add 2 new file property in
libtorrent
:is_fallocatable
: if a file hasflag_fallocate
flagis_fallocatable_file
: if a file hasflag_fallocate
andflag_resize_queued
flags
- modify
DownloadList::create()
to take into accountsystem.file.allocate
setting - modify
d.update_priorities
to be able to pass along file flags - refactor
DownloadList::resume()
a bit
New 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:
- fix
free_diskspace()
method inlibtorrent
to report back proper size even if a download is stopped
Note:
Unfortunately, this patch isn't complete yet, rtorrent can be still crashed:
- load a multi file torrent that is larger than free disk space but not start it
- deselect some files to be able to start download and start it
- file allocation will be immediate
- now select some previously deselected files that won't fit on the disk
- rtorrent will crash