diff --git a/docs/make_torrent.html b/docs/make_torrent.html index c1cc6de29..4af1f9f4d 100644 --- a/docs/make_torrent.html +++ b/docs/make_torrent.html @@ -279,10 +279,10 @@ create_torrent(torrent_info const& ti);
The piece_size is the size of each piece in bytes. It must be a multiple of 16 kiB. If a piece size of 0 is specified, a -piece_size will becalculated such that the torrent file is roughly 40 kB.
+piece_size will be calculated such that the torrent file is roughly 40 kB.If a pad_size_limit is specified (other than -1), any file larger than the specified number of bytes will be preceeded by a pad file to align it -with the start od a piece. The pad_file_limit is ignored unless the +with the start of a piece. The pad_file_limit is ignored unless the optimize flag is passed.
The overload that takes a torrent_info object will make a verbatim copy of its info dictionary (to preserve the info-hash). The copy of @@ -301,7 +301,7 @@ optimized disk-I/O. be opened in clients that don't specifically support merkle torrents. The benefit is that the resulting torrent file will be much smaller and not grow with more pieces. When this option is specified, it is -recommended to have a 16 kiB piece size. +recommended to have a fairly small piece size, say 64 kiB.
Table of contents
The piece_size is the size of each piece in bytes. It must be a multiple of 16 kiB. If a piece size of 0 is specified, a -piece_size will becalculated such that the torrent file is roughly 40 kB.
+piece_size will be calculated such that the torrent file is roughly 40 kB.If a pad_size_limit is specified (other than -1), any file larger than the specified number of bytes will be preceeded by a pad file to align it -with the start od a piece. The pad_file_limit is ignored unless the +with the start of a piece. The pad_file_limit is ignored unless the optimize flag is passed.
The overload that takes a torrent_info object will make a verbatim copy of its info dictionary (to preserve the info-hash). The copy of @@ -301,7 +301,7 @@ optimized disk-I/O. be opened in clients that don't specifically support merkle torrents. The benefit is that the resulting torrent file will be much smaller and not grow with more pieces. When this option is specified, it is -recommended to have a 16 kiB piece size. +recommended to have a fairly small piece size, say 64 kiB.
Table of contents
Each class and function is described in this manual.
For a description on how to create torrent files, see make_torrent.
A common problem developers are facing is torrents stopping without explanation. +Here is a description on which conditions libtorrent will stop your torrents, +how to find out about it and what to do about it.
+Make sure to keep track of the paused state, the error state and the upload +mode of your torrents. By default, torrents are auto-managed, which means +libtorrent will pause them, unpause them, scrape them and take them out +of upload-mode automatically.
+Whenever a torrent encounters a fatal error, it will be stopped, and the +session_status::error will describe the error that caused it. If a torrent +is auto managed, it is scraped periodically and paused or resumed based on +the number of downloaders per seed. This will effectively seed torrents that +are in the greatest need of seeds.
+If a torrent hits a disk write error, it will be put into upload mode. This +means it will not download anything, but only upload. The assumption is that +the write error is caused by a full disk or write permission errors. If the +torrent is auto-managed, it will periodically be taken out of the upload +mode, trying to write things to the disk again. This means torrent will recover +from certain disk errors if the problem is resolved. If the torrent is not +auto managed, you have to call set_upload_mode() to turn +downloading back on again.
+There are a few typedefs in the libtorrent namespace which pulls @@ -552,7 +577,7 @@ public:
typedef storage_interface* (&storage_constructor_type)( - file_storage const&, fs::path const&, file_pool&); + file_storage const&, file_storage const*, fs::path const&, file_pool&); struct add_torrent_params { @@ -572,6 +597,7 @@ struct add_torrent_params void* userdata; bool seed_mode; bool override_resume_data; + bool upload_mode; }; torrent_handle add_torrent(add_torrent_params const& params); @@ -660,6 +686,11 @@ about the torrent's progress, its peers etc. It is also used to abort a torrent.If override_resume_data is set to true, the paused and auto_managed state of the torrent are not loaded from the resume data, but the states requested by this add_torrent_params will override it.
+If upload_mode is set to true, the torrent will be initialized in upload-mode, +which means it will not make any piece requests. This state is typically entered +on disk I/O errors, and if the torrent is also auto managed, it will be taken out +of this state periodically. This mode can be used to avoid race conditions when +adjusting priorities of pieces before allowing the torrent to start downloading.
If the torrent is in an error state (i.e. torrent_status::error is non-empty), this will clear the error and start the torrent again.
+void set_upload_mode(bool m) const; ++
Explicitly sets the upload mode of the torrent. In upload mode, the torrent will not +request any pieces. If the torrent is auto managed, it will automatically be taken out +of upload mode periodically (see session_settings::optimistic_disk_retry). Torrents +are automatically put in upload mode whenever they encounter a disk write error.
+m should be true to enter upload mode, and false to leave it.
+To test if a torrent is in upload mode, call torrent_handle::status() and inspect +torrent_status::upload_mode.
+@@ -2830,6 +2875,8 @@ struct torrent_status int sparse_regions; bool seed_mode; + + bool upload_mode; };progress is a value in the range [0, 1], that represents the progress of the @@ -3004,6 +3051,13 @@ a limit on the number of sparse regions in a single file there.
seed_mode is true if the torrent is in seed_mode. If the torrent was started in seed mode, it will leave seed mode once all pieces have been checked or as soon as one piece fails the hash check.
+upload_mode is true if the torrent is blocked from downloading. This +typically happens when a disk write operation fails. If the torrent is +auto-managed, it will periodically be taken out of this state, in the +hope that the disk condition (be it disk full or permission errors) has +been resolved. If the torrent is not auto-managed, you have to explicitly +take it out of the upload mode by calling set_upload_mode() on the +torrent_handle.
user_agent this is the client identification to the tracker. @@ -3794,14 +3848,12 @@ into the read cache is always capped by the piece boundry.
When a piece in the write cache has write_cache_line_size contiguous blocks in it, they will be flushed. Setting this to 1 effectively disables the write cache.
-adjust_priority_on_disk_failure specifies what libtorrent should do -on disk failures. If this is set to true, instead of pausing the torrent -and setting it to an error state when it fails to write to disk, the -priorities of all pieces are set to 0. This effectively means the client -can keep seeding the parts that were already downloaded, instead of -leaving the swarm because of the error.
-If a read operation fails, it will still set an error on the torrent -and pause it.
+optimistic_disk_retry is the number of seconds from a disk write +errors occur on a torrent until libtorrent will take it out of the +upload mode, to test if the error condition has been fixed.
6d9 +libtorrent will only do this automatically for auto managed torrents.
+You can explicitly take a torrent out of upload only mode using +set_upload_mode().
In order to always unchoke peers, turn off automatic unchoke session_settings::auto_upload_slots and set the number of upload slots to a large -number via session::set_max_uploads().
+number via session::set_max_uploads(), or use -1 (which means infinite).