document hint_read

This commit is contained in:
Arvid Norberg 2011-04-26 23:54:25 +00:00
parent 810ce884fb
commit 72eb840b66
2 changed files with 12 additions and 1 deletions

View File

@ -7804,6 +7804,7 @@ The interface looks like this::
{
virtual bool initialize(bool allocate_files) = 0;
virtual bool has_any_file() = 0;
virtual void hint_read(int slot, int offset, int len);
virtual int readv(file::iovec_t const* bufs, int slot, int offset, int num_bufs) = 0;
virtual int writev(file::iovec_t const* bufs, int slot, int offset, int num_bufs) = 0;
virtual int sparse_end(int start) const;
@ -7853,6 +7854,17 @@ This function is called when first checking (or re-checking) the storage for a t
It should return true if any of the files that is used in this storage exists on disk.
If so, the storage will be checked for existing pieces before starting the download.
hint_read()
-----------
::
void hint_read(int slot, int offset, int len);
This function is called when a read job is queued. It gives the storage wrapper an
opportunity to hint the operating system about this coming read. For instance, the
storage may call ``posix_fadvise(POSIX_FADV_WILLNEED)`` or ``fcntl(F_RDADVISE)``.
readv() writev()
----------------

View File

@ -933,7 +933,6 @@ int main(int argc, char* argv[])
using namespace libtorrent;
session_settings settings;
settings.use_disk_read_ahead = false;
settings.user_agent = "client_test/" LIBTORRENT_VERSION;
settings.choking_algorithm = session_settings::auto_expand_choker;
//settings.announce_to_all_trackers = true;