chros73/rtorrent-ps-ch

Modify fixing honoring system.file.allocate.set=1 patch in git version

chros73 opened this issue · 0 comments

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 has flag_fallocate flag
    • is_fallocatable_file : if a file has flag_fallocate and flag_resize_queued flags
  • modify DownloadList::create() to take into account system.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 : boolean
  • d.allocatable_size_bytes : size in bytes needed to create the download
  • f.is_fallocatable , : boolean, returns true if a file has flag_fallocate flag
  • f.is_fallocatable_file : boolean, returns true if a file both has flag_fallocate and flag_resize_queued flags
  • f.set_fallocate, f.unset_fallocate : setters for flag_fallocate

Additional fix:

  • fix free_diskspace() method in libtorrent 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