Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix honoring system.file.allocate.set=1 rtorrent config setting #604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chros73
Copy link
Contributor

@chros73 chros73 commented May 15, 2017

Depends on: rakshasa/libtorrent#152
Probably clashes with: #575 (it depends on it)

With the previous patch rtorrent could be easily 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

@chros73
Copy link
Contributor Author

chros73 commented May 15, 2017

@rakshasa , I'll try to do something about the 2nd (incomplete) part this week. If I'll won't be able to figure out a good solution then I'll leave this with you (it's getting more and more complicated :) ).
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant