Ivan Kosik
2017-07-19 17:51:36 UTC
Hello!
Now default_storage can lock all files (during the opening) if lock_files
was set to true in session_settings.
Unfortunately, we have no possibility to override
default_storage::open_file_impl
method, cause it is private (not virtual protected).
Is there a possibility to add field
bool m_lock_files = false;
to default_storage class members?
And change one line of default_storage::open_file_impl implementation
from:
if (lock_files) mode |= open_mode::lock_file;
to:
if (settings_lock_files || m_lock_files) mode |= open_mode::lock_file; //
settings_lock_files is the renamed variable lock_files
Then everyone will have a possibility, for example, to override
default_storage::initialize method and depending on torrent files to
take a desicion to lock them or no (by changing value of m_lock_files
member).
Is it a good way for selective locking of files? Or have we missed
something?
Now default_storage can lock all files (during the opening) if lock_files
was set to true in session_settings.
Unfortunately, we have no possibility to override
default_storage::open_file_impl
method, cause it is private (not virtual protected).
Is there a possibility to add field
bool m_lock_files = false;
to default_storage class members?
And change one line of default_storage::open_file_impl implementation
from:
if (lock_files) mode |= open_mode::lock_file;
to:
if (settings_lock_files || m_lock_files) mode |= open_mode::lock_file; //
settings_lock_files is the renamed variable lock_files
Then everyone will have a possibility, for example, to override
default_storage::initialize method and depending on torrent files to
take a desicion to lock them or no (by changing value of m_lock_files
member).
Is it a good way for selective locking of files? Or have we missed
something?
--
Best regards,
Ivan Kosik
Best regards,
Ivan Kosik