{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.RF4253GN/b1/libtorrent-rasterbar_2.0.8-1_armhf.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.RF4253GN/b2/libtorrent-rasterbar_2.0.8-1_armhf.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,7 +1,7 @@\n \n cb7f463dd59fe7b3e50665b7e788ac90 360888 libdevel optional libtorrent-rasterbar-dev_2.0.8-1_armhf.deb\n- c95460bb3bf39c87570bc3e2718be556 1605464 doc optional libtorrent-rasterbar-doc_2.0.8-1_all.deb\n+ 100086c394ca7e9a3199126c098bbae5 1605372 doc optional libtorrent-rasterbar-doc_2.0.8-1_all.deb\n d74ef670c8eb711cc46754436cfdafd2 48933948 debug optional libtorrent-rasterbar2.0-dbgsym_2.0.8-1_armhf.deb\n adbe576fcd969b54947090060dd60bc8 1388148 libs optional libtorrent-rasterbar2.0_2.0.8-1_armhf.deb\n d9024806693d4a387ae19f292da79938 12706204 debug optional python3-libtorrent-dbgsym_2.0.8-1_armhf.deb\n- 14256d0c091538c09664a2d142c4cb90 609856 python optional python3-libtorrent_2.0.8-1_armhf.deb\n+ ff03653dc0d35d37fcad61d639e65d53 609856 python optional python3-libtorrent_2.0.8-1_armhf.deb\n"}, {"source1": "libtorrent-rasterbar-doc_2.0.8-1_all.deb", "source2": "libtorrent-rasterbar-doc_2.0.8-1_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2022-10-23 15:10:21.000000 debian-binary\n -rw-r--r-- 0 0 0 3632 2022-10-23 15:10:21.000000 control.tar.xz\n--rw-r--r-- 0 0 0 1601640 2022-10-23 15:10:21.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 1601548 2022-10-23 15:10:21.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -101,15 +101,15 @@\n -rw-r--r-- 0 root (0) root (0) 54531 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html\n -rw-r--r-- 0 root (0) root (0) 48252 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html\n -rw-r--r-- 0 root (0) root (0) 16422 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html\n -rw-r--r-- 0 root (0) root (0) 24490 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html\n -rw-r--r-- 0 root (0) root (0) 9085 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-ed25519.html\n -rw-r--r-- 0 root (0) root (0) 33602 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html\n -rw-r--r-- 0 root (0) root (0) 29147 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/security-audit.html\n--rw-r--r-- 0 root (0) root (0) 1334388 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html\n+-rw-r--r-- 0 root (0) root (0) 1334418 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html\n -rw-r--r-- 0 root (0) root (0) 10121 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/streaming.html\n -rw-r--r-- 0 root (0) root (0) 6746 2022-10-23 11:28:40.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/style.css\n -rw-r--r-- 0 root (0) root (0) 520020 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html\n -rw-r--r-- 0 root (0) root (0) 3021 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/troubleshooting.html\n -rw-r--r-- 0 root (0) root (0) 25025 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tuning-ref.html\n -rw-r--r-- 0 root (0) root (0) 132588 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tutorial-ref.html\n -rw-r--r-- 0 root (0) root (0) 16305 2022-10-23 15:10:21.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/udp_tracker_protocol.html\n"}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html", "unified_diff": "@@ -28,313 +28,311 @@\n 2.0.8\n \n \n

home

\n
\n

Table of contents

\n
\n-[report issue]
\n-

add_torrent_params

\n-

Declared in "libtorrent/add_torrent_params.hpp"

\n-

The add_torrent_params contains all the information in a .torrent file\n-along with all information necessary to add that torrent to a session.\n-The key fields when adding a torrent are:

\n-\n-

In order to add a torrent to a session, one of those fields must be set\n-in addition to save_path. The add_torrent_params object can then be\n-passed into one of the session::add_torrent() overloads or\n-session::async_add_torrent().

\n-

If you only specify the info-hash, the torrent file will be downloaded\n-from peers, which requires them to support the metadata extension. For\n-the metadata extension to work, libtorrent must be built with extensions\n-enabled (TORRENT_DISABLE_EXTENSIONS must not be defined). It also\n-takes an optional name argument. This may be left empty in case no\n-name should be assigned to the torrent. In case it's not, the name is\n-used for the torrent as long as it doesn't have metadata. See\n-torrent_handle::name.

\n-

The add_torrent_params is also used when requesting resume data for a\n-torrent. It can be saved to and restored from a file and added back to a\n-new session. For serialization and de-serialization of\n-add_torrent_params objects, see read_resume_data() and\n-write_resume_data().

\n-

The add_torrent_params is also used to represent a parsed .torrent\n-file. It can be loaded via load_torrent_file(), load_torrent_buffer() and\n-load_torrent_parsed(). It can be saved via write_torrent_file().

\n+[report issue]
\n+

announce_infohash

\n+

Declared in "libtorrent/announce_entry.hpp"

\n
\n-struct add_torrent_params\n+struct announce_infohash\n {\n-   int version  = LIBTORRENT_VERSION_NUM;\n-   std::shared_ptr<torrent_info> ti;\n-   aux::noexcept_movable<std::vector<std::string>> trackers;\n-   aux::noexcept_movable<std::vector<int>> tracker_tiers;\n-   aux::noexcept_movable<std::vector<std::pair<std::string, int>>> dht_nodes;\n-   std::string name;\n-   std::string save_path;\n-   storage_mode_t storage_mode  = storage_mode_sparse;\n-   client_data_t userdata;\n-   aux::noexcept_movable<std::vector<download_priority_t>> file_priorities;\n+   std::string message;\n+   error_code last_error;\n+   int scrape_incomplete  = -1;\n+   int scrape_complete  = -1;\n+   int scrape_downloaded  = -1;\n+   std::uint8_t fails : 7;\n+   bool updating : 1;\n+   bool start_sent : 1;\n+   bool complete_sent : 1;\n+};\n+
\n+[report issue]
\n+
message
\n+
if this tracker has returned an error or warning message\n+that message is stored here
\n+
\n+[report issue]
\n+
last_error
\n+
if this tracker failed the last time it was contacted\n+this error code specifies what error occurred
\n+
\n+\n+\n+[report issue]
\n+
scrape_incomplete scrape_complete scrape_downloaded
\n+
if this tracker has returned scrape data, these fields are filled in\n+with valid numbers. Otherwise they are set to -1. incomplete counts\n+the number of current downloaders. complete counts the number of\n+current peers completed the download, or "seeds". downloaded is the\n+cumulative number of completed downloads.
\n+
\n+[report issue]
\n+
fails
\n+
the number of times in a row we have failed to announce to this\n+tracker.
\n+
\n+[report issue]
\n+
updating
\n+
true while we're waiting for a response from the tracker.
\n+
\n+[report issue]
\n+
start_sent
\n+
set to true when we get a valid response from an announce\n+with event=started. If it is set, we won't send start in the subsequent\n+announces.
\n+
\n+[report issue]
\n+
complete_sent
\n+
set to true when we send a event=completed.
\n+
\n+[report issue]
\n+
\n+

announce_endpoint

\n+

Declared in "libtorrent/announce_entry.hpp"

\n+

announces are sent to each tracker using every listen socket\n+this class holds information about one listen socket for one tracker

\n+
\n+struct announce_endpoint\n+{\n+   announce_endpoint ();\n+\n+   tcp::endpoint local_endpoint;\n+   aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;\n+   bool enabled  = true;\n+};\n+
\n+[report issue]
\n+
local_endpoint
\n+
the local endpoint of the listen interface associated with this endpoint
\n+
\n+[report issue]
\n+
info_hashes
\n+
info_hashes[0] is the v1 info hash (SHA1)\n+info_hashes[1] is the v2 info hash (truncated SHA-256)
\n+
\n+[report issue]
\n+
enabled
\n+
set to false to not announce from this endpoint
\n+
\n+[report issue]
\n+
\n+

announce_entry

\n+

Declared in "libtorrent/announce_entry.hpp"

\n+

this class holds information about one bittorrent tracker, as it\n+relates to a specific torrent.

\n+
\n+struct announce_entry\n+{\n+   announce_entry& operator= (announce_entry const&) &;\n+   explicit announce_entry (string_view u);\n+   announce_entry (announce_entry const&);\n+   announce_entry ();\n+   ~announce_entry ();\n+\n+   enum tracker_source\n+   {\n+      source_torrent,\n+      source_client,\n+      source_magnet_link,\n+      source_tex,\n+   };\n+\n+   std::string url;\n    std::string trackerid;\n-   torrent_flags_t flags  = torrent_flags::default_flags;\n-   info_hash_t info_hashes;\n-   int max_uploads  = -1;\n-   int max_connections  = -1;\n-   int upload_limit  = -1;\n-   int download_limit  = -1;\n-   std::int64_t total_uploaded  = 0;\n-   std::int64_t total_downloaded  = 0;\n-   int active_time  = 0;\n-   int finished_time  = 0;\n-   int seeding_time  = 0;\n-   std::time_t added_time  = 0;\n-   std::time_t completed_time  = 0;\n-   std::time_t last_seen_complete  = 0;\n-   int num_complete  = -1;\n-   int num_incomplete  = -1;\n-   int num_downloaded  = -1;\n-   aux::noexcept_movable<std::vector<std::string>> http_seeds;\n-   aux::noexcept_movable<std::vector<std::string>> url_seeds;\n-   aux::noexcept_movable<std::vector<tcp::endpoint>> peers;\n-   aux::noexcept_movable<std::vector<tcp::endpoint>> banned_peers;\n-   aux::noexcept_movable<std::map<piece_index_t, bitfield>> unfinished_pieces;\n-   typed_bitfield<piece_index_t> have_pieces;\n-   typed_bitfield<piece_index_t> verified_pieces;\n-   aux::noexcept_movable<std::vector<download_priority_t>> piece_priorities;\n-   aux::vector<std::vector<sha256_hash>, file_index_t> merkle_trees;\n-   aux::vector<std::vector<bool>, file_index_t> merkle_tree_mask;\n-   aux::vector<std::vector<bool>, file_index_t> verified_leaf_hashes;\n-   aux::noexcept_movable<std::map<file_index_t, std::string>> renamed_files;\n-   std::time_t last_download  = 0;\n-   std::time_t last_upload  = 0;\n+   std::vector<announce_endpoint> endpoints;\n+   std::uint8_t tier  = 0;\n+   std::uint8_t fail_limit  = 0;\n+   std::uint8_t source:4;\n+   bool verified:1;\n };\n 
\n-[report issue]
\n-
version
\n-
filled in by the constructor and should be left untouched. It is used\n-for forward binary compatibility.
\n+\n+\n+[report issue]
\n+

~announce_entry() announce_entry() operator=()

\n+
\n+announce_entry& operator= (announce_entry const&) &;\n+explicit announce_entry (string_view u);\n+announce_entry (announce_entry const&);\n+announce_entry ();\n+~announce_entry ();\n+
\n+

constructs a tracker announce entry with u as the URL.

\n+[report issue]
\n+
\n+

enum tracker_source

\n+

Declared in "libtorrent/announce_entry.hpp"

\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
namevaluedescription
source_torrent1the tracker was part of the .torrent file
source_client2the tracker was added programmatically via the add_tracker() function
source_magnet_link4the tracker was part of a magnet link
source_tex8the tracker was received from the swarm via tracker exchange
\n+[report issue]
\n+
url
\n+
tracker URL as it appeared in the torrent file
\n
\n-[report issue]
\n-
ti
\n-
torrent_info object with the torrent to add. Unless the\n-info_hash is set, this is required to be initialized.
\n+[report issue]
\n+
trackerid
\n+
the current &trackerid= argument passed to the tracker.\n+this is optional and is normally empty (in which case no\n+trackerid is sent).
\n
\n-[report issue]
\n-
trackers
\n-
If the torrent doesn't have a tracker, but relies on the DHT to find\n-peers, the trackers can specify tracker URLs for the torrent.
\n+[report issue]
\n+
endpoints
\n+
each local listen socket (endpoint) will announce to the tracker. This\n+list contains state per endpoint.
\n
\n-[report issue]
\n-
tracker_tiers
\n-
the tiers the URLs in trackers belong to. Trackers belonging to\n-different tiers may be treated differently, as defined by the multi\n-tracker extension. This is optional, if not specified trackers are\n-assumed to be part of tier 0, or whichever the last tier was as\n-iterating over the trackers.
\n+[report issue]
\n+
tier
\n+
the tier this tracker belongs to
\n
\n-[report issue]
\n-
dht_nodes
\n-
a list of hostname and port pairs, representing DHT nodes to be added\n-to the session (if DHT is enabled). The hostname may be an IP address.
\n+[report issue]
\n+
fail_limit
\n+
the max number of failures to announce to this tracker in\n+a row, before this tracker is not used anymore. 0 means unlimited
\n
\n-[report issue]
\n-
name
\n-
in case there's no other name in this torrent, this name will be used.\n-The name out of the torrent_info object takes precedence if available.
\n+[report issue]
\n+
source
\n+
a bitmask specifying which sources we got this tracker from.
\n
\n-[report issue]
\n-
save_path
\n-

the path where the torrent is or will be stored.

\n-
\n-

Note

\n-

On windows this path (and other paths) are interpreted as UNC\n-paths. This means they must use backslashes as directory separators\n-and may not contain the special directories "." or "..".

\n+[report issue]
\n+
verified
\n+
set to true the first time we receive a valid response\n+from this tracker.
\n+
\n+[report issue]
\n
\n-

Setting this to an absolute path performs slightly better than a\n-relative path.

\n-\n+
\n+

peer_info

\n+

Declared in "libtorrent/peer_info.hpp"

\n+

holds information and statistics about one peer\n+that libtorrent is connected to

\n+
\n+struct peer_info\n+{\n+   std::string client;\n+   typed_bitfield<piece_index_t> pieces;\n+   std::int64_t total_download;\n+   std::int64_t total_upload;\n+   time_duration last_request;\n+   time_duration last_active;\n+   time_duration download_queue_time;\n+   static constexpr peer_flags_t interesting  = 0_bit;\n+   static constexpr peer_flags_t choked  = 1_bit;\n+   static constexpr peer_flags_t remote_interested  = 2_bit;\n+   static constexpr peer_flags_t remote_choked  = 3_bit;\n+   static constexpr peer_flags_t supports_extensions  = 4_bit;\n+   static constexpr peer_flags_t outgoing_connection  = 5_bit;\n+   static constexpr peer_flags_t local_connection  = 5_bit;\n+   static constexpr peer_flags_t handshake  = 6_bit;\n+   static constexpr peer_flags_t connecting  = 7_bit;\n+   static constexpr peer_flags_t on_parole  = 9_bit;\n+   static constexpr peer_flags_t seed  = 10_bit;\n+   static constexpr peer_flags_t optimistic_unchoke  = 11_bit;\n+   static constexpr peer_flags_t snubbed  = 12_bit;\n+   static constexpr peer_flags_t upload_only  = 13_bit;\n+   static constexpr peer_flags_t endgame_mode  = 14_bit;\n+   static constexpr peer_flags_t holepunched  = 15_bit;\n+   static constexpr peer_flags_t i2p_socket  = 16_bit;\n+   static constexpr peer_flags_t utp_socket  = 17_bit;\n+   static constexpr peer_flags_t ssl_socket  = 18_bit;\n+   static constexpr peer_flags_t rc4_encrypted  = 19_bit;\n+   static constexpr peer_flags_t plaintext_encrypted  = 20_bit;\n+   peer_flags_t flags;\n+   static constexpr peer_source_flags_t tracker  = 0_bit;\n+   static constexpr peer_source_flags_t dht  = 1_bit;\n+   static constexpr peer_source_flags_t pex  = 2_bit;\n+   static constexpr peer_source_flags_t lsd  = 3_bit;\n+   static constexpr peer_source_flags_t resume_data  = 4_bit;\n+   static constexpr peer_source_flags_t incoming  = 5_bit;\n+   peer_source_flags_t source;\n+   int up_speed;\n+   int down_speed;\n+   int payload_up_speed;\n+   int payload_down_speed;\n+   peer_id pid;\n+   int queue_bytes;\n+   int request_timeout;\n+   int send_buffer_size;\n+   int used_send_buffer;\n+   int receive_buffer_size;\n+   int used_receive_buffer;\n+   int receive_buffer_watermark;\n+   int num_hashfails;\n+   int download_queue_length;\n+   int timed_out_requests;\n+   int busy_requests;\n+   int requests_in_buffer;\n+   int target_dl_queue_length;\n+   int upload_queue_length;\n+   int failcount;\n+   piece_index_t downloading_piece_index;\n+   int downloading_block_index;\n+   int downloading_progress;\n+   int downloading_total;\n+   static constexpr connection_type_t standard_bittorrent  = 0_bit;\n+   static constexpr connection_type_t web_seed  = 1_bit;\n+   static constexpr connection_type_t http_seed  = 2_bit;\n+   connection_type_t connection_type;\n+   int pending_disk_bytes;\n+   int pending_disk_read_bytes;\n+   int send_quota;\n+   int receive_quota;\n+   int rtt;\n+   int num_pieces;\n+   int download_rate_peak;\n+   int upload_rate_peak;\n+   float progress;\n+   int progress_ppm;\n+   tcp::endpoint ip;\n+   tcp::endpoint local_endpoint;\n+   static constexpr bandwidth_state_flags_t bw_idle  = 0_bit;\n+   static constexpr bandwidth_state_flags_t bw_limit  = 1_bit;\n+   static constexpr bandwidth_state_flags_t bw_network  = 2_bit;\n+   static constexpr bandwidth_state_flags_t bw_disk  = 4_bit;\n+   bandwidth_state_flags_t read_state;\n+   bandwidth_state_flags_t write_state;\n+};\n+
\n+[report issue]
\n+
client
\n+
A human readable string describing the software at the other end of\n+the connection. In some cases this information is not available, then\n+it will contain a string that may give away something about which\n+software is running in the other end. In the case of a web seed, the\n+server type and version will be a part of this string. This is UTF-8\n+encoded.
\n
\n-[report issue]
\n-
storage_mode
\n-
One of the values from storage_mode_t. For more information, see\n-storage allocation.
\n+[report issue]
\n+
pieces
\n+
a bitfield, with one bit per piece in the torrent. Each bit tells you\n+if the peer has that piece (if it's set to 1) or if the peer miss that\n+piece (set to 0).
\n
\n-[report issue]
\n-
userdata
\n-
The userdata parameter is optional and will be passed on to the\n-extension constructor functions, if any\n-(see torrent_handle::add_extension()). It will also be stored in the\n-torrent object and can be retrieved by calling userdata().
\n+\n+[report issue]
\n+
total_download total_upload
\n+
the total number of bytes downloaded from and uploaded to this peer.\n+These numbers do not include the protocol chatter, but only the\n+payload data.
\n
\n-[report issue]
\n-
file_priorities
\n-
can be set to control the initial file priorities when adding a\n-torrent. The semantics are the same as for\n-torrent_handle::prioritize_files(). The file priorities specified\n-in here take precedence over those specified in the resume data, if\n-any.\n-If this vector of file priorities is shorter than the number of files\n-in the torrent, the remaining files (not covered by this) will still\n-have the default download priority. This default can be changed by\n-setting the default_dont_download torrent_flag.
\n+\n+[report issue]
\n+
last_request last_active
\n+
the time since we last sent a request to this peer and since any\n+transfer occurred with this peer
\n
\n-[report issue]
\n-
trackerid
\n-
the default tracker id to be used when announcing to trackers. By\n-default this is empty, and no tracker ID is used, since this is an\n-optional argument. If a tracker returns a tracker ID, that ID is used\n-instead of this.
\n+[report issue]
\n+
download_queue_time
\n+
the time until all blocks in the request queue will be downloaded
\n
\n-[report issue]
\n+[report issue]
\n+
interesting
\n+
we are interested in pieces from this peer.
\n+
\n+[report issue]
\n+
choked
\n+
we have choked this peer.
\n+
\n+[report issue]
\n+
remote_interested
\n+
the peer is interested in us
\n+
\n+[report issue]
\n+
remote_choked
\n+
the peer has choked us.
\n+
\n+[report issue]
\n+
supports_extensions
\n+
means that this peer supports the\n+extension protocol.
\n+
\n+[report issue]
\n+
outgoing_connection
\n+
The connection was initiated by us, the peer has a\n+listen port open, and that port is the same as in the\n+address of this peer. If this flag is not set, this\n+peer connection was opened by this peer connecting to\n+us.
\n+
\n+[report issue]
\n+
local_connection
\n+
deprecated synonym for outgoing_connection
\n+
\n+[report issue]
\n+
handshake
\n+
The connection is opened, and waiting for the\n+handshake. Until the handshake is done, the peer\n+cannot be identified.
\n+
\n+[report issue]
\n+
connecting
\n+
The connection is in a half-open state (i.e. it is\n+being connected).
\n+
\n+[report issue]
\n+
on_parole
\n+
The peer has participated in a piece that failed the\n+hash check, and is now "on parole", which means we're\n+only requesting whole pieces from this peer until\n+it either fails that piece or proves that it doesn't\n+send bad data.
\n+
\n+[report issue]
\n+
seed
\n+
This peer is a seed (it has all the pieces).
\n+
\n+[report issue]
\n+
optimistic_unchoke
\n+
This peer is subject to an optimistic unchoke. It has\n+been unchoked for a while to see if it might unchoke\n+us in return an earn an upload/unchoke slot. If it\n+doesn't within some period of time, it will be choked\n+and another peer will be optimistically unchoked.
\n+
\n+[report issue]
\n+
snubbed
\n+
This peer has recently failed to send a block within\n+the request timeout from when the request was sent.\n+We're currently picking one block at a time from this\n+peer.
\n+
\n+[report issue]
\n+
upload_only
\n+
This peer has either explicitly (with an extension)\n+or implicitly (by becoming a seed) told us that it\n+will not downloading anything more, regardless of\n+which pieces we have.
\n+
\n+[report issue]
\n+
endgame_mode
\n+
This means the last time this peer picket a piece,\n+it could not pick as many as it wanted because there\n+were not enough free ones. i.e. all pieces this peer\n+has were already requested from other peers.
\n+
\n+[report issue]
\n+
holepunched
\n+
This flag is set if the peer was in holepunch mode\n+when the connection succeeded. This typically only\n+happens if both peers are behind a NAT and the peers\n+connect via the NAT holepunch mechanism.
\n+
\n+[report issue]
\n+
i2p_socket
\n+
indicates that this socket is running on top of the\n+I2P transport.
\n+
\n+[report issue]
\n+
utp_socket
\n+
indicates that this socket is a uTP socket
\n+
\n+[report issue]
\n+
ssl_socket
\n+
indicates that this socket is running on top of an SSL\n+(TLS) channel
\n+
\n+[report issue]
\n+
rc4_encrypted
\n+
this connection is obfuscated with RC4
\n+
\n+[report issue]
\n+
plaintext_encrypted
\n+
the handshake of this connection was obfuscated\n+with a Diffie-Hellman exchange
\n+
\n+[report issue]
\n
flags
\n-

flags controlling aspects of this torrent and how it's added. See\n-torrent_flags_t for details.

\n-
\n-

Note

\n-

The flags field is initialized with default flags by the\n-constructor. In order to preserve default behavior when clearing or\n-setting other flags, make sure to bitwise OR or in a flag or bitwise\n-AND the inverse of a flag to clear it.

\n-
\n-
\n+
tells you in which state the peer is in. It is set to\n+any combination of the peer_flags_t flags above.
\n
\n-[report issue]
\n-
info_hashes
\n-
set this to the info hash of the torrent to add in case the info-hash\n-is the only known property of the torrent. i.e. you don't have a\n-.torrent file nor a magnet link.\n-To add a magnet link, use parse_magnet_uri() to populate fields in the\n-add_torrent_params object.
\n+[report issue]
\n+
tracker
\n+
The peer was received from the tracker.
\n
\n-\n-[report issue]
\n-
max_uploads max_connections
\n-

max_uploads, max_connections, upload_limit,\n-download_limit correspond to the set_max_uploads(),\n-set_max_connections(), set_upload_limit() and\n-set_download_limit() functions on torrent_handle. These values let\n-you initialize these settings when the torrent is added, instead of\n-calling these functions immediately following adding it.

\n-

-1 means unlimited on these settings just like their counterpart\n-functions on torrent_handle

\n-

For fine grained control over rate limits, including making them apply\n-to local peers, see peer classes.

\n-
\n+[report issue]
\n+
dht
\n+
The peer was received from the kademlia DHT.
\n
\n-\n-[report issue]
\n-
upload_limit download_limit
\n-
the upload and download rate limits for this torrent, specified in\n-bytes per second. -1 means unlimited.
\n+[report issue]
\n+
pex
\n+
The peer was received from the peer exchange\n+extension.
\n
\n-\n-[report issue]
\n-
total_uploaded total_downloaded
\n-
the total number of bytes uploaded and downloaded by this torrent so\n-far.
\n+[report issue]
\n+
lsd
\n+
The peer was received from the local service\n+discovery (The peer is on the local network).
\n
\n-\n-\n-[report issue]
\n-
active_time finished_time seeding_time
\n-
the number of seconds this torrent has spent in started, finished and\n-seeding state so far, respectively.
\n+[report issue]
\n+
resume_data
\n+
The peer was added from the fast resume data.
\n
\n-\n-[report issue]
\n-
added_time completed_time
\n-
if set to a non-zero value, this is the posix time of when this torrent\n-was first added, including previous runs/sessions. If set to zero, the\n-internal added_time will be set to the time of when add_torrent() is\n-called.
\n+[report issue]
\n+
incoming
\n+
we received an incoming connection from this peer
\n
\n-[report issue]
\n-
last_seen_complete
\n-
if set to non-zero, initializes the time (expressed in posix time) when\n-we last saw a seed or peers that together formed a complete copy of the\n-torrent. If left set to zero, the internal counterpart to this field\n-will be updated when we see a seed or a distributed copies >= 1.0.
\n+[report issue]
\n+
source
\n+
a combination of flags describing from which sources this peer\n+was received. A combination of the peer_source_flags_t above.
\n
\n-\n-\n-[report issue]
\n-
num_complete num_incomplete num_downloaded
\n-

these field can be used to initialize the torrent's cached scrape data.\n-The scrape data is high level metadata about the current state of the\n-swarm, as returned by the tracker (either when announcing to it or by\n-sending a specific scrape request). num_complete is the number of\n-peers in the swarm that are seeds, or have every piece in the torrent.\n-num_incomplete is the number of peers in the swarm that do not have\n-every piece. num_downloaded is the number of times the torrent has\n-been downloaded (not initiated, but the number of times a download has\n-completed).

\n-

Leaving any of these values set to -1 indicates we don't know, or we\n-have not received any scrape data.

\n-
\n+\n+[report issue]
\n+
up_speed down_speed
\n+
the current upload and download speed we have to and from this peer\n+(including any protocol messages). updated about once per second
\n
\n-\n-[report issue]
\n-
http_seeds url_seeds
\n-

URLs can be added to these two lists to specify additional web\n-seeds to be used by the torrent. If the flag_override_web_seeds\n-is set, these will be the _only_ ones to be used. i.e. any web seeds\n-found in the .torrent file will be overridden.

\n-

http_seeds expects URLs to web servers implementing the original HTTP\n-seed specification BEP 17.

\n-

url_seeds expects URLs to regular web servers, aka "get right" style,\n-specified in BEP 19.

\n-
\n+\n+[report issue]
\n+
payload_up_speed payload_down_speed
\n+
The transfer rates of payload data only updated about once per second
\n
\n-[report issue]
\n-
peers
\n-
peers to add to the torrent, to be tried to be connected to as\n-bittorrent peers.
\n+[report issue]
\n+
pid
\n+
the peer's id as used in the bit torrent protocol. This id can be used\n+to extract 'fingerprints' from the peer. Sometimes it can tell you\n+which client the peer is using. See identify_client()_
\n
\n-[report issue]
\n-
banned_peers
\n-
peers banned from this torrent. The will not be connected to
\n+[report issue]
\n+
queue_bytes
\n+
the number of bytes we have requested from this peer, but not yet\n+received.
\n
\n-[report issue]
\n-
unfinished_pieces
\n-
this is a map of partially downloaded piece. The key is the piece index\n-and the value is a bitfield where each bit represents a 16 kiB block.\n-A set bit means we have that block.
\n+[report issue]
\n+
request_timeout
\n+
the number of seconds until the current front piece request will time\n+out. This timeout can be adjusted through\n+settings_pack::request_timeout.\n+-1 means that there is not outstanding request.
\n
\n-[report issue]
\n-
have_pieces
\n-
this is a bitfield indicating which pieces we already have of this\n-torrent.
\n+\n+[report issue]
\n+
send_buffer_size used_send_buffer
\n+
the number of bytes allocated\n+and used for the peer's send buffer, respectively.
\n
\n-[report issue]
\n-
verified_pieces
\n-
when in seed_mode, pieces with a set bit in this bitfield have been\n-verified to be valid. Other pieces will be verified the first time a\n-peer requests it.
\n+\n+\n+[report issue]
\n+
receive_buffer_size used_receive_buffer receive_buffer_watermark
\n+
the number of bytes\n+allocated and used as receive buffer, respectively.
\n
\n-[report issue]
\n-
piece_priorities
\n-
this sets the priorities for each individual piece in the torrent. Each\n-element in the vector represent the piece with the same index. If you\n-set both file- and piece priorities, file priorities will take\n-precedence.
\n+[report issue]
\n+
num_hashfails
\n+
the number of pieces this peer has participated in sending us that\n+turned out to fail the hash check.
\n
\n-[report issue]
\n-
merkle_trees
\n-
v2 hashes, if known
\n+[report issue]
\n+
download_queue_length
\n+
this is the number of requests we have sent to this peer that we\n+haven't got a response for yet
\n
\n-[report issue]
\n-
merkle_tree_mask
\n-
if set, indicates which hashes are included in the corresponding\n-vector of merkle_trees. These bitmasks always cover the full\n-tree, a cleared bit means the hash is all zeros (i.e. not set) and\n-set bit means the next hash in the corresponding vector in\n-merkle_trees is the hash for that node. This is an optimization\n-to avoid storing a lot of zeros.
\n+[report issue]
\n+
timed_out_requests
\n+
the number of block requests that have timed out, and are still in the\n+download queue
\n
\n-[report issue]
\n-
verified_leaf_hashes
\n-
bit-fields indicating which v2 leaf hashes have been verified\n-against the root hash. If this vector is empty and merkle_trees is\n-non-empty it implies that all hashes in merkle_trees are verified.
\n+[report issue]
\n+
busy_requests
\n+
the number of busy requests in the download queue. A busy request is a\n+request for a block we've also requested from a different peer
\n
\n-[report issue]
\n-
renamed_files
\n-
this is a map of file indices in the torrent and new filenames to be\n-applied before the torrent is added.
\n+[report issue]
\n+
requests_in_buffer
\n+
the number of requests messages that are currently in the send buffer\n+waiting to be sent.
\n
\n-\n-[report issue]
\n-
last_download last_upload
\n-
the posix time of the last time payload was received or sent for this\n-torrent, respectively.
\n+[report issue]
\n+
target_dl_queue_length
\n+
the number of requests that is tried to be maintained (this is\n+typically a function of download speed)
\n
\n-[report issue]
\n-
\n-

client_data_t

\n-

Declared in "libtorrent/client_data.hpp"

\n-

A thin wrapper around a void pointer used as "user data". i.e. an opaque\n-cookie passed in to libtorrent and returned on demand. It adds type-safety by\n-requiring the same type be requested out of it as was assigned to it.

\n+[report issue]
\n+
upload_queue_length
\n+
the number of piece-requests we have received from this peer\n+that we haven't answered with a piece yet.
\n+
\n+[report issue]
\n+
failcount
\n+
the number of times this peer has "failed". i.e. failed to connect or\n+disconnected us. The failcount is decremented when we see this peer in\n+a tracker response or peer exchange message.
\n+
\n+\n+\n+\n+[report issue]
\n+
downloading_piece_index downloading_block_index downloading_progress downloading_total
\n+
You can know which piece, and which part of that piece, that is\n+currently being downloaded from a specific peer by looking at these\n+four members. downloading_piece_index is the index of the piece\n+that is currently being downloaded. This may be set to -1 if there's\n+currently no piece downloading from this peer. If it is >= 0, the\n+other three members are valid. downloading_block_index is the\n+index of the block (or sub-piece) that is being downloaded.\n+downloading_progress is the number of bytes of this block we have\n+received from the peer, and downloading_total is the total number\n+of bytes in this block.
\n+
\n+[report issue]
\n+
standard_bittorrent
\n+
Regular bittorrent connection
\n+
\n+[report issue]
\n+
web_seed
\n+
HTTP connection using the BEP 19 protocol
\n+
\n+[report issue]
\n+
http_seed
\n+
HTTP connection using the BEP 17 protocol
\n+
\n+[report issue]
\n+
connection_type
\n+
the kind of connection this peer uses. See connection_type_t.
\n+
\n+[report issue]
\n+
pending_disk_bytes
\n+
the number of bytes this peer has pending in the disk-io thread.\n+Downloaded and waiting to be written to disk. This is what is capped\n+by settings_pack::max_queued_disk_bytes.
\n+
\n+[report issue]
\n+
pending_disk_read_bytes
\n+
number of outstanding bytes to read\n+from disk
\n+
\n+\n+[report issue]
\n+
send_quota receive_quota
\n+
the number of bytes this peer has been assigned to be allowed to send\n+and receive until it has to request more quota from the bandwidth\n+manager.
\n+
\n+[report issue]
\n+
rtt
\n+
an estimated round trip time to this peer, in milliseconds. It is\n+estimated by timing the TCP connect(). It may be 0 for\n+incoming connections.
\n+
\n+[report issue]
\n+
num_pieces
\n+
the number of pieces this peer has.
\n+
\n+\n+[report issue]
\n+
download_rate_peak upload_rate_peak
\n+
the highest download and upload rates seen on this connection. They\n+are given in bytes per second. This number is reset to 0 on reconnect.
\n+
\n+[report issue]
\n+
progress
\n+
the progress of the peer in the range [0, 1]. This is always 0 when\n+floating point operations are disabled, instead use progress_ppm.
\n+
\n+[report issue]
\n+
progress_ppm
\n+
indicates the download progress of the peer in the range [0, 1000000]\n+(parts per million).
\n+
\n+[report issue]
\n+
ip
\n+
the IP-address to this peer. The type is an asio endpoint. For\n+more info, see the asio documentation.
\n+
\n+[report issue]
\n+
local_endpoint
\n+
the IP and port pair the socket is bound to locally. i.e. the IP\n+address of the interface it's going out over. This may be useful for\n+multi-homed clients with multiple interfaces to the internet.
\n+
\n+[report issue]
\n+
bw_idle
\n+
The peer is not waiting for any external events to\n+send or receive data.
\n+
\n+[report issue]
\n+
bw_limit
\n+
The peer is waiting for the rate limiter.
\n+
\n+[report issue]
\n+
bw_network
\n+
The peer has quota and is currently waiting for a\n+network read or write operation to complete. This is\n+the state all peers are in if there are no bandwidth\n+limits.
\n+
\n+[report issue]
\n+
bw_disk
\n+
The peer is waiting for the disk I/O thread to catch\n+up writing buffers to disk before downloading more.
\n+
\n+\n+[report issue]
\n+
read_state write_state
\n+
bitmasks indicating what state this peer\n+is in with regards to sending and receiving data. The states are\n+defined as independent flags of type bandwidth_state_flags_t, in this\n+class.
\n+
\n+[report issue]
\n+
\n+

peer_request

\n+

Declared in "libtorrent/peer_request.hpp"

\n+

represents a byte range within a piece. Internally this is is used for\n+incoming piece requests.

\n
\n-struct client_data_t\n+struct peer_request\n {\n-   client_data_t () = default;\n-   explicit client_data_t (T* v);\n-   client_data_t& operator= (T* v);\n-   T* get () const;\n-   explicit operator T () const;\n-   operator void const* () const = delete;\n-   operator void* () const = delete;\n-   client_data_t& operator= (void*) = delete;\n-   client_data_t& operator= (void const*) = delete;\n+   bool operator== (peer_request const& r) const;\n \n-   template <typename T, typename U  = typename std::enable_if<std::is_pointer<T>::value>::type>\n+   piece_index_t piece;\n+   int start;\n+   int length;\n };\n 
\n-[report issue]
\n-

client_data_t()

\n+[report issue]
\n+

operator==()

\n
\n-client_data_t () = default;\n+bool operator== (peer_request const& r) const;\n 
\n-

construct a nullptr client data

\n-\n-\n-[report issue]
\n-
\n-

operator=() void*() const*()

\n+

returns true if the right hand side peer_request refers to the same\n+range as this does.

\n+[report issue]
\n+
piece
\n+
The index of the piece in which the range starts.
\n+
\n+[report issue]
\n+
start
\n+
The byte offset within that piece where the range starts.
\n+
\n+[report issue]
\n+
length
\n+
The size of the range, in bytes.
\n+
\n+[report issue]
\n+
\n+
\n+

piece_block

\n+

Declared in "libtorrent/piece_block.hpp"

\n
\n-operator void const* () const = delete;\n-operator void* () const = delete;\n-client_data_t& operator= (void*) = delete;\n-client_data_t& operator= (void const*) = delete;\n+struct piece_block\n+{\n+   piece_block () = default;\n+   piece_block (piece_index_t p_index, int b_index);\n+   bool operator< (piece_block const& b) const;\n+   bool operator== (piece_block const& b) const;\n+   bool operator!= (piece_block const& b) const;\n+\n+   static const piece_block invalid;\n+   piece_index_t piece_index {0};\n+   int block_index  = 0;\n+};\n 
\n-

we don't allow type-unsafe operations

\n-[report issue]
\n+[report issue]
\n+
\n+

info_hash_t

\n+

Declared in "libtorrent/info_hash.hpp"

\n+

class holding the info-hash of a torrent. It can hold a v1 info-hash\n+(SHA-1) or a v2 info-hash (SHA-256) or both.

\n+
\n+

Note

\n+

If has_v2() is false then the v1 hash might actually be a truncated\n+v2 hash

\n
\n-
\n-

storage_error

\n-

Declared in "libtorrent/error_code.hpp"

\n-

used by storage to return errors\n-also includes which underlying file the\n-error happened on

\n
\n-struct storage_error\n+struct info_hash_t\n {\n-   explicit operator bool () const;\n-   void file (file_index_t f);\n-   file_index_t file () const;\n+   info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n+   explicit info_hash_t (sha256_hash h2) noexcept;\n+   info_hash_t () noexcept = default;\n+   explicit info_hash_t (sha1_hash h1) noexcept;\n+   bool has_v1 () const;\n+   bool has_v2 () const;\n+   bool has (protocol_version v) const;\n+   sha1_hash get (protocol_version v) const;\n+   sha1_hash get_best () const;\n+   friend bool operator!= (info_hash_t const& lhs, info_hash_t const& rhs);\n+   friend bool operator== (info_hash_t const& lhs, info_hash_t const& rhs) noexcept;\n+   template <typename F> void for_each (F f) const;\n+   bool operator< (info_hash_t const& o) const;\n+   friend std::ostream& operator<< (std::ostream& os, info_hash_t const& ih);\n \n-   error_code ec;\n-   operation_t operation;\n+   sha1_hash v1;\n+   sha256_hash v2;\n };\n 
\n-[report issue]
\n-

bool()

\n+[report issue]
\n+

info_hash_t()

\n
\n-explicit operator bool () const;\n+info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n+explicit info_hash_t (sha256_hash h2) noexcept;\n+info_hash_t () noexcept = default;\n+explicit info_hash_t (sha1_hash h1) noexcept;\n 
\n-

explicitly converts to true if this object represents an error, and\n-false if it does not.

\n-[report issue]
\n-
\n-

file()

\n+

The default constructor creates an object that has neither a v1 or v2\n+hash.

\n+

For backwards compatibility, make it possible to construct directly\n+from a v1 hash. This constructor allows implicit conversion from a\n+v1 hash, but the implicitness is deprecated.

\n+\n+\n+[report issue]
\n+
\n+

has() has_v1() has_v2()

\n
\n-void file (file_index_t f);\n-file_index_t file () const;\n+bool has_v1 () const;\n+bool has_v2 () const;\n+bool has (protocol_version v) const;\n 
\n-

set and query the index (in the torrent) of the file this error\n-occurred on. This may also have special values defined in\n-torrent_status.

\n-[report issue]
\n-
ec
\n-
the error that occurred
\n-
\n-[report issue]
\n-
operation
\n-
A code from operation_t enum, indicating what\n-kind of operation failed.
\n-
\n-[report issue]
\n-
\n-
\n-

libtorrent_category()

\n-

Declared in "libtorrent/error_code.hpp"

\n+

returns true if the corresponding info hash is present in this\n+object.

\n+[report issue]
\n+
\n+

get()

\n
\n-boost::system::error_category& libtorrent_category ();\n+sha1_hash get (protocol_version v) const;\n 
\n-

return the instance of the libtorrent_error_category which\n-maps libtorrent error codes to human readable error messages.

\n-[report issue]
\n-
\n-

http_category()

\n-

Declared in "libtorrent/error_code.hpp"

\n+

returns the has for the specified protocol version

\n+[report issue]
\n+
\n+

get_best()

\n
\n-boost::system::error_category& http_category ();\n+sha1_hash get_best () const;\n 
\n-

returns the error_category for HTTP errors

\n-[report issue]
\n-
\n-

socks_category()

\n-

Declared in "libtorrent/socks5_stream.hpp"

\n+

returns the v2 (truncated) info-hash, if there is one, otherwise\n+returns the v1 info-hash

\n+[report issue]
\n+
\n+

for_each()

\n
\n-boost::system::error_category& socks_category ();\n+template <typename F> void for_each (F f) const;\n 
\n-

returns the error_category for SOCKS5 errors

\n-[report issue]
\n-
\n-

upnp_category()

\n-

Declared in "libtorrent/upnp.hpp"

\n+

calls the function object f for each hash that is available.\n+starting with v1. The signature of F is:

\n
\n-boost::system::error_category& upnp_category ();\n+void(sha1_hash const&, protocol_version);\n 
\n-

the boost.system error category for UPnP errors

\n-[report issue]
\n-
\n-

pcp_category()

\n-

Declared in "libtorrent/natpmp.hpp"

\n+[report issue]
\n+
\n+
\n+

version()

\n+

Declared in "libtorrent/version.hpp"

\n
\n-boost::system::error_category& pcp_category ();\n+char const* version ();\n 
\n-[report issue]
\n-
\n-

bdecode_category()

\n-

Declared in "libtorrent/bdecode.hpp"

\n+

returns the libtorrent version as string form in this format:\n+"<major>.<minor>.<tiny>.<tag>"

\n+[report issue]
\n+
\n+

make_magnet_uri()

\n+

Declared in "libtorrent/magnet_uri.hpp"

\n
\n-boost::system::error_category& bdecode_category ();\n+std::string make_magnet_uri (torrent_handle const& handle);\n+std::string make_magnet_uri (torrent_info const& info);\n+std::string make_magnet_uri (add_torrent_params const& atp);\n 
\n-[report issue]
\n-
\n-

i2p_category()

\n-

Declared in "libtorrent/i2p_stream.hpp"

\n+

Generates a magnet URI from the specified torrent.

\n+

Several fields from the add_torrent_params objects are recorded in the\n+magnet link. In order to not include them, they have to be cleared before\n+calling make_magnet_uri(). These fields are used:

\n+
\n+ti, info_hashes, url_seeds, dht_nodes,\n+file_priorities, trackers, name, peers.
\n+

Depending on what the use case for the resulting magnet link is, clearing\n+peers and dht_nodes is probably a good idea if the add_torrent_params\n+came from a running torrent. Those lists may be long and be ephemeral.

\n+

If none of the info_hashes or ti fields are set, there is not\n+info-hash available, and a magnet link cannot be created. In this case\n+make_magnet_uri() returns an empty string.

\n+

The recommended way to generate a magnet link from a torrent_handle is to\n+call save_resume_data(), which will post a save_resume_data_alert\n+containing an add_torrent_params object. This can then be passed to\n+make_magnet_uri().

\n+

The overload that takes a torrent_handle will make blocking calls to\n+query information about the torrent. If the torrent handle is invalid,\n+an empty string is returned.

\n+

For more information about magnet links, see magnet links.

\n+[report issue]
\n+
\n+

parse_magnet_uri()

\n+

Declared in "libtorrent/magnet_uri.hpp"

\n
\n-boost::system::error_category& i2p_category ();\n+add_torrent_params parse_magnet_uri (string_view uri);\n+add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\n+void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec);\n 
\n-

returns the error category for I2P errors

\n-[report issue]
\n-
\n-

gzip_category()

\n-

Declared in "libtorrent/gzip.hpp"

\n+

This function parses out information from the magnet link and populates the\n+add_torrent_params object. The overload that does not take an\n+error_code reference will throw a system_error on error\n+The overload taking an add_torrent_params reference will fill in the\n+fields specified in the magnet URI.

\n+\n+\n+[report issue]
\n+
\n+

load_torrent_buffer() load_torrent_file() load_torrent_parsed()

\n+

Declared in "libtorrent/load_torrent.hpp"

\n
\n-boost::system::error_category& gzip_category ();\n+add_torrent_params load_torrent_buffer (\n+   span<char const> buffer, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_parsed (\n+   bdecode_node const& torrent_file);\n+add_torrent_params load_torrent_buffer (\n+   span<char const> buffer);\n+add_torrent_params load_torrent_file (\n+   std::string const& filename, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_parsed (\n+   bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_file (\n+   std::string const& filename);\n 
\n-

get the error_category for zip errors

\n-[report issue]
\n-
\n-

enum error_code_enum

\n-

Declared in "libtorrent/error_code.hpp"

\n+

These functions load the content of a .torrent file into an\n+add_torrent_params object.\n+The immutable part of a torrent file (the info-dictionary) is stored in\n+the ti field in the add_torrent_params object (as a torrent_info\n+object).\n+The returned object is suitable to be:

\n+
\n+\n+
\n+[report issue]
\n+
\n+

truncate_files()

\n+

Declared in "libtorrent/truncate.hpp"

\n+
\n+void truncate_files (file_storage const& fs, std::string const& save_path, storage_error& ec);\n+
\n+

Truncates files larger than specified in the file_storage, saved under\n+the specified save_path.

\n+[report issue]
\n+
\n+

enum socket_type_t

\n+

Declared in "libtorrent/socket_type.hpp"

\n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
no_error
tcp0Not an error
file_collision1Two torrents has files which end up overwriting each other
failed_hash_check2A piece did not match its piece hash
torrent_is_no_dict3The .torrent file does not contain a bencoded dictionary at\n-its top level
torrent_missing_info4The .torrent file does not have an info dictionary
torrent_info_no_dict5The .torrent file's info entry is not a dictionary
torrent_missing_piece_length6The .torrent file does not have a piece length entry
torrent_missing_name7The .torrent file does not have a name entry
torrent_invalid_name8The .torrent file's name entry is invalid
torrent_invalid_length9The length of a file, or of the whole .torrent file is invalid.\n-Either negative or not an integer
torrent_file_parse_failed10Failed to parse a file entry in the .torrent
torrent_missing_pieces11The pieces field is missing or invalid in the .torrent file
torrent_invalid_hashes12The pieces string has incorrect length
too_many_pieces_in_torrent13The .torrent file has more pieces than is supported by libtorrent
invalid_swarm_metadata14The metadata (.torrent file) that was received from the swarm\n-matched the info-hash, but failed to be parsed
invalid_bencoding15The file or buffer is not correctly bencoded
no_files_in_torrent16The .torrent file does not contain any files
invalid_escaped_string17The string was not properly url-encoded as expected
session_is_closing18Operation is not permitted since the session is shutting down
duplicate_torrent19There's already a torrent with that info-hash added to the\n-session
invalid_torrent_handle20The supplied torrent_handle is not referring to a valid torrent
invalid_entry_type21The type requested from the entry did not match its type
missing_info_hash_in_uri22The specified URI does not contain a valid info-hash
file_too_short23One of the files in the torrent was unexpectedly small. This\n-might be caused by files being changed by an external process
unsupported_url_protocol24The URL used an unknown protocol. Currently http and\n-https (if built with openssl support) are recognized. For\n-trackers udp is recognized as well.
url_parse_error25The URL did not conform to URL syntax and failed to be parsed
peer_sent_empty_piece26The peer sent a piece message of length 0
parse_failed27A bencoded structure was corrupt and failed to be parsed
invalid_file_tag28The fast resume file was missing or had an invalid file version\n-tag
missing_info_hash29The fast resume file was missing or had an invalid info-hash
mismatching_info_hash30The info-hash did not match the torrent
invalid_hostname31The URL contained an invalid hostname
invalid_port32The URL had an invalid port
port_blocked33The port is blocked by the port-filter, and prevented the\n-connection
expected_close_bracket_in_address34The IPv6 address was expected to end with "]"
destructing_torrent35The torrent is being destructed, preventing the operation to\n-succeed
timed_out36The connection timed out
upload_upload_connection37The peer is upload only, and we are upload only. There's no point\n-in keeping the connection
uninteresting_upload_peer38The peer is upload only, and we're not interested in it. There's\n-no point in keeping the connection
invalid_info_hash39The peer sent an unknown info-hash
torrent_paused40The torrent is paused, preventing the operation from succeeding
invalid_have41The peer sent an invalid have message, either wrong size or\n-referring to a piece that doesn't exist in the torrent
invalid_bitfield_size42The bitfield message had the incorrect size
too_many_requests_when_choked43The peer kept requesting pieces after it was choked, possible\n-abuse attempt.
invalid_piece44The peer sent a piece message that does not correspond to a\n-piece request sent by the client
no_memory45memory allocation failed
torrent_aborted46The torrent is aborted, preventing the operation to succeed
self_connection47The peer is a connection to ourself, no point in keeping it
invalid_piece_size48The peer sent a piece message with invalid size, either negative\n-or greater than one block
timed_out_no_interest49The peer has not been interesting or interested in us for too\n-long, no point in keeping it around
timed_out_inactivity50The peer has not said anything in a long time, possibly dead
timed_out_no_handshake51The peer did not send a handshake within a reasonable amount of\n-time, it might not be a bittorrent peer
timed_out_no_request52The peer has been unchoked for too long without requesting any\n-data. It might be lying about its interest in us
invalid_choke53The peer sent an invalid choke message
invalid_unchoke54The peer send an invalid unchoke message
invalid_interested55The peer sent an invalid interested message
invalid_not_interested56The peer sent an invalid not-interested message
invalid_request57The peer sent an invalid piece request message
invalid_hash_list58The peer sent an invalid hash-list message (this is part of the\n-merkle-torrent extension)
invalid_hash_piece59The peer sent an invalid hash-piece message (this is part of the\n-merkle-torrent extension)
invalid_cancel60The peer sent an invalid cancel message
invalid_dht_port61The peer sent an invalid DHT port-message
invalid_suggest62The peer sent an invalid suggest piece-message
invalid_have_all63The peer sent an invalid have all-message
invalid_have_none64The peer sent an invalid have none-message
invalid_reject65The peer sent an invalid reject message
invalid_allow_fast66The peer sent an invalid allow fast-message
invalid_extended67The peer sent an invalid extension message ID
invalid_message68The peer sent an invalid message ID
sync_hash_not_found69The synchronization hash was not found in the encrypted handshake
invalid_encryption_constant70The encryption constant in the handshake is invalid
no_plaintext_mode71The peer does not support plain text, which is the selected mode
no_rc4_mode72The peer does not support RC4, which is the selected mode
unsupported_encryption_mode73The peer does not support any of the encryption modes that the\n-client supports
unsupported_encryption_mode_selected74The peer selected an encryption mode that the client did not\n-advertise and does not support
invalid_pad_size75The pad size used in the encryption handshake is of invalid size
invalid_encrypt_handshake76The encryption handshake is invalid
no_incoming_encrypted77The client is set to not support incoming encrypted connections\n-and this is an encrypted connection
no_incoming_regular78The client is set to not support incoming regular bittorrent\n-connections, and this is a regular connection
duplicate_peer_id79The client is already connected to this peer-ID
torrent_removed80Torrent was removed
packet_too_large81The packet size exceeded the upper sanity check-limit
reserved82 
http_error83The web server responded with an error
missing_location84The web server response is missing a location header
invalid_redirection85The web seed redirected to a path that no longer matches the\n-.torrent directory structure
redirecting86The connection was closed because it redirected to a different\n-URL
invalid_range87The HTTP range header is invalid
no_content_length88The HTTP response did not have a content length
banned_by_ip_filter89The IP is blocked by the IP filter
too_many_connections90At the connection limit
peer_banned91The peer is marked as banned
stopping_torrent92The torrent is stopping, causing the operation to fail
too_many_corrupt_pieces93The peer has sent too many corrupt pieces and is banned
torrent_not_ready94The torrent is not ready to receive peers
peer_not_constructed95The peer is not completely constructed yet
session_closing96The session is closing, causing the operation to fail
optimistic_disconnect97The peer was disconnected in order to leave room for a\n-potentially better peer
torrent_finished98The torrent is finished
no_router99No UPnP router found
metadata_too_large100The metadata message says the metadata exceeds the limit
invalid_metadata_request101The peer sent an invalid metadata request message
invalid_metadata_size102The peer advertised an invalid metadata size
invalid_metadata_offset103The peer sent a message with an invalid metadata offset
invalid_metadata_message104The peer sent an invalid metadata message
pex_message_too_large105The peer sent a peer exchange message that was too large
invalid_pex_message106The peer sent an invalid peer exchange message
invalid_lt_tracker_message107The peer sent an invalid tracker exchange message
too_frequent_pex108The peer sent an pex messages too often. This is a possible\n-attempt of and attack
no_metadata109The operation failed because it requires the torrent to have\n-the metadata (.torrent file) and it doesn't have it yet.\n-This happens for magnet links before they have downloaded the\n-metadata, and also torrents added by URL.
invalid_dont_have110The peer sent an invalid dont_have message. The don't have\n-message is an extension to allow peers to advertise that the\n-no longer has a piece they previously had.
requires_ssl_connection111The peer tried to connect to an SSL torrent without connecting\n-over SSL.
invalid_ssl_cert112The peer tried to connect to a torrent with a certificate\n-for a different torrent.
not_an_ssl_torrent113the torrent is not an SSL torrent, and the operation requires\n-an SSL torrent
banned_by_port_filter114peer was banned because its listen port is within a banned port\n-range, as specified by the port_filter.
invalid_session_handle115The session_handle is not referring to a valid session_impl
invalid_listen_socket116the listen socket associated with this request was closed
invalid_hash_request117 
invalid_hashes118 
invalid_hash_reject119 
deprecated_120120 
deprecated_121121 
deprecated_122122 
deprecated_123123 
deprecated_124124 
missing_file_sizes130The resume data file is missing the file sizes entry
no_files_in_resume_data131The resume data file file sizes entry is empty
missing_pieces132The resume data file is missing the pieces and slots entry
mismatching_number_of_files133The number of files in the resume data does not match the number\n-of files in the torrent
mismatching_file_size134One of the files on disk has a different size than in the fast\n-resume file
mismatching_file_timestamp135One of the files on disk has a different timestamp than in the\n-fast resume file
not_a_dictionary136The resume data file is not a dictionary
invalid_blocks_per_piece137The blocks per piece entry is invalid in the resume data file
missing_slots138The resume file is missing the slots entry, which is required\n-for torrents with compact allocation. DEPRECATED
too_many_slots139The resume file contains more slots than the torrent
invalid_slot_list140The slot entry is invalid in the resume data
invalid_piece_index141One index in the slot list is invalid
pieces_need_reorder142The pieces on disk needs to be re-ordered for the specified\n-allocation mode. This happens if you specify sparse allocation\n-and the files on disk are using compact storage. The pieces needs\n-to be moved to their right position. DEPRECATED
resume_data_not_modified143this error is returned when asking to save resume data and\n-specifying the flag to only save when there's anything new to save\n-(torrent_handle::only_if_modified) and there wasn't anything changed.
http_parse_error150The HTTP header was not correctly formatted
http_missing_location151The HTTP response was in the 300-399 range but lacked a location\n-header
http_failed_decompress152The HTTP response was encoded with gzip or deflate but\n-decompressing it failed
no_i2p_router160The URL specified an i2p address, but no i2p router is configured
no_i2p_endpoint161i2p acceptor is not available yet, can't announce without endpoint
scrape_not_available170The tracker URL doesn't support transforming it into a scrape\n-URL. i.e. it doesn't contain "announce.
invalid_tracker_response171invalid tracker response
invalid_peer_dict172invalid peer dictionary entry. Not a dictionary
tracker_failure173tracker sent a failure message
invalid_files_entry174missing or invalid files entry
invalid_hash_entry175missing or invalid hash entry
invalid_peers_entry176missing or invalid peers and peers6 entry
invalid_tracker_response_length177UDP tracker response packet has invalid size
invalid_tracker_transaction_id178invalid transaction id in UDP tracker response
invalid_tracker_action179invalid action field in UDP tracker response
announce_skipped180skipped announce (because it's assumed to be unreachable over the\n-given source network interface)
no_entropy200random number generation failed
ssrf_mitigation201blocked by SSRF mitigation
blocked_by_idna202blocked because IDNA host names are banned
torrent_unknown_version210the torrent file has an unknown meta version
torrent_missing_file_tree211the v2 torrent file has no file tree
torrent_missing_meta_version212the torrent contains v2 keys but does not specify meta version 2
torrent_inconsistent_files213the v1 and v2 file metadata does not match
torrent_missing_piece_layer214one or more files are missing piece layer hashes
torrent_invalid_piece_layer215a piece layer has the wrong size or failed hash check
torrent_missing_pieces_root216a v2 file entry has no root hash
torrent_inconsistent_hashes217the v1 and v2 hashes do not describe the same data
torrent_invalid_pad_file218a file in the v2 metadata has the pad attribute set
error_code_max219the number of error codes
\n-[report issue]
\n-
\n-

enum http_errors

\n-

Declared in "libtorrent/error_code.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n \n \n-\n-\n+\n+\n \n \n-\n-\n+\n+\n \n \n-\n-\n+\n+\n \n \n-\n-\n+\n+\n \n \n-\n-\n+\n+\n \n \n-\n-\n+\n+\n \n \n-\n-\n+\n+\n \n \n-\n-\n+\n+\n \n \n \n
namevaluedescription
cont100 
ok200 
created201 
accepted202 
no_content204 
multiple_choices300 
moved_permanently301 
moved_temporarily302 
not_modified304 
bad_request400
socks51 
unauthorized401
http2 
forbidden403
utp3 
not_found404
i2p4 
internal_server_error500
tcp_ssl5 
not_implemented501
socks5_ssl6 
bad_gateway502
http_ssl7 
service_unavailable503
utp_ssl8 
\n-[report issue]
\n-
\n-

enum socks_error_code

\n-

Declared in "libtorrent/socks5_stream.hpp"

\n+[report issue]
\n+
\n+

enum connection_type

\n+

Declared in "libtorrent/peer_connection.hpp"

\n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n \n
namevaluedescription
no_error
bittorrent0 
unsupported_version
url_seed1 
unsupported_authentication_method
http_seed2 
unsupported_authentication_version3 
authentication_error4 
username_required5 
general_failure6 
command_not_supported7 
no_identd8 
identd_error9 
num_errors10 
\n-[report issue]
\n-
\n-

enum error_code_enum

\n-

Declared in "libtorrent/upnp.hpp"

\n+[report issue]
\n+
\n+

enum portmap_transport

\n+

Declared in "libtorrent/portmap.hpp"

\n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n \n-\n-\n-\n+\n+\n+\n \n \n
namevaluedescription
no_error
natpmp0No error
invalid_argument402One of the arguments in the request is invalid
action_failed501The request failed
value_not_in_array714The specified value does not exist in the array
source_ip_cannot_be_wildcarded715The source IP address cannot be wild-carded, but\n-must be fully specified
external_port_cannot_be_wildcarded716The external port cannot be a wildcard, but must\n-be specified
port_mapping_conflict718The port mapping entry specified conflicts with a\n-mapping assigned previously to another client
internal_port_must_match_external724Internal and external port value must be the same
only_permanent_leases_supported725The NAT implementation only supports permanent\n-lease times on port mappings
remote_host_must_be_wildcard726RemoteHost must be a wildcard and cannot be a\n-specific IP address or DNS namenatpmp can be NAT-PMP or PCP
external_port_must_be_wildcard727ExternalPort must be a wildcard and cannot be a\n-specific port
upnp1 
\n-[report issue]
\n-
\n-

enum pcp_errors

\n-

Declared in "libtorrent/natpmp.hpp"

\n+[report issue]
\n+
\n+

enum portmap_protocol

\n+

Declared in "libtorrent/portmap.hpp"

\n \n \n-\n-\n+\n \n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n \n
namevaluedescription
pcp_success
none0 
pcp_unsupp_version
tcp1 
pcp_not_authorized
udp2 
pcp_malformed_request3 
pcp_unsupp_opcode4 
pcp_unsupp_option5 
pcp_malformed_option6 
pcp_network_failure7 
pcp_no_resources8 
pcp_unsupp_protocol9 
pcp_user_ex_quota10 
pcp_cannot_provide_external11 
pcp_address_mismatch12 
pcp_excessive_remote_peers13 
\n-[report issue]
\n-
\n-

enum error_code_enum

\n-

Declared in "libtorrent/bdecode.hpp"

\n+[report issue]
\n+
\n+

enum protocol_version

\n+

Declared in "libtorrent/info_hash.hpp"

\n \n \n-\n \n-\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n \n \n
namevaluedescription
no_error
V10Not an errorThe original BitTorrent version, using SHA-1 hashes
expected_digit
V21expected digit in bencoded stringVersion 2 of the BitTorrent protocol, using SHA-256 hashes
expected_colon
NUM2expected colon in bencoded string
unexpected_eof3unexpected end of file in bencoded string
expected_value4expected value (list, dict, int or string) in bencoded string
depth_exceeded5bencoded recursion depth limit exceeded
limit_exceeded6bencoded item count limit exceeded
overflow7integer overflow
error_code_max8the number of error codes 
\n-[report issue]
\n-
\n-

enum i2p_error_code

\n-

Declared in "libtorrent/i2p_stream.hpp"

\n+[report issue]
\n+
\n+

enum event_t

\n+

Declared in "libtorrent/tracker_manager.hpp"

\n \n \n-\n-\n \n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
no_error
none0 
parse_failed
completed1 
cant_reach_peer
started2 
i2p_error
stopped3 
invalid_key
paused4 
invalid_id5 
timeout6 
key_not_found7 
duplicated_id8 
num_errors9 
\n-[report issue]
\n-
\n-

enum error_code_enum

\n-

Declared in "libtorrent/gzip.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n \n
namevaluedescription
no_error0Not an error
invalid_gzip_header1the supplied gzip buffer has invalid header
inflated_data_too_large2the gzip buffer would inflate to more bytes than the specified\n-maximum size, and was rejected.
data_did_not_terminate3available inflate data did not terminate
space_exhausted4output space exhausted before completing inflate
invalid_block_type5invalid block type (type == 3)
invalid_stored_block_length6stored block length did not match one's complement
too_many_length_or_distance_codes7dynamic block code description: too many length or distance codes
code_lengths_codes_incomplete8dynamic block code description: code lengths codes incomplete
repeat_lengths_with_no_first_length9dynamic block code description: repeat lengths with no first length
repeat_more_than_specified_lengths10dynamic block code description: repeat more than specified lengths
invalid_literal_length_code_lengths11dynamic block code description: invalid literal/length code lengths
invalid_distance_code_lengths12dynamic block code description: invalid distance code lengths
invalid_literal_code_in_block13invalid literal/length or distance code in fixed or dynamic block
distance_too_far_back_in_block14distance is too far back in fixed or dynamic block
unknown_gzip_error15an unknown error occurred during gzip inflation
error_code_max16the number of error codes
\n-[report issue]
\n-
\n-

stats_metric

\n-

Declared in "libtorrent/session_stats.hpp"

\n-

describes one statistics metric from the session. For more information,\n-see the session statistics section.

\n+[report issue]
\n+
\n+

int

\n+

Declared in "libtorrent/version.hpp"

\n+
\n+
version_major
\n+
the major, minor and tiny versions of libtorrent
\n+
\n+
\n+
version_minor
\n+
the major, minor and tiny versions of libtorrent
\n+
\n+
\n+
version_tiny
\n+
the major, minor and tiny versions of libtorrent
\n+
\n+[report issue]
\n+
\n+

char const*

\n+

Declared in "libtorrent/version.hpp"

\n+
\n+
version_str
\n+
the libtorrent version in string form
\n+
\n+[report issue]
\n+
\n+

std::uint64_t

\n+

Declared in "libtorrent/version.hpp"

\n+
\n+
version_revision
\n+
the git commit of this libtorrent version
\n+
\n+[report issue]
\n+
\n+

pex_flags_t

\n+

Declared in "libtorrent/pex_flags.hpp"

\n+
\n+
pex_encryption
\n+
the peer supports protocol encryption
\n+
\n+
\n+
pex_seed
\n+
the peer is a seed
\n+
\n+
\n+
pex_utp
\n+
the peer supports the uTP, transport protocol over UDP.
\n+
\n+
\n+
pex_holepunch
\n+
the peer supports the holepunch extension If this flag is received from a\n+peer, it can be used as a rendezvous point in case direct connections to\n+the peer fail
\n+
\n+
\n+
pex_lt_v2
\n+
protocol v2\n+this is not a standard flag, it is only used internally
\n+
\n+[report issue]
\n+
\n+

download_priority_t

\n+

Declared in "libtorrent/download_priority.hpp"

\n+
\n+
dont_download
\n+
Don't download the file or piece. Partial pieces may still be downloaded when\n+setting file priorities.
\n+
\n+
\n+
default_priority
\n+
The default priority for files and pieces.
\n+
\n+
\n+
low_priority
\n+
The lowest priority for files and pieces.
\n+
\n+
\n+
top_priority
\n+
The highest priority for files and pieces.
\n+
\n+[report issue]
\n+
\n+

torrent_flags_t

\n+

Declared in "libtorrent/torrent_flags.hpp"

\n+
\n+
seed_mode
\n+

If seed_mode is set, libtorrent will assume that all files\n+are present for this torrent and that they all match the hashes in\n+the torrent file. Each time a peer requests to download a block,\n+the piece is verified against the hash, unless it has been verified\n+already. If a hash fails, the torrent will automatically leave the\n+seed mode and recheck all the files. The use case for this mode is\n+if a torrent is created and seeded, or if the user already know\n+that the files are complete, this is a way to avoid the initial\n+file checks, and significantly reduce the startup time.

\n+

Setting seed_mode on a torrent without metadata (a\n+.torrent file) is a no-op and will be ignored.

\n+

It is not possible to set the seed_mode flag on a torrent after it has\n+been added to a session. It is possible to clear it though.

\n+
\n+
\n+
\n+
upload_mode
\n+

If upload_mode is set, the torrent will be initialized in\n+upload-mode, which means it will not make any piece requests. This\n+state is typically entered on disk I/O errors, and if the torrent\n+is also auto managed, it will be taken out of this state\n+periodically (see settings_pack::optimistic_disk_retry).

\n+

This mode can be used to avoid race conditions when\n+adjusting priorities of pieces before allowing the torrent to start\n+downloading.

\n+

If the torrent is auto-managed (auto_managed), the torrent\n+will eventually be taken out of upload-mode, regardless of how it\n+got there. If it's important to manually control when the torrent\n+leaves upload mode, don't make it auto managed.

\n+
\n+
\n+
\n+
share_mode
\n+

determines if the torrent should be added in share mode or not.\n+Share mode indicates that we are not interested in downloading the\n+torrent, but merely want to improve our share ratio (i.e. increase\n+it). A torrent started in share mode will do its best to never\n+download more than it uploads to the swarm. If the swarm does not\n+have enough demand for upload capacity, the torrent will not\n+download anything. This mode is intended to be safe to add any\n+number of torrents to, without manual screening, without the risk\n+of downloading more than is uploaded.

\n+

A torrent in share mode sets the priority to all pieces to 0,\n+except for the pieces that are downloaded, when pieces are decided\n+to be downloaded. This affects the progress bar, which might be set\n+to "100% finished" most of the time. Do not change file or piece\n+priorities for torrents in share mode, it will make it not work.

\n+

The share mode has one setting, the share ratio target, see\n+settings_pack::share_mode_target for more info.

\n+
\n+
\n+
\n+
apply_ip_filter
\n+
determines if the IP filter should apply to this torrent or not. By\n+default all torrents are subject to filtering by the IP filter\n+(i.e. this flag is set by default). This is useful if certain\n+torrents needs to be exempt for some reason, being an auto-update\n+torrent for instance.
\n+
\n+
\n+
paused
\n+
specifies whether or not the torrent is paused. i.e. it won't connect to the tracker or any of the peers\n+until it's resumed. Note that a paused torrent that also has the\n+auto_managed flag set can be started at any time by libtorrent's queuing\n+logic. See queuing.
\n+
\n+
\n+
auto_managed
\n+

If the torrent is auto-managed (auto_managed), the torrent\n+may be resumed at any point, regardless of how it paused. If it's\n+important to manually control when the torrent is paused and\n+resumed, don't make it auto managed.

\n+

If auto_managed is set, the torrent will be queued,\n+started and seeded automatically by libtorrent. When this is set,\n+the torrent should also be started as paused. The default queue\n+order is the order the torrents were added. They are all downloaded\n+in that order. For more details, see queuing.

\n+
\n+
\n+
\n+
duplicate_is_error
\n+
used in add_torrent_params to indicate that it's an error to attempt\n+to add a torrent that's already in the session. If it's not considered an\n+error, a handle to the existing torrent is returned.\n+This flag is not saved by write_resume_data(), since it is only meant for\n+adding torrents.
\n+
\n+
\n+
update_subscribe
\n+
on by default and means that this torrent will be part of state\n+updates when calling post_torrent_updates().\n+This flag is not saved by write_resume_data().
\n+
\n+
\n+
super_seeding
\n+
sets the torrent into super seeding/initial seeding mode. If the torrent\n+is not a seed, this flag has no effect.
\n+
\n+
\n+
sequential_download
\n+
sets the sequential download state for the torrent. In this mode the\n+piece picker will pick pieces with low index numbers before pieces with\n+high indices. The actual pieces that are picked depend on other factors\n+still, such as which pieces a peer has and whether it is in parole mode\n+or "prefer whole pieces"-mode. Sequential mode is not ideal for streaming\n+media. For that, see set_piece_deadline() instead.
\n+
\n+
\n+
stop_when_ready
\n+

When this flag is set, the torrent will force stop whenever it\n+transitions from a non-data-transferring state into a data-transferring\n+state (referred to as being ready to download or seed). This is useful\n+for torrents that should not start downloading or seeding yet, but want\n+to be made ready to do so. A torrent may need to have its files checked\n+for instance, so it needs to be started and possibly queued for checking\n+(auto-managed and started) but as soon as it's done, it should be\n+stopped.

\n+

Force stopped means auto-managed is set to false and it's paused. As\n+if the auto_manages flag is cleared and the paused flag is set on the torrent.

\n+

Note that the torrent may transition into a downloading state while\n+setting this flag, and since the logic is edge triggered you may\n+miss the edge. To avoid this race, if the torrent already is in a\n+downloading state when this call is made, it will trigger the\n+stop-when-ready immediately.

\n+

When the stop-when-ready logic fires, the flag is cleared. Any\n+subsequent transitions between downloading and non-downloading states\n+will not be affected, until this flag is set again.

\n+

The behavior is more robust when setting this flag as part of adding\n+the torrent. See add_torrent_params.

\n+

The stop-when-ready flag fixes the inherent race condition of waiting\n+for the state_changed_alert and then call pause(). The download/seeding\n+will most likely start in between posting the alert and receiving the\n+call to pause.

\n+

A downloading state is one where peers are being connected. Which means\n+just downloading the metadata via the ut_metadata extension counts\n+as a downloading state. In order to stop a torrent once the metadata\n+has been downloaded, instead set all file priorities to dont_download

\n+
\n+
\n+
\n+
override_trackers
\n+
when this flag is set, the tracker list in the add_torrent_params\n+object override any trackers from the torrent file. If the flag is\n+not set, the trackers from the add_torrent_params object will be\n+added to the list of trackers used by the torrent.\n+This flag is set by read_resume_data() if there are trackers present in\n+the resume data file. This effectively makes the trackers saved in the\n+resume data take precedence over the original trackers. This includes if\n+there's an empty list of trackers, to support the case where they were\n+explicitly removed in the previous session.\n+This flag is not saved by write_resume_data()
\n+
\n+
\n+
override_web_seeds
\n+
If this flag is set, the web seeds from the add_torrent_params\n+object will override any web seeds in the torrent file. If it's not\n+set, web seeds in the add_torrent_params object will be added to the\n+list of web seeds used by the torrent.\n+This flag is set by read_resume_data() if there are web seeds present in\n+the resume data file. This effectively makes the web seeds saved in the\n+resume data take precedence over the original ones. This includes if\n+there's an empty list of web seeds, to support the case where they were\n+explicitly removed in the previous session.\n+This flag is not saved by write_resume_data()
\n+
\n+
\n+
need_save_resume
\n+
if this flag is set (which it is by default) the torrent will be\n+considered needing to save its resume data immediately as it's\n+added. New torrents that don't have any resume data should do that.\n+This flag is cleared by a successful call to save_resume_data()\n+This flag is not saved by write_resume_data(), since it represents an\n+ephemeral state of a running torrent.
\n+
\n+
\n+
disable_dht
\n+
set this flag to disable DHT for this torrent. This lets you have the DHT\n+enabled for the whole client, and still have specific torrents not\n+participating in it. i.e. not announcing to the DHT nor picking up peers\n+from it.
\n+
\n+
\n+
disable_lsd
\n+
set this flag to disable local service discovery for this torrent.
\n+
\n+
\n+
disable_pex
\n+
set this flag to disable peer exchange for this torrent.
\n+
\n+
\n+
no_verify_files
\n+
if this flag is set, the resume data will be assumed to be correct\n+without validating it against any files on disk. This may be used when\n+restoring a session by loading resume data from disk. It will save time\n+and also delay any hard disk errors until files are actually needed. If\n+the resume data cannot be trusted, or if a torrent is added for the first\n+time to some save path that may already have some of the files, this flag\n+should not be set.
\n+
\n+
\n+
default_dont_download
\n+
default all file priorities to dont_download. This is useful for adding\n+magnet links where the number of files is unknown, but the\n+file_priorities is still set for some files. Any file not covered by\n+the file_priorities list will be set to normal download priority,\n+unless this flag is set, in which case they will be set to 0\n+(dont_download).
\n+
\n+
\n+
all
\n+
all torrent flags combined. Can conveniently be used when creating masks\n+for flags
\n+
\n+[report issue]
\n+
\n+

file_slice

\n+

Declared in "libtorrent/file_storage.hpp"

\n+

represents a window of a file in a torrent.

\n+

The file_index refers to the index of the file (in the torrent_info).\n+To get the path and filename, use file_path() and give the file_index\n+as argument. The offset is the byte offset in the file where the range\n+starts, and size is the number of bytes this range is. The size + offset\n+will never be greater than the file size.

\n
\n-struct stats_metric\n+struct file_slice\n {\n-   char const* name;\n-   int value_index;\n-   metric_type_t type;\n+   file_index_t file_index;\n+   std::int64_t offset;\n+   std::int64_t size;\n };\n 
\n-[report issue]
\n-
name
\n-
the name of the counter or gauge
\n+[report issue]
\n+
file_index
\n+
the index of the file
\n
\n-\n-[report issue]
\n-
value_index type
\n-
the index into the session stats array, where the underlying value of\n-this counter or gauge is found. The session stats array is part of the\n-session_stats_alert object.
\n+[report issue]
\n+
offset
\n+
the offset from the start of the file, in bytes
\n
\n-[report issue]
\n-
\n-

counters

\n-

Declared in "libtorrent/performance_counters.hpp"

\n+[report issue]
\n+
size
\n+
the size of the window, in bytes
\n+
\n+[report issue]
\n+
\n+

file_storage

\n+

Declared in "libtorrent/file_storage.hpp"

\n+

The file_storage class represents a file list and the piece\n+size. Everything necessary to interpret a regular bittorrent storage\n+file structure.

\n
\n-struct counters\n+class file_storage\n {\n-   counters () ;\n-   counters& operator= (counters const&) & ;\n-   counters (counters const&) ;\n-   std::int64_t operator[] (int i) const ;\n-   std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n-   void set_value (int c, std::int64_t value) ;\n-   void blend_stats_counter (int c, std::int64_t value, int ratio) ;\n+   bool is_valid () const;\n+   void reserve (int num_files);\n+   void add_file (std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void add_file_borrow (error_code& ec, string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void add_file_borrow (string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void rename_file (file_index_t index, std::string const& new_filename);\n+   std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n+      , std::int64_t size) const;\n+   peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n+   int num_files () const noexcept;\n+   file_index_t end_file () const noexcept;\n+   index_range<file_index_t> file_range () const noexcept;\n+   std::int64_t total_size () const;\n+   void set_num_pieces (int n);\n+   int num_pieces () const;\n+   piece_index_t end_piece () const;\n+   piece_index_t last_piece () const;\n+   index_range<piece_index_t> piece_range () const noexcept;\n+   int piece_length () const;\n+   void set_piece_length (int l);\n+   int piece_size (piece_index_t index) const;\n+   int piece_size2 (piece_index_t index) const;\n+   int blocks_in_piece2 (piece_index_t index) const;\n+   void set_name (std::string const& n);\n+   std::string const& name () const;\n+   void swap (file_storage& ti) noexcept;\n+   void canonicalize ();\n+   std::string symlink (file_index_t index) const;\n+   std::time_t mtime (file_index_t index) const;\n+   bool pad_file_at (file_index_t index) const;\n+   std::int64_t file_size (file_index_t index) const;\n+   sha1_hash hash (file_index_t index) const;\n+   std::int64_t file_offset (file_index_t index) const;\n+   sha256_hash root (file_index_t index) const;\n+   char const* root_ptr (file_index_t const index) const;\n+   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n+   string_view file_name (file_index_t index) const;\n+   int file_num_pieces (file_index_t index) const;\n+   int file_num_blocks (file_index_t index) const;\n+   index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const;\n+   int file_first_block_node (file_index_t index) const;\n+   int file_first_piece_node (file_index_t index) const;\n+   std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n+   void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n+   file_flags_t file_flags (file_index_t index) const;\n+   bool file_absolute_path (file_index_t index) const;\n+   file_index_t file_index_at_offset (std::int64_t offset) const;\n+   file_index_t file_index_at_piece (piece_index_t piece) const;\n+   file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n+   piece_index_t piece_index_at_file (file_index_t f) const;\n+   void sanitize_symlinks ();\n+   bool v2 () const;\n+\n+   static constexpr file_flags_t flag_pad_file  = 0_bit;\n+   static constexpr file_flags_t flag_hidden  = 1_bit;\n+   static constexpr file_flags_t flag_executable  = 2_bit;\n+   static constexpr file_flags_t flag_symlink  = 3_bit;\n };\n 
\n-\n-[report issue]
\n-

inc_stats_counter() operator[]()

\n+[report issue]
\n+

is_valid()

\n
\n-std::int64_t operator[] (int i) const ;\n-std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+bool is_valid () const;\n 
\n-

returns the new value

\n-[report issue]
\n-
\n-
\n-

session_stats_metrics()

\n-

Declared in "libtorrent/session_stats.hpp"

\n+

returns true if the piece length has been initialized\n+on the file_storage. This is typically taken as a proxy\n+of whether the file_storage as a whole is initialized or\n+not.

\n+[report issue]
\n+
\n+

reserve()

\n
\n-std::vector<stats_metric> session_stats_metrics ();\n+void reserve (int num_files);\n 
\n-

This free function returns the list of available metrics exposed by\n-libtorrent's statistics API. Each metric has a name and a value index.\n-The value index is the index into the array in session_stats_alert where\n-this metric's value can be found when the session stats is sampled (by\n-calling post_session_stats()).

\n-[report issue]
\n-
\n-

find_metric_idx()

\n-

Declared in "libtorrent/session_stats.hpp"

\n+

allocates space for num_files in the internal file list. This can\n+be used to avoid reallocating the internal file list when the number\n+of files to be added is known up-front.

\n+\n+[report issue]
\n+
\n+

add_file() add_file_borrow()

\n
\n-int find_metric_idx (string_view name);\n+void add_file (std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+void add_file_borrow (error_code& ec, string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+void add_file_borrow (string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n 
\n-

given a name of a metric, this function returns the counter index of it,\n-or -1 if it could not be found. The counter index is the index into the\n-values array returned by session_stats_alert.

\n-[report issue]
\n-
\n-

enum metric_type_t

\n-

Declared in "libtorrent/session_stats.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
counter0 
gauge1 
\n-[report issue]
\n-
\n-

peer_class_info

\n-

Declared in "libtorrent/peer_class.hpp"

\n-

holds settings for a peer class. Used in set_peer_class() and\n-get_peer_class() calls.

\n+

Adds a file to the file storage. The add_file_borrow version\n+expects that filename is the file name (without a path) of\n+the file that's being added.\n+This memory is borrowed, i.e. it is the caller's\n+responsibility to make sure it stays valid throughout the lifetime\n+of this file_storage object or any copy of it. The same thing applies\n+to filehash, which is an optional pointer to a 20 byte binary\n+SHA-1 hash of the file.

\n+

if filename is empty, the filename from path is used and not\n+borrowed.

\n+

The path argument is the full path (in the torrent file) to\n+the file to add. Note that this is not supposed to be an absolute\n+path, but it is expected to include the name of the torrent as the\n+first path element.

\n+

file_size is the size of the file in bytes.

\n+

The file_flags argument sets attributes on the file. The file\n+attributes is an extension and may not work in all bittorrent clients.

\n+

For possible file attributes, see file_storage::flags_t.

\n+

The mtime argument is optional and can be set to 0. If non-zero,\n+it is the posix time of the last modification time of this file.

\n+

symlink_path is the path the file is a symlink to. To make this a\n+symlink you also need to set the file_storage::flag_symlink file flag.

\n+

root_hash is an optional pointer to a 32 byte SHA-256 hash, being\n+the merkle tree root hash for this file. This is only used for v2\n+torrents. If the root hash is specified for one file, it has to\n+be specified for all, otherwise this function will fail.\n+Note that the buffer root_hash points to must out-live the\n+file_storage object, it will not be copied. This parameter is only\n+used when loading torrents, that already have their file hashes\n+computed. When creating torrents, the file hashes will be computed by\n+the piece hashes.

\n+

If more files than one are added, certain restrictions to their paths\n+apply. In a multi-file file storage (torrent), all files must share\n+the same root directory.

\n+

That is, the first path element of all files must be the same.\n+This shared path element is also set to the name of the torrent. It\n+can be changed by calling set_name.

\n+

The overloads that take an error_code reference will report failures\n+via that variable, otherwise system_error is thrown.

\n+[report issue]
\n+
\n+

rename_file()

\n
\n-struct peer_class_info\n-{\n-   bool ignore_unchoke_slots;\n-   int connection_limit_factor;\n-   std::string label;\n-   int upload_limit;\n-   int download_limit;\n-   int upload_priority;\n-   int download_priority;\n-};\n+void rename_file (file_index_t index, std::string const& new_filename);\n 
\n-[report issue]
\n-
ignore_unchoke_slots
\n-
ignore_unchoke_slots determines whether peers should always\n-unchoke a peer, regardless of the choking algorithm, or if it should\n-honor the unchoke slot limits. It's used for local peers by default.\n-If any of the peer classes a peer belongs to has this set to true,\n-that peer will be unchoked at all times.
\n-
\n-[report issue]
\n-
connection_limit_factor
\n-
adjusts the connection limit (global and per torrent) that applies to\n-this peer class. By default, local peers are allowed to exceed the\n-normal connection limit for instance. This is specified as a percent\n-factor. 100 makes the peer class apply normally to the limit. 200\n-means as long as there are fewer connections than twice the limit, we\n-accept this peer. This factor applies both to the global connection\n-limit and the per-torrent limit. Note that if not used carefully one\n-peer class can potentially completely starve out all other over time.
\n+

renames the file at index to new_filename. Keep in mind\n+that filenames are expected to be UTF-8 encoded.

\n+[report issue]
\n+
\n+

map_block()

\n+
\n+std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n+      , std::int64_t size) const;\n+
\n+

returns a list of file_slice objects representing the portions of\n+files the specified piece index, byte offset and size range overlaps.\n+this is the inverse mapping of map_file().

\n+

Preconditions of this function is that the input range is within the\n+torrents address space. piece may not be negative and

\n+
\n+piece * piece_size + offset + size
\n+

may not exceed the total size of the torrent.

\n+[report issue]
\n+
\n+

map_file()

\n+
\n+peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n+
\n+

returns a peer_request representing the piece index, byte offset\n+and size the specified file range overlaps. This is the inverse\n+mapping over map_block(). Note that the peer_request return type\n+is meant to hold bittorrent block requests, which may not be larger\n+than 16 kiB. Mapping a range larger than that may return an overflown\n+integer.

\n+[report issue]
\n+
\n+

num_files()

\n+
\n+int num_files () const noexcept;\n+
\n+

returns the number of files in the file_storage

\n+[report issue]
\n+
\n+

end_file()

\n+
\n+file_index_t end_file () const noexcept;\n+
\n+

returns the index of the one-past-end file in the file storage

\n+[report issue]
\n+
\n+

file_range()

\n+
\n+index_range<file_index_t> file_range () const noexcept;\n+
\n+

returns an implementation-defined type that can be used as the\n+container in a range-for loop. Where the values are the indices of all\n+files in the file_storage.

\n+[report issue]
\n+
\n+

total_size()

\n+
\n+std::int64_t total_size () const;\n+
\n+

returns the total number of bytes all the files in this torrent spans

\n+\n+[report issue]
\n+
\n+

set_num_pieces() num_pieces()

\n+
\n+void set_num_pieces (int n);\n+int num_pieces () const;\n+
\n+

set and get the number of pieces in the torrent

\n+[report issue]
\n+
\n+

end_piece()

\n+
\n+piece_index_t end_piece () const;\n+
\n+

returns the index of the one-past-end piece in the file storage

\n+[report issue]
\n+
\n+

last_piece()

\n+
\n+piece_index_t last_piece () const;\n+
\n+

returns the index of the last piece in the torrent. The last piece is\n+special in that it may be smaller than the other pieces (and the other\n+pieces are all the same size).

\n+[report issue]
\n+
\n+

piece_range()

\n+
\n+index_range<piece_index_t> piece_range () const noexcept;\n+
\n+

returns an implementation-defined type that can be used as the\n+container in a range-for loop. Where the values are the indices of all\n+pieces in the file_storage.

\n+\n+[report issue]
\n+
\n+

piece_length() set_piece_length()

\n+
\n+int piece_length () const;\n+void set_piece_length (int l);\n+
\n+

set and get the size of each piece in this torrent. It must be a power of two\n+and at least 16 kiB.

\n+[report issue]
\n+
\n+

piece_size()

\n+
\n+int piece_size (piece_index_t index) const;\n+
\n+

returns the piece size of index. This will be the same as piece_length(), except\n+for the last piece, which may be shorter.

\n+[report issue]
\n+
\n+

piece_size2()

\n+
\n+int piece_size2 (piece_index_t index) const;\n+
\n+

Returns the size of the given piece. If the piece spans multiple files,\n+only the first file is considered part of the piece. This is used for\n+v2 torrents, where all files are piece aligned and padded. i.e. The pad\n+files are not considered part of the piece for this purpose.

\n+[report issue]
\n+
\n+

blocks_in_piece2()

\n+
\n+int blocks_in_piece2 (piece_index_t index) const;\n+
\n+

returns the number of blocks in the specified piece, for v2 torrents.

\n+\n+[report issue]
\n+
\n+

name() set_name()

\n+
\n+void set_name (std::string const& n);\n+std::string const& name () const;\n+
\n+

set and get the name of this torrent. For multi-file torrents, this is also\n+the name of the root directory all the files are stored in.

\n+[report issue]
\n+
\n+

swap()

\n+
\n+void swap (file_storage& ti) noexcept;\n+
\n+

swap all content of this with ti.

\n+[report issue]
\n+
\n+

canonicalize()

\n+
\n+void canonicalize ();\n+
\n+

arrange files and padding to match the canonical form required\n+by BEP 52

\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+[report issue]
\n+\n+
\n+

file_num_pieces() file_num_blocks() file_piece_range()

\n+
\n+int file_num_pieces (file_index_t index) const;\n+int file_num_blocks (file_index_t index) const;\n+index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const;\n+
\n+

Returns the number of pieces or blocks the file at index spans,\n+under the assumption that the file is aligned to the start of a piece.\n+This is only meaningful for v2 torrents, where files are guaranteed\n+such alignment.\n+These numbers are used to size and navigate the merkle hash tree for\n+each file.

\n+\n+[report issue]
\n+
\n+

file_first_block_node() file_first_piece_node()

\n+
\n+int file_first_block_node (file_index_t index) const;\n+int file_first_piece_node (file_index_t index) const;\n+
\n+

index of first piece node in the merkle tree

\n+[report issue]
\n+
\n+

file_path_hash()

\n+
\n+std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n+
\n+

returns the crc32 hash of file_path(index)

\n+[report issue]
\n+
\n+

all_path_hashes()

\n+
\n+void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n+
\n+

this will add the CRC32 hash of all directory entries to the table. No\n+filename will be included, just directories. Every depth of directories\n+are added separately to allow test for collisions with files at all\n+levels. i.e. if one path in the torrent is foo/bar/baz, the CRC32\n+hashes for foo, foo/bar and foo/bar/baz will be added to\n+the set.

\n+[report issue]
\n+
\n+

file_flags()

\n+
\n+file_flags_t file_flags (file_index_t index) const;\n+
\n+

returns a bitmask of flags from file_flags_t that apply\n+to file at index.

\n+[report issue]
\n+
\n+

file_absolute_path()

\n+
\n+bool file_absolute_path (file_index_t index) const;\n+
\n+

returns true if the file at the specified index has been renamed to\n+have an absolute path, i.e. is not anchored in the save path of the\n+torrent.

\n+\n+[report issue]
\n+
\n+

file_index_at_piece() file_index_at_offset()

\n+
\n+file_index_t file_index_at_offset (std::int64_t offset) const;\n+file_index_t file_index_at_piece (piece_index_t piece) const;\n+
\n+

returns the index of the file at the given offset in the torrent

\n+[report issue]
\n+
\n+

file_index_for_root()

\n+
\n+file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n+
\n+

finds the file with the given root hash and returns its index\n+if there is no file with the root hash, file_index_t{-1} is returned

\n+[report issue]
\n+
\n+

piece_index_at_file()

\n+
\n+piece_index_t piece_index_at_file (file_index_t f) const;\n+
\n+

returns the piece index the given file starts at

\n+[report issue]
\n+
\n+

sanitize_symlinks()

\n+
\n+void sanitize_symlinks ();\n+
\n+

validate any symlinks, to ensure they all point to\n+other files or directories inside this storage. Any invalid symlinks\n+are updated to point to themselves.

\n+[report issue]
\n+
\n+

v2()

\n+
\n+bool v2 () const;\n+
\n+

returns true if this torrent contains v2 metadata.

\n+[report issue]
\n+
flag_pad_file
\n+
the file is a pad file. It's required to contain zeros\n+at it will not be saved to disk. Its purpose is to make\n+the following file start on a piece boundary.
\n
\n-[report issue]
\n-
label
\n-
not used by libtorrent. It's intended as a potentially user-facing\n-identifier of this peer class.
\n+[report issue]
\n+
flag_hidden
\n+
this file has the hidden attribute set. This is primarily\n+a windows attribute
\n
\n-\n-[report issue]
\n-
upload_limit download_limit
\n-
transfer rates limits for the whole peer class. They are specified in\n-bytes per second and apply to the sum of all peers that are members of\n-this class.
\n+[report issue]
\n+
flag_executable
\n+
this file has the executable attribute set.
\n
\n-\n-[report issue]
\n-
upload_priority download_priority
\n-
relative priorities used by the bandwidth allocator in the rate\n-limiter. If no rate limits are in use, the priority is not used\n-either. Priorities start at 1 (0 is not a valid priority) and may not\n-exceed 255.
\n+[report issue]
\n+
flag_symlink
\n+
this file is a symbolic link. It should have a link\n+target string associated with it.
\n
\n-[report issue]
\n-
\n-

peer_class_type_filter

\n-

Declared in "libtorrent/peer_class_type_filter.hpp"

\n-

peer_class_type_filter is a simple container for rules for adding and subtracting\n-peer-classes from peers. It is applied after the peer class filter is applied (which\n-is based on the peer's IP address).

\n+[report issue]
\n+
\n+
\n+

storage_params

\n+

Declared in "libtorrent/storage_defs.hpp"

\n+

a parameter pack used to construct the storage for a torrent, used in\n+disk_interface

\n
\n-struct peer_class_type_filter\n+struct storage_params\n {\n-   void add (socket_type_t const st, peer_class_t const peer_class);\n-   void remove (socket_type_t const st, peer_class_t const peer_class);\n-   void disallow (socket_type_t const st, peer_class_t const peer_class);\n-   void allow (socket_type_t const st, peer_class_t const peer_class);\n-   std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n-   friend bool operator== (peer_class_type_filter const& lhs\n-      , peer_class_type_filter const& rhs);\n+   storage_params (file_storage const& f, file_storage const* mf\n+      , std::string const& sp, storage_mode_t const sm\n+      , aux::vector<download_priority_t, file_index_t> const& prio\n+      , sha1_hash const& ih);\n \n-   enum socket_type_t\n-   {\n-      tcp_socket,\n-      utp_socket,\n-      ssl_tcp_socket,\n-      ssl_utp_socket,\n-      i2p_socket,\n-      num_socket_types,\n-   };\n+   file_storage const& files;\n+   file_storage const* mapped_files  = nullptr;\n+   std::string const& path;\n+   storage_mode_t mode {storage_mode_sparse};\n+   aux::vector<download_priority_t, file_index_t> const& priorities;\n+   sha1_hash info_hash;\n };\n 
\n-\n-[report issue]
\n-

add() remove()

\n+[report issue]
\n+
\n+

mmap_disk_io_constructor()

\n+

Declared in "libtorrent/mmap_disk_io.hpp"

\n
\n-void add (socket_type_t const st, peer_class_t const peer_class);\n-void remove (socket_type_t const st, peer_class_t const peer_class);\n+std::unique_ptr<disk_interface> mmap_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n 
\n-

add() and remove() adds and removes a peer class to be added\n-to new peers based on socket type.

\n-\n-[report issue]
\n-
\n-

disallow() allow()

\n+

constructs a memory mapped file disk I/O object.

\n+[report issue]
\n+
\n+

posix_disk_io_constructor()

\n+

Declared in "libtorrent/posix_disk_io.hpp"

\n
\n-void disallow (socket_type_t const st, peer_class_t const peer_class);\n-void allow (socket_type_t const st, peer_class_t const peer_class);\n+std::unique_ptr<disk_interface> posix_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n 
\n-

disallow() and allow() adds and removes a peer class to be\n-removed from new peers based on socket type.

\n-

The peer_class argument cannot be greater than 31. The bitmasks representing\n-peer classes in the peer_class_type_filter are 32 bits.

\n-[report issue]
\n-
\n-

apply()

\n+

this is a simple posix disk I/O back-end, used for systems that don't\n+have a 64 bit virtual address space or don't support memory mapped files.\n+It's implemented using portable C file functions and is single-threaded.

\n+[report issue]
\n+
\n+

disabled_disk_io_constructor()

\n+

Declared in "libtorrent/disabled_disk_io.hpp"

\n
\n-std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n+std::unique_ptr<disk_interface> disabled_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n 
\n-

takes a bitmask of peer classes and returns a new bitmask of\n-peer classes after the rules have been applied, based on the socket type argument\n-(st).

\n-[report issue]
\n-
\n-

enum socket_type_t

\n-

Declared in "libtorrent/peer_class_type_filter.hpp"

\n+

creates a disk io object that discards all data written to it, and only\n+returns zero-buffers when read from. May be useful for testing and\n+benchmarking.

\n+[report issue]
\n+
\n+

default_disk_io_constructor()

\n+

Declared in "libtorrent/session.hpp"

\n+
\n+std::unique_ptr<disk_interface> default_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n+
\n+

the constructor function for the default storage. On systems that support\n+memory mapped files (and a 64 bit address space) the memory mapped storage\n+will be constructed, otherwise the portable posix storage.

\n+[report issue]
\n+
\n+

enum storage_mode_t

\n+

Declared in "libtorrent/storage_defs.hpp"

\n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n+\n+\n+\n+
namevaluedescription
tcp_socket
storage_mode_allocate0these match the socket types from socket_type.hpp\n-shifted one downAll pieces will be written to their final position, all files will be\n+allocated in full when the torrent is first started. This mode minimizes\n+fragmentation but could be a costly operation.
utp_socket
storage_mode_sparse1All pieces will be written to the place where they belong and sparse files\n+will be used. This is the recommended, and default mode.
\n+[report issue]
\n+
\n+

enum status_t

\n+

Declared in "libtorrent/storage_defs.hpp"

\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n-\n+\n+\n+\n+\n+\n \n \n \n-\n+\n \n \n \n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+
namevaluedescription
no_error0 
ssl_tcp_socket
fatal_disk_error1 
need_full_check2 
ssl_utp_socket
file_exist3 
i2p_socket4 
oversized_file16this is not an enum value, but a flag that can be set in the return\n+from async_check_files, in case an existing file was found larger than\n+specified in the torrent. i.e. it has garbage at the end\n+the status_t field is used for this to preserve ABI.
num_socket_types5 
\n+[report issue]
\n+
\n+

enum move_flags_t

\n+

Declared in "libtorrent/storage_defs.hpp"

\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n
namevaluedescription
always_replace_files0replace any files in the destination when copying\n+or moving the storage
fail_if_exist1if any files that we want to copy exist in the destination\n+exist, fail the whole operation and don't perform\n+any copy or move. There is an inherent race condition\n+in this mode. The files are checked for existence before\n+the operation starts. In between the check and performing\n+the copy, the destination files may be created, in which\n+case they are replaced.
dont_replace2if any file exist in the target, take those files instead\n+of the ones we may have in the source.
\n

The disk I/O can be customized in libtorrent. In previous versions, the\n customization was at the level of each torrent. Now, the customization point\n is at the session level. All torrents added to a session will use the same\n disk I/O subsystem, as determined by the disk_io_constructor (in\n@@ -3000,52 +3153,32 @@\n std::unique_ptr<lt::disk_interface> temp_disk_constructor(\n lt::io_context& ioc, lt::settings_interface const&, lt::counters&)\n {\n return std::make_unique<temp_disk_io>(ioc);\n }\n \n [report issue]

\n-
\n
\n

settings_interface

\n

Declared in "libtorrent/settings_pack.hpp"

\n

the common interface to settings_pack and the internal representation of\n settings.

\n
\n struct settings_interface\n {\n-   virtual bool has_val (int name) const = 0;\n+   virtual void set_bool (int name, bool val) = 0;\n    virtual void set_int (int name, int val) = 0;\n    virtual void set_str (int name, std::string val) = 0;\n-   virtual void set_bool (int name, bool val) = 0;\n+   virtual bool has_val (int name) const = 0;\n    virtual int get_int (int name) const = 0;\n    virtual std::string const& get_str (int name) const = 0;\n    virtual bool get_bool (int name) const = 0;\n };\n 
\n-[report issue]
\n-
\n-

disk_observer

\n-

Declared in "libtorrent/disk_observer.hpp"

\n-
\n-struct disk_observer\n-{\n-   virtual void on_disk () = 0;\n-};\n-
\n-[report issue]
\n-

on_disk()

\n-
\n-virtual void on_disk () = 0;\n-
\n-

called when the disk cache size has dropped\n-below the low watermark again and we can\n-resume downloading from peers

\n [report issue]
\n-
\n
\n

open_file_state

\n

Declared in "libtorrent/disk_interface.hpp"

\n

this contains information about a file that's currently open by the\n libtorrent disk I/O subsystem. It's associated with a single torrent.

\n
\n struct open_file_state\n@@ -3089,21 +3222,21 @@\n the constructor. The callbacks will be run in the network thread.

\n
\n struct disk_interface\n {\n    virtual storage_holder new_torrent (storage_params const& p\n       , std::shared_ptr<void> const& torrent) = 0;\n    virtual void remove_torrent (storage_index_t) = 0;\n-   virtual void async_read (storage_index_t storage, peer_request const& r\n-      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n-      , disk_job_flags_t flags = {}) = 0;\n    virtual bool async_write (storage_index_t storage, peer_request const& r\n       , char const* buf, std::shared_ptr<disk_observer> o\n       , std::function<void(storage_error const&)> handler\n       , disk_job_flags_t flags = {}) = 0;\n+   virtual void async_read (storage_index_t storage, peer_request const& r\n+      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n+      , disk_job_flags_t flags = {}) = 0;\n    virtual void async_hash (storage_index_t storage, piece_index_t piece, span<sha256_hash> v2\n       , disk_job_flags_t flags\n       , std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) = 0;\n    virtual void async_hash2 (storage_index_t storage, piece_index_t piece, int offset, disk_job_flags_t flags\n       , std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) = 0;\n    virtual void async_move_storage (storage_index_t storage, std::string p, move_flags_t flags\n       , std::function<void(status_t, std::string const&, storage_error const&)> handler) = 0;\n@@ -3160,21 +3293,21 @@\n delete any files from disk, just to clean up any resources associated\n with the specified storage.

\n \n [report issue]
\n
\n

async_read() async_write()

\n
\n-virtual void async_read (storage_index_t storage, peer_request const& r\n-      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n-      , disk_job_flags_t flags = {}) = 0;\n virtual bool async_write (storage_index_t storage, peer_request const& r\n       , char const* buf, std::shared_ptr<disk_observer> o\n       , std::function<void(storage_error const&)> handler\n       , disk_job_flags_t flags = {}) = 0;\n+virtual void async_read (storage_index_t storage, peer_request const& r\n+      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n+      , disk_job_flags_t flags = {}) = 0;\n 
\n

perform a read or write operation from/to the specified storage\n index and the specified request. When the operation completes, call\n handler possibly with a disk_buffer_holder, holding the buffer with\n the result. Flags may be set to affect the read operation. See\n disk_job_flags_t.

\n

The disk_observer is a callback to indicate that\n@@ -3425,17 +3558,17 @@\n internal libtorrent torrent object to tie the storage object allocated\n for a torrent to the lifetime of the internal torrent object. When a\n torrent is removed from the session, this holder is destructed and will\n inform the disk object.

\n
\n struct storage_holder\n {\n-   storage_holder () = default;\n    ~storage_holder ();\n    storage_holder (storage_index_t idx, disk_interface& disk_io);\n+   storage_holder () = default;\n    explicit operator bool () const;\n    operator storage_index_t () const;\n    void reset ();\n    storage_holder (storage_holder const&) = delete;\n    storage_holder& operator= (storage_holder const&) = delete;\n    storage_holder (storage_holder&& rhs) noexcept;\n    storage_holder& operator= (storage_holder&& rhs) noexcept;\n@@ -3516,35 +3649,54 @@\n 

reset()

\n
\n void reset ();\n 
\n

free the held disk buffer, if any, and clear the holder. This sets the\n holder object to a default-constructed state

\n [report issue]
\n-
\n+
\n

swap()

\n
\n void swap (disk_buffer_holder& h) noexcept;\n 
\n

swap pointers of two disk buffer holders.

\n [report issue]
\n
\n

is_mutable()

\n
\n bool is_mutable () const noexcept;\n 
\n

if this returns true, the buffer may not be modified in place

\n [report issue]
\n-
\n+
\n

bool()

\n
\n explicit operator bool () const noexcept;\n 
\n

implicitly convertible to true if the object is currently holding a\n buffer

\n+[report issue]
\n+
\n+
\n+

disk_observer

\n+

Declared in "libtorrent/disk_observer.hpp"

\n+
\n+struct disk_observer\n+{\n+   virtual void on_disk () = 0;\n+};\n+
\n+[report issue]
\n+

on_disk()

\n+
\n+virtual void on_disk () = 0;\n+
\n+

called when the disk cache size has dropped\n+below the low watermark again and we can\n+resume downloading from peers

\n [report issue]
\n
\n
\n

file_open_mode_t

\n

Declared in "libtorrent/disk_interface.hpp"

\n
\n
read_only
\n@@ -8041,24 +8193,24 @@\n operations. This file size limit is specified in 16 kiB blocks.

\n
\n struct settings_pack final : settings_interface\n {\n    friend  void apply_pack_impl (settings_pack const*\n       , aux::session_settings_single_thread&\n       , std::vector<void(aux::session_impl::*)()>*);\n-   void set_bool (int name, bool val) override;\n    void set_str (int name, std::string val) override;\n-   void set_int (int name, flags::bitfield_flag<Type, Tag> const val);\n+   void set_bool (int name, bool val) override;\n    void set_int (int name, int val) override;\n+   void set_int (int name, flags::bitfield_flag<Type, Tag> const val);\n    bool has_val (int name) const override;\n    void clear ();\n    void clear (int name);\n-   std::string const& get_str (int name) const override;\n    bool get_bool (int name) const override;\n    int get_int (int name) const override;\n+   std::string const& get_str (int name) const override;\n    void for_each (Fun&& f) const;\n \n    enum type_bases\n    {\n       string_type_base,\n       int_type_base,\n       bool_type_base,\n@@ -8130,22 +8282,22 @@\n       http,\n       http_pw,\n       i2p_proxy,\n    };\n };\n 
\n \n-\n-[report issue]
\n-

set_int() set_str() set_bool()

\n+\n+[report issue]
\n+

set_int() set_bool() set_str()

\n
\n-void set_bool (int name, bool val) override;\n void set_str (int name, std::string val) override;\n-void set_int (int name, flags::bitfield_flag<Type, Tag> const val);\n+void set_bool (int name, bool val) override;\n void set_int (int name, int val) override;\n+void set_int (int name, flags::bitfield_flag<Type, Tag> const val);\n 
\n

set a configuration option in the settings_pack. name is one of\n the enum values from string_types, int_types or bool_types. They must\n match the respective type of the set_* function.

\n [report issue]
\n
\n

has_val()

\n@@ -8165,23 +8317,23 @@\n [report issue]
\n
\n

clear()

\n
\n void clear (int name);\n 
\n

clear a specific setting from the pack

\n-\n \n-[report issue]
\n-
\n-

get_str() get_bool() get_int()

\n+\n+[report issue]
\n+
\n+

get_bool() get_int() get_str()

\n
\n-std::string const& get_str (int name) const override;\n bool get_bool (int name) const override;\n int get_int (int name) const override;\n+std::string const& get_str (int name) const override;\n 
\n

queries the current configuration option from the settings_pack.\n name is one of the enumeration values from string_types, int_types\n or bool_types. The enum value must match the type of the get_*\n function. If the specified setting field has not been set, the default\n value is returned.

\n [report issue]
\n@@ -8551,56 +8703,27 @@\n \n [report issue]
\n
\n
\n

setting_by_name() name_for_setting()

\n

Declared in "libtorrent/settings_pack.hpp"

\n
\n-int setting_by_name (string_view name);\n char const* name_for_setting (int s);\n+int setting_by_name (string_view name);\n 
\n

converts a setting integer (from the enums string_types, int_types or\n bool_types) to a string, and vice versa.

\n [report issue]
\n
\n

default_settings()

\n

Declared in "libtorrent/settings_pack.hpp"

\n
\n settings_pack default_settings ();\n 
\n

returns a settings_pack with every setting set to its default value

\n-\n-[report issue]
\n-
\n-

high_performance_seed() min_memory_usage()

\n-

Declared in "libtorrent/session.hpp"

\n-
\n-settings_pack high_performance_seed ();\n-settings_pack min_memory_usage ();\n-
\n-

The default values of the session settings are set for a regular\n-bittorrent client running on a desktop system. There are functions that\n-can set the session settings to pre set settings for other environments.\n-These can be used for the basis, and should be tweaked to fit your needs\n-better.

\n-

min_memory_usage returns settings that will use the minimal amount of\n-RAM, at the potential expense of upload and download performance. It\n-adjusts the socket buffer sizes, disables the disk cache, lowers the send\n-buffer watermarks so that each connection only has at most one block in\n-use at any one time. It lowers the outstanding blocks send to the disk\n-I/O thread so that connections only have one block waiting to be flushed\n-to disk at any given time. It lowers the max number of peers in the peer\n-list for torrents. It performs multiple smaller reads when it hashes\n-pieces, instead of reading it all into memory before hashing.

\n-

This configuration is intended to be the starting point for embedded\n-devices. It will significantly reduce memory usage.

\n-

high_performance_seed returns settings optimized for a seed box,\n-serving many peers and that doesn't do any downloading. It has a 128 MB\n-disk cache and has a limit of 400 files in its file pool. It support fast\n-upload rates by allowing large send buffers.

\n [report issue]
\n
\n

generate_fingerprint()

\n

Declared in "libtorrent/fingerprint.hpp"

\n
\n std::string generate_fingerprint (std::string name\n    , int major, int minor = 0, int revision = 0, int tag = 0);\n@@ -8650,14 +8773,475 @@\n Tribler\n \n \n \n 

There's an informal directory of client id's here.

\n

The major, minor, revision and tag parameters are used to\n identify the version of your client.

\n+\n+[report issue]
\n+
\n+

min_memory_usage() high_performance_seed()

\n+

Declared in "libtorrent/session.hpp"

\n+
\n+settings_pack min_memory_usage ();\n+settings_pack high_performance_seed ();\n+
\n+

The default values of the session settings are set for a regular\n+bittorrent client running on a desktop system. There are functions that\n+can set the session settings to pre set settings for other environments.\n+These can be used for the basis, and should be tweaked to fit your needs\n+better.

\n+

min_memory_usage returns settings that will use the minimal amount of\n+RAM, at the potential expense of upload and download performance. It\n+adjusts the socket buffer sizes, disables the disk cache, lowers the send\n+buffer watermarks so that each connection only has at most one block in\n+use at any one time. It lowers the outstanding blocks send to the disk\n+I/O thread so that connections only have one block waiting to be flushed\n+to disk at any given time. It lowers the max number of peers in the peer\n+list for torrents. It performs multiple smaller reads when it hashes\n+pieces, instead of reading it all into memory before hashing.

\n+

This configuration is intended to be the starting point for embedded\n+devices. It will significantly reduce memory usage.

\n+

high_performance_seed returns settings optimized for a seed box,\n+serving many peers and that doesn't do any downloading. It has a 128 MB\n+disk cache and has a limit of 400 files in its file pool. It support fast\n+upload rates by allowing large send buffers.

\n+[report issue]
\n+
\n+

peer_class_info

\n+

Declared in "libtorrent/peer_class.hpp"

\n+

holds settings for a peer class. Used in set_peer_class() and\n+get_peer_class() calls.

\n+
\n+struct peer_class_info\n+{\n+   bool ignore_unchoke_slots;\n+   int connection_limit_factor;\n+   std::string label;\n+   int upload_limit;\n+   int download_limit;\n+   int upload_priority;\n+   int download_priority;\n+};\n+
\n+[report issue]
\n+
ignore_unchoke_slots
\n+
ignore_unchoke_slots determines whether peers should always\n+unchoke a peer, regardless of the choking algorithm, or if it should\n+honor the unchoke slot limits. It's used for local peers by default.\n+If any of the peer classes a peer belongs to has this set to true,\n+that peer will be unchoked at all times.
\n+
\n+[report issue]
\n+
connection_limit_factor
\n+
adjusts the connection limit (global and per torrent) that applies to\n+this peer class. By default, local peers are allowed to exceed the\n+normal connection limit for instance. This is specified as a percent\n+factor. 100 makes the peer class apply normally to the limit. 200\n+means as long as there are fewer connections than twice the limit, we\n+accept this peer. This factor applies both to the global connection\n+limit and the per-torrent limit. Note that if not used carefully one\n+peer class can potentially completely starve out all other over time.
\n+
\n+[report issue]
\n+
label
\n+
not used by libtorrent. It's intended as a potentially user-facing\n+identifier of this peer class.
\n+
\n+\n+[report issue]
\n+
upload_limit download_limit
\n+
transfer rates limits for the whole peer class. They are specified in\n+bytes per second and apply to the sum of all peers that are members of\n+this class.
\n+
\n+\n+[report issue]
\n+
upload_priority download_priority
\n+
relative priorities used by the bandwidth allocator in the rate\n+limiter. If no rate limits are in use, the priority is not used\n+either. Priorities start at 1 (0 is not a valid priority) and may not\n+exceed 255.
\n+
\n+[report issue]
\n+
\n+

peer_class_type_filter

\n+

Declared in "libtorrent/peer_class_type_filter.hpp"

\n+

peer_class_type_filter is a simple container for rules for adding and subtracting\n+peer-classes from peers. It is applied after the peer class filter is applied (which\n+is based on the peer's IP address).

\n+
\n+struct peer_class_type_filter\n+{\n+   void remove (socket_type_t const st, peer_class_t const peer_class);\n+   void add (socket_type_t const st, peer_class_t const peer_class);\n+   void disallow (socket_type_t const st, peer_class_t const peer_class);\n+   void allow (socket_type_t const st, peer_class_t const peer_class);\n+   std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n+   friend bool operator== (peer_class_type_filter const& lhs\n+      , peer_class_type_filter const& rhs);\n+\n+   enum socket_type_t\n+   {\n+      tcp_socket,\n+      utp_socket,\n+      ssl_tcp_socket,\n+      ssl_utp_socket,\n+      i2p_socket,\n+      num_socket_types,\n+   };\n+};\n+
\n+\n+[report issue]
\n+

remove() add()

\n+
\n+void remove (socket_type_t const st, peer_class_t const peer_class);\n+void add (socket_type_t const st, peer_class_t const peer_class);\n+
\n+

add() and remove() adds and removes a peer class to be added\n+to new peers based on socket type.

\n+\n+[report issue]
\n+
\n+

disallow() allow()

\n+
\n+void disallow (socket_type_t const st, peer_class_t const peer_class);\n+void allow (socket_type_t const st, peer_class_t const peer_class);\n+
\n+

disallow() and allow() adds and removes a peer class to be\n+removed from new peers based on socket type.

\n+

The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_type_filter are 32 bits.

\n+[report issue]
\n+
\n+

apply()

\n+
\n+std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n+
\n+

takes a bitmask of peer classes and returns a new bitmask of\n+peer classes after the rules have been applied, based on the socket type argument\n+(st).

\n+[report issue]
\n+
\n+

enum socket_type_t

\n+

Declared in "libtorrent/peer_class_type_filter.hpp"

\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
namevaluedescription
tcp_socket0these match the socket types from socket_type.hpp\n+shifted one down
utp_socket1 
ssl_tcp_socket2 
ssl_utp_socket3 
i2p_socket4 
num_socket_types5 
\n+[report issue]
\n+
\n+
\n+

bitfield

\n+

Declared in "libtorrent/bitfield.hpp"

\n+

The bitfield type stores any number of bits as a bitfield\n+in a heap allocated array.

\n+
\n+struct bitfield\n+{\n+   explicit bitfield (int bits);\n+   bitfield (bitfield&& rhs) noexcept = default;\n+   bitfield () noexcept = default;\n+   bitfield (char const* b, int bits);\n+   bitfield (int bits, bool val);\n+   bitfield (bitfield const& rhs);\n+   void assign (char const* b, int const bits);\n+   bool operator[] (int index) const noexcept;\n+   bool get_bit (int index) const noexcept;\n+   void set_bit (int index) noexcept;\n+   void clear_bit (int index) noexcept;\n+   bool all_set () const noexcept;\n+   bool none_set () const noexcept;\n+   int size () const noexcept;\n+   int num_words () const noexcept;\n+   bool empty () const noexcept;\n+   char* data () noexcept;\n+   char const* data () const noexcept;\n+   void swap (bitfield& rhs) noexcept;\n+   int count () const noexcept;\n+   int find_first_set () const noexcept;\n+   int find_last_clear () const noexcept;\n+};\n+
\n+[report issue]
\n+

bitfield()

\n+
\n+explicit bitfield (int bits);\n+bitfield (bitfield&& rhs) noexcept = default;\n+bitfield () noexcept = default;\n+bitfield (char const* b, int bits);\n+bitfield (int bits, bool val);\n+bitfield (bitfield const& rhs);\n+
\n+

constructs a new bitfield. The default constructor creates an empty\n+bitfield. bits is the size of the bitfield (specified in bits).\n+val is the value to initialize the bits to. If not specified\n+all bits are initialized to 0.

\n+

The constructor taking a pointer b and bits copies a bitfield\n+from the specified buffer, and bits number of bits (rounded up to\n+the nearest byte boundary).

\n+[report issue]
\n+
\n+

assign()

\n+
\n+void assign (char const* b, int const bits);\n+
\n+

copy bitfield from buffer b of bits number of bits, rounded up to\n+the nearest byte boundary.

\n+\n+[report issue]
\n+
\n+

operator[]() get_bit()

\n+
\n+bool operator[] (int index) const noexcept;\n+bool get_bit (int index) const noexcept;\n+
\n+

query bit at index. Returns true if bit is 1, otherwise false.

\n+\n+[report issue]
\n+
\n+

clear_bit() set_bit()

\n+
\n+void set_bit (int index) noexcept;\n+void clear_bit (int index) noexcept;\n+
\n+

set bit at index to 0 (clear_bit) or 1 (set_bit).

\n+[report issue]
\n+
\n+

all_set()

\n+
\n+bool all_set () const noexcept;\n+
\n+

returns true if all bits in the bitfield are set

\n+[report issue]
\n+
\n+

none_set()

\n+
\n+bool none_set () const noexcept;\n+
\n+

returns true if no bit in the bitfield is set

\n+[report issue]
\n+
\n+

size()

\n+
\n+int size () const noexcept;\n+
\n+

returns the size of the bitfield in bits.

\n+[report issue]
\n+
\n+

num_words()

\n+
\n+int num_words () const noexcept;\n+
\n+

returns the number of 32 bit words are needed to represent all bits in\n+this bitfield.

\n+[report issue]
\n+
\n+

empty()

\n+
\n+bool empty () const noexcept;\n+
\n+

returns true if the bitfield has zero size.

\n+[report issue]
\n+
\n+

data()

\n+
\n+char* data () noexcept;\n+char const* data () const noexcept;\n+
\n+

returns a pointer to the internal buffer of the bitfield, or\n+nullptr if it's empty.

\n+[report issue]
\n+
\n+

swap()

\n+
\n+void swap (bitfield& rhs) noexcept;\n+
\n+

swaps the bit-fields two variables refer to

\n+[report issue]
\n+
\n+

count()

\n+
\n+int count () const noexcept;\n+
\n+

count the number of bits in the bitfield that are set to 1.

\n+[report issue]
\n+
\n+

find_first_set()

\n+
\n+int find_first_set () const noexcept;\n+
\n+

returns the index of the first set bit in the bitfield, i.e. 1 bit.

\n+[report issue]
\n+
\n+

find_last_clear()

\n+
\n+int find_last_clear () const noexcept;\n+
\n+

returns the index to the last cleared bit in the bitfield, i.e. 0 bit.

\n+[report issue]
\n+
\n+
\n+

hasher

\n+

Declared in "libtorrent/hasher.hpp"

\n+

this is a SHA-1 hash class.

\n+

You use it by first instantiating it, then call update() to feed it\n+with data. i.e. you don't have to keep the entire buffer of which you want to\n+create the hash in memory. You can feed the hasher parts of it at a time. When\n+You have fed the hasher with all the data, you call final() and it\n+will return the sha1-hash of the data.

\n+

The constructor that takes a char const* and an integer will construct the\n+sha1 context and feed it the data passed in.

\n+

If you want to reuse the hasher object once you have created a hash, you have to\n+call reset() to reinitialize it.

\n+

The built-in software version of sha1-algorithm was implemented\n+by Steve Reid and released as public domain.\n+For more info, see src/sha1.cpp.

\n+
\n+class hasher\n+{\n+   hasher ();\n+   hasher (char const* data, int len);\n+   explicit hasher (span<char const> data);\n+   hasher (hasher const&);\n+   hasher& operator= (hasher const&) &;\n+   hasher& update (span<char const> data);\n+   hasher& update (char const* data, int len);\n+   sha1_hash final ();\n+   void reset ();\n+};\n+
\n+\n+[report issue]
\n+

hasher() operator=()

\n+
\n+hasher (char const* data, int len);\n+explicit hasher (span<char const> data);\n+hasher (hasher const&);\n+hasher& operator= (hasher const&) &;\n+
\n+

this is the same as default constructing followed by a call to\n+update(data, len).

\n+[report issue]
\n+
\n+

update()

\n+
\n+hasher& update (span<char const> data);\n+hasher& update (char const* data, int len);\n+
\n+

append the following bytes to what is being hashed

\n+[report issue]
\n+
\n+

final()

\n+
\n+sha1_hash final ();\n+
\n+

returns the SHA-1 digest of the buffers previously passed to\n+update() and the hasher constructor.

\n+[report issue]
\n+
\n+

reset()

\n+
\n+void reset ();\n+
\n+

restore the hasher state to be as if the hasher has just been\n+default constructed.

\n+[report issue]
\n+
\n+
\n+

hasher256

\n+

Declared in "libtorrent/hasher.hpp"

\n+
\n+class hasher256\n+{\n+   hasher256 ();\n+   explicit hasher256 (span<char const> data);\n+   hasher256 (char const* data, int len);\n+   hasher256& operator= (hasher256 const&) &;\n+   hasher256 (hasher256 const&);\n+   hasher256& update (span<char const> data);\n+   hasher256& update (char const* data, int len);\n+   sha256_hash final ();\n+   void reset ();\n+   ~hasher256 ();\n+};\n+
\n+\n+[report issue]
\n+

hasher256() operator=()

\n+
\n+explicit hasher256 (span<char const> data);\n+hasher256 (char const* data, int len);\n+hasher256& operator= (hasher256 const&) &;\n+hasher256 (hasher256 const&);\n+
\n+

this is the same as default constructing followed by a call to\n+update(data, len).

\n+[report issue]
\n+
\n+

update()

\n+
\n+hasher256& update (span<char const> data);\n+hasher256& update (char const* data, int len);\n+
\n+

append the following bytes to what is being hashed

\n+[report issue]
\n+
\n+

final()

\n+
\n+sha256_hash final ();\n+
\n+

returns the SHA-1 digest of the buffers previously passed to\n+update() and the hasher constructor.

\n+[report issue]
\n+
\n+

reset()

\n+
\n+void reset ();\n+
\n+

restore the hasher state to be as if the hasher has just been\n+default constructed.

\n

libtorrent has a plugin interface for implementing extensions to the protocol.\n These can be general extensions for transferring metadata or peer exchange\n extensions, or it could be used to provide a way to customize the protocol\n to fit a particular (closed) network.

\n

In short, the plugin interface makes it possible to:

\n
    \n
  • register extension messages (sent in the extension handshake), see\n@@ -8665,14 +9249,15 @@\n
  • add data and parse data from the extension handshake.
  • \n
  • send extension messages and standard bittorrent messages.
  • \n
  • override or block the handling of standard bittorrent messages.
  • \n
  • save and restore state via the session state
  • \n
  • see all alerts that are posted
  • \n
\n
\n+
\n
\n

a word of caution

\n

Writing your own plugin is a very easy way to introduce serious bugs such as\n dead locks and race conditions. Since a plugin has access to internal\n structures it is also quite easy to sabotage libtorrent's operation.

\n

All the callbacks are always called from the libtorrent network thread. In\n case portions of your plugin are called from other threads, typically the main\n@@ -8745,93 +9330,23 @@\n expected.

\n

The static category is required for checking whether or not the category\n for a specific alert is enabled or not, without instantiating the alert.\n The category virtual function is the run-time equivalence.

\n

The what() virtual function may simply be a string literal of the class\n name of your alert.

\n

For more information, see the alert section.

\n-[report issue]
\n-
\n-

peer_connection_handle

\n-

Declared in "libtorrent/peer_connection_handle.hpp"

\n-

the peer_connection_handle class provides a handle to the internal peer\n-connection object, to be used by plugins. This is a low level interface that\n-may not be stable across libtorrent versions

\n+[report issue]
\n+
\n+

plugin

\n+

Declared in "libtorrent/extensions.hpp"

\n+

this is the base class for a session plugin. One primary feature\n+is that it is notified of all torrents that are added to the session,\n+and can add its own torrent_plugins.

\n
\n-struct peer_connection_handle\n-{\n-   explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);\n-   connection_type type () const;\n-   peer_plugin const* find_plugin (string_view type) const;\n-   void add_extension (std::shared_ptr<peer_plugin>);\n-   bool is_seed () const;\n-   bool upload_only () const;\n-   bool has_piece (piece_index_t i) const;\n-   peer_id const& pid () const;\n-   bool is_interesting () const;\n-   bool is_choked () const;\n-   bool is_peer_interested () const;\n-   bool has_peer_choked () const;\n-   void choke_this_peer ();\n-   void maybe_unchoke_this_peer ();\n-   void get_peer_info (peer_info& p) const;\n-   torrent_handle associated_torrent () const;\n-   tcp::endpoint const& remote () const;\n-   tcp::endpoint local_endpoint () const;\n-   void disconnect (error_code const& ec, operation_t op\n-      , disconnect_severity_t = peer_connection_interface::normal);\n-   bool is_connecting () const;\n-   bool is_outgoing () const;\n-   bool is_disconnecting () const;\n-   bool on_local_network () const;\n-   bool ignore_unchoke_slots () const;\n-   bool failed () const;\n-   bool should_log (peer_log_alert::direction_t direction) const;\n-   void peer_log (peer_log_alert::direction_t direction\n-      , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n-   bool can_disconnect (error_code const& ec) const;\n-   bool has_metadata () const;\n-   bool in_handshake () const;\n-   void send_buffer (char const* begin, int size);\n-   std::time_t last_seen_complete () const;\n-   time_point time_of_last_unchoke () const;\n-   bool operator!= (peer_connection_handle const& o) const;\n-   bool operator< (peer_connection_handle const& o) const;\n-   bool operator== (peer_connection_handle const& o) const;\n-   std::shared_ptr<peer_connection> native_handle () const;\n-};\n-
\n-[report issue]
\n-
\n-

bt_peer_connection_handle

\n-

Declared in "libtorrent/peer_connection_handle.hpp"

\n-

The bt_peer_connection_handle provides a handle to the internal bittorrent\n-peer connection object to plugins. It's low level and may not be a stable API\n-across libtorrent versions.

\n-
\n-struct bt_peer_connection_handle : peer_connection_handle\n-{\n-   explicit bt_peer_connection_handle (peer_connection_handle pc);\n-   bool packet_finished () const;\n-   bool support_extensions () const;\n-   bool supports_encryption () const;\n-   void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);\n-   void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);\n-   std::shared_ptr<bt_peer_connection> native_handle () const;\n-};\n-
\n-[report issue]
\n-
\n-

plugin

\n-

Declared in "libtorrent/extensions.hpp"

\n-

this is the base class for a session plugin. One primary feature\n-is that it is notified of all torrents that are added to the session,\n-and can add its own torrent_plugins.

\n-
\n-struct plugin\n+struct plugin\n {\n    virtual feature_flags_t implemented_features ();\n    virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);\n    virtual void added (session_handle const&);\n    virtual void abort ();\n    virtual bool on_dht_request (string_view /* query */\n       , udp::endpoint const& /* source */, bdecode_node const& /* message */\n@@ -8979,16 +9494,16 @@\n 
\n struct torrent_plugin\n {\n    virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n    virtual void on_piece_pass (piece_index_t);\n    virtual void on_piece_failed (piece_index_t);\n    virtual void tick ();\n-   virtual bool on_pause ();\n    virtual bool on_resume ();\n+   virtual bool on_pause ();\n    virtual void on_files_checked ();\n    virtual void on_state (torrent_status::state_t);\n    virtual void on_add_peer (tcp::endpoint const&,\n       peer_source_flags_t, add_peer_flags_t);\n \n    static constexpr add_peer_flags_t first_time  = 1_bit;\n    static constexpr add_peer_flags_t filtered  = 2_bit;\n@@ -9027,21 +9542,21 @@\n 
\n

tick()

\n
\n virtual void tick ();\n 
\n

This hook is called approximately once per second. It is a way of making it\n easy for plugins to do timed events, for sending messages or whatever.

\n-\n-[report issue]
\n-
\n-

on_resume() on_pause()

\n+\n+[report issue]
\n+
\n+

on_pause() on_resume()

\n
\n-virtual bool on_pause ();\n virtual bool on_resume ();\n+virtual bool on_pause ();\n 
\n

These hooks are called when the torrent is paused and resumed respectively.\n The return value indicates if the event was handled. A return value of\n true indicates that it was handled, and no other plugin after this one\n will have this hook function called, and the standard handler will also not be\n invoked. So, returning true effectively overrides the standard behavior of\n pause or resume.

\n@@ -9106,43 +9621,43 @@\n {\n virtual string_view type () const;\n virtual void add_handshake (entry&);\n virtual void on_disconnect (error_code const&);\n virtual void on_connected ();\n virtual bool on_handshake (span<char const>);\n virtual bool on_extension_handshake (bdecode_node const&);\n- virtual bool on_interested ();\n+ virtual bool on_have (piece_index_t);\n+ virtual bool on_have_all ();\n+ virtual bool on_have_none ();\n+ virtual bool on_request (peer_request const&);\n+ virtual bool on_allowed_fast (piece_index_t);\n+ virtual bool on_not_interested ();\n virtual bool on_unchoke ();\n+ virtual bool on_interested ();\n virtual bool on_choke ();\n- virtual bool on_request (peer_request const&);\n virtual bool on_dont_have (piece_index_t);\n- virtual bool on_have (piece_index_t);\n- virtual bool on_allowed_fast (piece_index_t);\n- virtual bool on_have_none ();\n- virtual bool on_have_all ();\n virtual bool on_bitfield (bitfield const& /*bitfield*/);\n- virtual bool on_not_interested ();\n virtual bool on_piece (peer_request const& /*piece*/\n , span<char const> /*buf*/);\n- virtual bool on_cancel (peer_request const&);\n- virtual bool on_suggest (piece_index_t);\n virtual bool on_reject (peer_request const&);\n+ virtual bool on_suggest (piece_index_t);\n+ virtual bool on_cancel (peer_request const&);\n+ virtual void sent_have_all ();\n+ virtual void sent_suggest (piece_index_t);\n virtual void sent_have_none ();\n virtual void sent_cancel (peer_request const&);\n- virtual void sent_suggest (piece_index_t);\n- virtual void sent_request (peer_request const&);\n- virtual void sent_allow_fast (piece_index_t);\n virtual void sent_reject_request (peer_request const&);\n- virtual void sent_have_all ();\n virtual void sent_choke ();\n+ virtual void sent_request (peer_request const&);\n+ virtual void sent_allow_fast (piece_index_t);\n+ virtual void sent_interested ();\n virtual void sent_have (piece_index_t);\n- virtual void sent_unchoke ();\n virtual void sent_piece (peer_request const&);\n virtual void sent_not_interested ();\n- virtual void sent_interested ();\n+ virtual void sent_unchoke ();\n virtual void sent_payload (int /* bytes */);\n virtual bool can_disconnect (error_code const& /*ec*/);\n virtual bool on_extended (int /*length*/, int /*msg*/,\n span<char const> /*body*/);\n virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n span<char const> /*body*/);\n virtual void on_piece_pass (piece_index_t);\n@@ -9200,39 +9715,39 @@\n virtual bool on_extension_handshake (bdecode_node const&);\n
\n

called when the extension handshake from the other end is received\n if this returns false, it means that this extension isn't\n supported by this peer. It will result in this peer_plugin\n being removed from the peer_connection and destructed.\n this is not called for web seeds

\n-\n-\n+\n \n-\n-\n-\n-\n \n+\n \n \n-[report issue]
\n-
\n-

on_interested() on_not_interested() on_have() on_allowed_fast() on_have_none() on_unchoke() on_have_all() on_dont_have() on_request() on_choke() on_bitfield()

\n+\n+\n+\n+\n+[report issue]
\n+
\n+

on_bitfield() on_have() on_dont_have() on_have_none() on_request() on_choke() on_interested() on_have_all() on_allowed_fast() on_not_interested() on_unchoke()

\n
\n-virtual bool on_interested ();\n+virtual bool on_have (piece_index_t);\n+virtual bool on_have_all ();\n+virtual bool on_have_none ();\n+virtual bool on_request (peer_request const&);\n+virtual bool on_allowed_fast (piece_index_t);\n+virtual bool on_not_interested ();\n virtual bool on_unchoke ();\n+virtual bool on_interested ();\n virtual bool on_choke ();\n-virtual bool on_request (peer_request const&);\n virtual bool on_dont_have (piece_index_t);\n-virtual bool on_have (piece_index_t);\n-virtual bool on_allowed_fast (piece_index_t);\n-virtual bool on_have_none ();\n-virtual bool on_have_all ();\n virtual bool on_bitfield (bitfield const& /*bitfield*/);\n-virtual bool on_not_interested ();\n 
\n

returning true from any of the message handlers\n indicates that the plugin has handled the message.\n it will break the plugin chain traversing and not let\n anyone else handle the message, including the default\n handler.

\n [report issue]
\n@@ -9244,27 +9759,27 @@\n \n

This function is called when the peer connection is receiving\n a piece. buf points (non-owning pointer) to the data in an\n internal immutable disk buffer. The length of the data is specified\n in the length member of the piece parameter.\n returns true to indicate that the piece is handled and the\n rest of the logic should be ignored.

\n-\n-\n-\n \n-[report issue]
\n-
\n-

sent_not_interested() sent_unchoke() sent_interested() sent_have() sent_piece()

\n+\n+\n+\n+[report issue]
\n+
\n+

sent_have() sent_interested() sent_piece() sent_not_interested() sent_unchoke()

\n
\n+virtual void sent_interested ();\n virtual void sent_have (piece_index_t);\n-virtual void sent_unchoke ();\n virtual void sent_piece (peer_request const&);\n virtual void sent_not_interested ();\n-virtual void sent_interested ();\n+virtual void sent_unchoke ();\n 
\n

called after a choke message has been sent to the peer

\n [report issue]
\n
\n

sent_payload()

\n
\n virtual void sent_payload (int /* bytes */);\n@@ -9334,16 +9849,16 @@\n 
\n
\n

crypto_plugin

\n

Declared in "libtorrent/extensions.hpp"

\n
\n struct crypto_plugin\n {\n-   virtual void set_outgoing_key (span<char const> key) = 0;\n    virtual void set_incoming_key (span<char const> key) = 0;\n+   virtual void set_outgoing_key (span<char const> key) = 0;\n    encrypt (span<span<char>> /*send_vec*/) = 0;\n    virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;\n };\n 
\n [report issue]
\n

decrypt()

\n
\n@@ -9354,203 +9869,134 @@\n (consume, produce, packet_size)

\n

consume is set to the number of bytes which should be trimmed from the\n head of the buffers, default is 0

\n

produce is set to the number of bytes of payload which are now ready to\n be sent to the upper layer. default is the number of bytes passed in receive_vec

\n

packet_size is set to the minimum number of bytes which must be read to\n advance the next step of decryption. default is 0

\n-[report issue]
\n+[report issue]
\n
\n+
\n+

peer_connection_handle

\n+

Declared in "libtorrent/peer_connection_handle.hpp"

\n+

the peer_connection_handle class provides a handle to the internal peer\n+connection object, to be used by plugins. This is a low level interface that\n+may not be stable across libtorrent versions

\n+
\n+struct peer_connection_handle\n+{\n+   explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);\n+   connection_type type () const;\n+   void add_extension (std::shared_ptr<peer_plugin>);\n+   peer_plugin const* find_plugin (string_view type) const;\n+   bool is_seed () const;\n+   bool upload_only () const;\n+   peer_id const& pid () const;\n+   bool has_piece (piece_index_t i) const;\n+   bool is_choked () const;\n+   bool is_interesting () const;\n+   bool is_peer_interested () const;\n+   bool has_peer_choked () const;\n+   void choke_this_peer ();\n+   void maybe_unchoke_this_peer ();\n+   void get_peer_info (peer_info& p) const;\n+   torrent_handle associated_torrent () const;\n+   tcp::endpoint local_endpoint () const;\n+   tcp::endpoint const& remote () const;\n+   void disconnect (error_code const& ec, operation_t op\n+      , disconnect_severity_t = peer_connection_interface::normal);\n+   bool is_connecting () const;\n+   bool is_disconnecting () const;\n+   bool is_outgoing () const;\n+   bool on_local_network () const;\n+   bool ignore_unchoke_slots () const;\n+   bool failed () const;\n+   bool should_log (peer_log_alert::direction_t direction) const;\n+   void peer_log (peer_log_alert::direction_t direction\n+      , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n+   bool can_disconnect (error_code const& ec) const;\n+   bool has_metadata () const;\n+   bool in_handshake () const;\n+   void send_buffer (char const* begin, int size);\n+   time_point time_of_last_unchoke () const;\n+   std::time_t last_seen_complete () const;\n+   bool operator== (peer_connection_handle const& o) const;\n+   bool operator!= (peer_connection_handle const& o) const;\n+   bool operator< (peer_connection_handle const& o) const;\n+   std::shared_ptr<peer_connection> native_handle () const;\n+};\n+
\n+[report issue]
\n+
\n+

bt_peer_connection_handle

\n+

Declared in "libtorrent/peer_connection_handle.hpp"

\n+

The bt_peer_connection_handle provides a handle to the internal bittorrent\n+peer connection object to plugins. It's low level and may not be a stable API\n+across libtorrent versions.

\n+
\n+struct bt_peer_connection_handle : peer_connection_handle\n+{\n+   explicit bt_peer_connection_handle (peer_connection_handle pc);\n+   bool support_extensions () const;\n+   bool packet_finished () const;\n+   bool supports_encryption () const;\n+   void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);\n+   void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);\n+   std::shared_ptr<bt_peer_connection> native_handle () const;\n+};\n+
\n+[report issue]
\n
\n

create_ut_metadata_plugin()

\n

Declared in "libtorrent/extensions/ut_metadata.hpp"

\n
\n std::shared_ptr<torrent_plugin> create_ut_metadata_plugin (torrent_handle const&, client_data_t);\n 
\n

constructor function for the ut_metadata extension. The ut_metadata\n extension allows peers to request the .torrent file (or more\n specifically the info-dictionary of the .torrent file) from each\n other. This is the main building block in making magnet links work.\n This extension is enabled by default unless explicitly disabled in\n the session constructor.

\n

This can either be passed in the add_torrent_params::extensions field, or\n via torrent_handle::add_extension().

\n-[report issue]
\n-
\n-

create_smart_ban_plugin()

\n-

Declared in "libtorrent/extensions/smart_ban.hpp"

\n-
\n-std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);\n-
\n-

constructor function for the smart ban extension. The extension keeps\n-track of the data peers have sent us for failing pieces and once the\n-piece completes and passes the hash check bans the peers that turned\n-out to have sent corrupt data.\n-This function can either be passed in the add_torrent_params::extensions\n-field, or via torrent_handle::add_extension().

\n [report issue]
\n
\n

create_ut_pex_plugin()

\n

Declared in "libtorrent/extensions/ut_pex.hpp"

\n
\n std::shared_ptr<torrent_plugin> create_ut_pex_plugin (torrent_handle const&, client_data_t);\n 
\n

constructor function for the ut_pex extension. The ut_pex\n extension allows peers to gossip about their connections, allowing\n the swarm stay well connected and peers aware of more peers in the\n swarm. This extension is enabled by default unless explicitly disabled in\n the session constructor.

\n

This can either be passed in the add_torrent_params::extensions field, or\n via torrent_handle::add_extension().

\n-[report issue]
\n-
\n-

session_proxy

\n-

Declared in "libtorrent/session.hpp"

\n-

this is a holder for the internal session implementation object. Once the\n-session destruction is explicitly initiated, this holder is used to\n-synchronize the completion of the shutdown. The lifetime of this object\n-may outlive session, causing the session destructor to not block. The\n-session_proxy destructor will block however, until the underlying session\n-is done shutting down.

\n-
\n-struct session_proxy\n-{\n-   ~session_proxy ();\n-   session_proxy& operator= (session_proxy const&) &;\n-   session_proxy& operator= (session_proxy&&) & noexcept;\n-   session_proxy (session_proxy const&);\n-   session_proxy ();\n-   session_proxy (session_proxy&&) noexcept;\n-};\n-
\n-\n-\n-[report issue]
\n-

session_proxy() ~session_proxy() operator=()

\n-
\n-~session_proxy ();\n-session_proxy& operator= (session_proxy const&) &;\n-session_proxy& operator= (session_proxy&&) & noexcept;\n-session_proxy (session_proxy const&);\n-session_proxy ();\n-session_proxy (session_proxy&&) noexcept;\n-
\n-

default constructor, does not refer to any session\n-implementation object.

\n-[report issue]
\n-
\n-
\n-

session

\n-

Declared in "libtorrent/session.hpp"

\n-

The session holds all state that spans multiple torrents. Among other\n-things it runs the network loop and manages all torrents. Once it's\n-created, the session object will spawn the main thread that will do all\n-the work. The main thread will be idle as long it doesn't have any\n-torrents to participate in.

\n-

You have some control over session configuration through the\n-session_handle::apply_settings() member function. To change one or more\n-configuration options, create a settings_pack. object and fill it with\n-the settings to be set and pass it in to session::apply_settings().

\n-

see apply_settings().

\n-
\n-struct session : session_handle\n-{\n-   explicit session (session_params&& params);\n-   session (session_params&& params, session_flags_t flags);\n-   session ();\n-   session (session_params const& params, session_flags_t flags);\n-   explicit session (session_params const& params);\n-   session (session_params const& params, io_context& ios);\n-   session (session_params const& params, io_context& ios, session_flags_t);\n-   session (session_params&& params, io_context& ios);\n-   session (session_params&& params, io_context& ios, session_flags_t);\n-   ~session ();\n-   session_proxy abort ();\n-};\n-
\n-[report issue]
\n-

session()

\n-
\n-explicit session (session_params&& params);\n-session (session_params&& params, session_flags_t flags);\n-session ();\n-session (session_params const& params, session_flags_t flags);\n-explicit session (session_params const& params);\n-
\n-

Constructs the session objects which acts as the container of torrents.\n-In order to avoid a race condition between starting the session and\n-configuring it, you can pass in a session_params object. Its settings\n-will take effect before the session starts up.

\n-

The overloads taking flags can be used to start a session in\n-paused mode (by passing in session::paused). Note that\n-add_default_plugins do not have an affect on constructors that\n-take a session_params object. It already contains the plugins to use.

\n-[report issue]
\n-
\n-

session()

\n-
\n-session (session_params const& params, io_context& ios);\n-session (session_params const& params, io_context& ios, session_flags_t);\n-session (session_params&& params, io_context& ios);\n-session (session_params&& params, io_context& ios, session_flags_t);\n-
\n-

Overload of the constructor that takes an external io_context to run\n-the session object on. This is primarily useful for tests that may want\n-to run multiple sessions on a single io_context, or low resource\n-systems where additional threads are expensive and sharing an\n-io_context with other events is fine.

\n-
\n-

Warning

\n-

The session object does not cleanly terminate with an external\n-io_context. The io_context::run() call must have returned\n-before it's safe to destruct the session. Which means you MUST\n-call session::abort() and save the session_proxy first, then\n-destruct the session object, then sync with the io_context, then\n-destruct the session_proxy object.

\n-
\n-[report issue]
\n-
\n-

~session()

\n-
\n-~session ();\n-
\n-

The destructor of session will notify all trackers that our torrents\n-have been shut down. If some trackers are down, they will time out.\n-All this before the destructor of session returns. So, it's advised\n-that any kind of interface (such as windows) are closed before\n-destructing the session object. Because it can take a few second for\n-it to finish. The timeout can be set with apply_settings().

\n-[report issue]
\n-
\n-

abort()

\n-
\n-session_proxy abort ();\n-
\n-

In case you want to destruct the session asynchronously, you can\n-request a session destruction proxy. If you don't do this, the\n-destructor of the session object will block while the trackers are\n-contacted. If you keep one session_proxy to the session when\n-destructing it, the destructor will not block, but start to close down\n-the session, the destructor of the proxy will then synchronize the\n-threads. So, the destruction of the session is performed from the\n-session destructor call until the session_proxy destructor\n-call. The session_proxy does not have any operations on it (since\n-the session is being closed down, no operations are allowed on it).\n-The only valid operation is calling the destructor:

\n+[report issue]
\n+
\n+

create_smart_ban_plugin()

\n+

Declared in "libtorrent/extensions/smart_ban.hpp"

\n
\n-struct session_proxy {};\n+std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);\n 
\n+

constructor function for the smart ban extension. The extension keeps\n+track of the data peers have sent us for failing pieces and once the\n+piece completes and passes the hash check bans the peers that turned\n+out to have sent corrupt data.\n+This function can either be passed in the add_torrent_params::extensions\n+field, or via torrent_handle::add_extension().

\n [report issue]
\n-
\n
\n

session_handle

\n

Declared in "libtorrent/session_handle.hpp"

\n

this class provides a non-owning handle to a session and a subset of the\n interface of the session class. If the underlying session is destructed\n-any handle to it will no longer be valid. is_valid() will return false and\n+any handle to it will no longer be valid. is_valid() will return false and\n any operation on it will throw a system_error exception, with error code\n invalid_session_handle.

\n
\n struct session_handle\n {\n    bool is_valid () const;\n    session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n@@ -9562,65 +10008,65 @@\n    void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n    void post_session_stats ();\n    void post_dht_stats ();\n    void set_dht_state (dht::dht_state&& st);\n    void set_dht_state (dht::dht_state const& st);\n    std::vector<torrent_handle> get_torrents () const;\n    torrent_handle find_torrent (sha1_hash const& info_hash) const;\n-   torrent_handle add_torrent (add_torrent_params const& params);\n-   torrent_handle add_torrent (add_torrent_params&& params);\n    void async_add_torrent (add_torrent_params&& params);\n-   torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n+   torrent_handle add_torrent (add_torrent_params const& params);\n    torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n    void async_add_torrent (add_torrent_params const& params);\n+   torrent_handle add_torrent (add_torrent_params&& params);\n+   torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n    bool is_paused () const;\n-   void resume ();\n    void pause ();\n+   void resume ();\n    bool is_dht_running () const;\n    void set_dht_storage (dht::dht_storage_constructor_type sc);\n    void add_dht_node (std::pair<std::string, int> const& node);\n    void dht_get_item (sha1_hash const& target);\n    void dht_get_item (std::array<char, 32> key\n       , std::string salt = std::string());\n    sha1_hash dht_put_item (entry data);\n    void dht_put_item (std::array<char, 32> key\n       , std::function<void(entry&, std::array<char, 64>&\n       , std::int64_t&, std::string const&)> cb\n       , std::string salt = std::string());\n-   void dht_get_peers (sha1_hash const& info_hash);\n    void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n+   void dht_get_peers (sha1_hash const& info_hash);\n    void dht_live_nodes (sha1_hash const& nid);\n    void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n    void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n    void add_extension (std::shared_ptr<plugin> ext);\n    void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n       torrent_handle const&, client_data_t)> ext);\n-   ip_filter get_ip_filter () const;\n    void set_ip_filter (ip_filter f);\n+   ip_filter get_ip_filter () const;\n    void set_port_filter (port_filter const& f);\n    unsigned short listen_port () const;\n-   unsigned short ssl_listen_port () const;\n    bool is_listening () const;\n+   unsigned short ssl_listen_port () const;\n    ip_filter get_peer_class_filter () const;\n    void set_peer_class_filter (ip_filter const& f);\n    void set_peer_class_type_filter (peer_class_type_filter const& f);\n    peer_class_type_filter get_peer_class_type_filter () const;\n    peer_class_t create_peer_class (char const* name);\n    void delete_peer_class (peer_class_t cid);\n    peer_class_info get_peer_class (peer_class_t cid) const;\n    void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n    void remove_torrent (const torrent_handle&, remove_flags_t = {});\n+   settings_pack get_settings () const;\n    void apply_settings (settings_pack const&);\n    void apply_settings (settings_pack&&);\n-   settings_pack get_settings () const;\n+   alert* wait_for_alert (time_duration max_wait);\n    void pop_alerts (std::vector<alert*>* alerts);\n    void set_alert_notify (std::function<void()> const& fun);\n-   alert* wait_for_alert (time_duration max_wait);\n-   void delete_port_mapping (port_mapping_t handle);\n    std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);\n+   void delete_port_mapping (port_mapping_t handle);\n    void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\n    std::shared_ptr<aux::session_impl> native_handle () const;\n \n    static constexpr save_state_flags_t save_settings  = 0_bit;\n    static constexpr save_state_flags_t save_dht_state  = 2_bit;\n    static constexpr save_state_flags_t save_extension_state  = 11_bit;\n    static constexpr save_state_flags_t save_ip_filter  = 12_bit;\n@@ -9631,15 +10077,15 @@\n    static constexpr remove_flags_t delete_partfile  = 1_bit;\n    static constexpr session_flags_t paused  = 2_bit;\n    static constexpr portmap_protocol udp  = portmap_protocol::udp;\n    static constexpr portmap_protocol tcp  = portmap_protocol::tcp;\n    static constexpr reopen_network_flags_t reopen_map_ports  = 0_bit;\n };\n 
\n-[report issue]
\n+[report issue]
\n

is_valid()

\n
\n bool is_valid () const;\n 
\n

returns true if this handle refers to a valid session object. If the\n session has been destroyed, all session_handle objects will expire and\n not be valid.

\n@@ -9652,18 +10098,18 @@\n

returns the current session state. This can be passed to\n write_session_params() to save the state to disk and restored using\n read_session_params() when constructing a new session. The kind of\n state that's included is all settings, the DHT routing table, possibly\n plugin-specific state.\n the flags parameter can be used to only save certain parts of the\n session state

\n-\n-[report issue]
\n-
\n-

get_torrent_status() refresh_torrent_status()

\n+\n+[report issue]
\n+
\n+

refresh_torrent_status() get_torrent_status()

\n
\n void refresh_torrent_status (std::vector<torrent_status>* ret\n       , status_flags_t flags = {}) const;\n std::vector<torrent_status> get_torrent_status (\n       std::function<bool(torrent_status const&)> const& pred\n       , status_flags_t flags = {}) const;\n 
\n@@ -9755,25 +10201,25 @@\n case there is such a torrent in the session, a torrent_handle to that\n torrent is returned. In case the torrent cannot be found, an invalid\n torrent_handle is returned.

\n

See torrent_handle::is_valid() to know if the torrent was found or\n not.

\n

get_torrents() returns a vector of torrent_handles to all the\n torrents currently in the session.

\n-\n-[report issue]
\n-
\n-

add_torrent() async_add_torrent()

\n+\n+[report issue]
\n+
\n+

async_add_torrent() add_torrent()

\n
\n-torrent_handle add_torrent (add_torrent_params const& params);\n-torrent_handle add_torrent (add_torrent_params&& params);\n void async_add_torrent (add_torrent_params&& params);\n-torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n+torrent_handle add_torrent (add_torrent_params const& params);\n torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n void async_add_torrent (add_torrent_params const& params);\n+torrent_handle add_torrent (add_torrent_params&& params);\n+torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n 
\n

You add torrents through the add_torrent() function where you give an\n object with all the parameters. The add_torrent() overloads will block\n until the torrent has been added (or failed to be added) and returns\n an error code and a torrent_handle. In order to add torrents more\n efficiently, consider using async_add_torrent() which returns\n immediately, without waiting for the torrent to add. Notification of\n@@ -9794,22 +10240,22 @@\n torrent_flags::auto_managed. In order to add a magnet link that will\n just download the metadata, but no payload, set the\n torrent_flags::upload_mode flag.

\n

Special consideration has to be taken when adding hybrid torrents\n (i.e. torrents that are BitTorrent v2 torrents that are backwards\n compatible with v1). For more details, see BitTorrent v2 torrents.

\n \n-\n-[report issue]
\n-
\n-

resume() is_paused() pause()

\n+\n+[report issue]
\n+
\n+

resume() pause() is_paused()

\n
\n bool is_paused () const;\n-void resume ();\n void pause ();\n+void resume ();\n 
\n

Pausing the session has the same effect as pausing every torrent in\n it, except that torrents will not be resumed by the auto-manage\n mechanism. Resuming will restore the torrents to their previous paused\n state. i.e. the session pause state is separate from the torrent pause\n state. A torrent is inactive if it is paused or if the session is\n paused.

\n@@ -9917,21 +10363,21 @@\n with the function object's context and make the function entirely\n self-contained. The only reason data blob's value is computed\n via a function instead of just passing in the new value is to avoid\n race conditions. If you want to update the value in the DHT, you\n must first retrieve it, then modify it, then write it back. The way\n the DHT works, it is natural to always do a lookup before storing and\n calling the callback in between is convenient.

\n-\n-[report issue]
\n-
\n-

dht_announce() dht_get_peers()

\n+\n+[report issue]
\n+
\n+

dht_get_peers() dht_announce()

\n
\n-void dht_get_peers (sha1_hash const& info_hash);\n void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n+void dht_get_peers (sha1_hash const& info_hash);\n 
\n

dht_get_peers() will issue a DHT get_peer request to the DHT for the\n specified info-hash. The response (the peers) will be posted back in a\n dht_get_peers_reply_alert.

\n

dht_announce() will issue a DHT announce request to the DHT to the\n specified info-hash, advertising the specified port. If the port is\n left at its default, 0, the port will be implied by the DHT message's\n@@ -10018,16 +10464,16 @@\n ses.add_extension(&lt::create_smart_ban_plugin);\n \n \n [report issue]

\n
\n

get_ip_filter() set_ip_filter()

\n
\n-ip_filter get_ip_filter () const;\n void set_ip_filter (ip_filter f);\n+ip_filter get_ip_filter () const;\n 
\n

Sets a filter that will be used to reject and accept incoming as well\n as outgoing connections based on their originating ip address. The\n default filter will allow connections to any ip address. To build a\n set of rules for which addresses are accepted and not, see ip_filter.

\n

Each time a peer is blocked because of the IP filter, a\n peer_blocked_alert is generated. get_ip_filter() Returns the\n@@ -10038,34 +10484,34 @@\n

\n void set_port_filter (port_filter const& f);\n 
\n

apply port_filter f to incoming and outgoing peers. a port filter\n will reject making outgoing peer connections to certain remote ports.\n The main intention is to be able to avoid triggering certain\n anti-virus software by connecting to SMTP, FTP ports.

\n-\n \n-[report issue]
\n-
\n-

is_listening() listen_port() ssl_listen_port()

\n+\n+[report issue]
\n+
\n+

listen_port() ssl_listen_port() is_listening()

\n
\n unsigned short listen_port () const;\n-unsigned short ssl_listen_port () const;\n bool is_listening () const;\n+unsigned short ssl_listen_port () const;\n 
\n

is_listening() will tell you whether or not the session has\n successfully opened a listening port. If it hasn't, this function will\n return false, and then you can set a new\n settings_pack::listen_interfaces to try another interface and port to\n bind to.

\n

listen_port() returns the port we ended up listening on.

\n-\n-[report issue]
\n-
\n-

set_peer_class_filter() get_peer_class_filter()

\n+\n+[report issue]
\n+
\n+

get_peer_class_filter() set_peer_class_filter()

\n
\n ip_filter get_peer_class_filter () const;\n void set_peer_class_filter (ip_filter const& f);\n 
\n

Sets the peer class filter for this session. All new peer connections\n will take this into account and be added to the peer classes specified\n by this filter, based on the peer's IP address.

\n@@ -10195,35 +10641,35 @@\n handle.save_resume_data();\n

Note that when a queued or downloading torrent is removed, its position\n in the download queue is vacated and every subsequent torrent in the\n queue has their queue positions updated. This can potentially cause a\n large state_update to be posted. When removing all torrents, it is\n advised to remove them from the back of the queue, to minimize the\n shifting.

\n-\n-[report issue]
\n-
\n-

get_settings() apply_settings()

\n+\n+[report issue]
\n+
\n+

apply_settings() get_settings()

\n
\n+settings_pack get_settings () const;\n void apply_settings (settings_pack const&);\n void apply_settings (settings_pack&&);\n-settings_pack get_settings () const;\n 
\n

Applies the settings specified by the settings_pack s. This is an\n asynchronous operation that will return immediately and actually apply\n the settings to the main thread of libtorrent some time later.

\n \n-\n-[report issue]
\n-
\n-

pop_alerts() set_alert_notify() wait_for_alert()

\n+\n+[report issue]
\n+
\n+

pop_alerts() wait_for_alert() set_alert_notify()

\n
\n+alert* wait_for_alert (time_duration max_wait);\n void pop_alerts (std::vector<alert*>* alerts);\n void set_alert_notify (std::function<void()> const& fun);\n-alert* wait_for_alert (time_duration max_wait);\n 
\n

Alerts is the main mechanism for libtorrent to report errors and\n events. pop_alerts fills in the vector passed to it with pointers\n to new alerts. The session still owns these alerts and they will stay\n valid until the next time pop_alerts is called. You may not delete\n the alert objects.

\n

It is safe to call pop_alerts from multiple different threads, as\n@@ -10269,21 +10715,21 @@\n message to an HWND or some other main message pump. The actual\n retrieval of alerts should not be done in the callback. In fact, the\n callback should not block. It should not perform any expensive work.\n It really should just notify the main application thread.

\n

The type of an alert is returned by the polymorphic function\n alert::type() but can also be queries from a concrete type via\n T::alert_type, as a static constant.

\n-\n-[report issue]
\n-
\n-

delete_port_mapping() add_port_mapping()

\n+\n+[report issue]
\n+
\n+

add_port_mapping() delete_port_mapping()

\n
\n-void delete_port_mapping (port_mapping_t handle);\n std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);\n+void delete_port_mapping (port_mapping_t handle);\n 
\n

add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n whichever is enabled. A mapping is created for each listen socket\n in the session. The return values are all handles referring to the\n port mappings that were just created. Pass them to delete_port_mapping()\n to remove them.

\n [report issue]
\n@@ -10349,59 +10795,198 @@\n [report issue]
\n
reopen_map_ports
\n
This option indicates if the ports are mapped using natpmp\n and upnp. If mapping was already made, they are deleted and added\n again. This only works if natpmp and/or upnp are configured to be\n enable.
\n
\n+[report issue]
\n+
\n+
\n+

session_proxy

\n+

Declared in "libtorrent/session.hpp"

\n+

this is a holder for the internal session implementation object. Once the\n+session destruction is explicitly initiated, this holder is used to\n+synchronize the completion of the shutdown. The lifetime of this object\n+may outlive session, causing the session destructor to not block. The\n+session_proxy destructor will block however, until the underlying session\n+is done shutting down.

\n+
\n+struct session_proxy\n+{\n+   session_proxy (session_proxy&&) noexcept;\n+   session_proxy (session_proxy const&);\n+   session_proxy& operator= (session_proxy const&) &;\n+   session_proxy& operator= (session_proxy&&) & noexcept;\n+   session_proxy ();\n+   ~session_proxy ();\n+};\n+
\n+\n+\n+[report issue]
\n+

session_proxy() ~session_proxy() operator=()

\n+
\n+session_proxy (session_proxy&&) noexcept;\n+session_proxy (session_proxy const&);\n+session_proxy& operator= (session_proxy const&) &;\n+session_proxy& operator= (session_proxy&&) & noexcept;\n+session_proxy ();\n+~session_proxy ();\n+
\n+

default constructor, does not refer to any session\n+implementation object.

\n+[report issue]
\n+
\n+
\n+

session

\n+

Declared in "libtorrent/session.hpp"

\n+

The session holds all state that spans multiple torrents. Among other\n+things it runs the network loop and manages all torrents. Once it's\n+created, the session object will spawn the main thread that will do all\n+the work. The main thread will be idle as long it doesn't have any\n+torrents to participate in.

\n+

You have some control over session configuration through the\n+session_handle::apply_settings() member function. To change one or more\n+configuration options, create a settings_pack. object and fill it with\n+the settings to be set and pass it in to session::apply_settings().

\n+

see apply_settings().

\n+
\n+struct session : session_handle\n+{\n+   explicit session (session_params&& params);\n+   session ();\n+   session (session_params const& params, session_flags_t flags);\n+   explicit session (session_params const& params);\n+   session (session_params&& params, session_flags_t flags);\n+   session (session_params&& params, io_context& ios);\n+   session (session_params&& params, io_context& ios, session_flags_t);\n+   session (session_params const& params, io_context& ios);\n+   session (session_params const& params, io_context& ios, session_flags_t);\n+   ~session ();\n+   session_proxy abort ();\n+};\n+
\n+[report issue]
\n+

session()

\n+
\n+explicit session (session_params&& params);\n+session ();\n+session (session_params const& params, session_flags_t flags);\n+explicit session (session_params const& params);\n+session (session_params&& params, session_flags_t flags);\n+
\n+

Constructs the session objects which acts as the container of torrents.\n+In order to avoid a race condition between starting the session and\n+configuring it, you can pass in a session_params object. Its settings\n+will take effect before the session starts up.

\n+

The overloads taking flags can be used to start a session in\n+paused mode (by passing in session::paused). Note that\n+add_default_plugins do not have an affect on constructors that\n+take a session_params object. It already contains the plugins to use.

\n+[report issue]
\n+
\n+

session()

\n+
\n+session (session_params&& params, io_context& ios);\n+session (session_params&& params, io_context& ios, session_flags_t);\n+session (session_params const& params, io_context& ios);\n+session (session_params const& params, io_context& ios, session_flags_t);\n+
\n+

Overload of the constructor that takes an external io_context to run\n+the session object on. This is primarily useful for tests that may want\n+to run multiple sessions on a single io_context, or low resource\n+systems where additional threads are expensive and sharing an\n+io_context with other events is fine.

\n+
\n+

Warning

\n+

The session object does not cleanly terminate with an external\n+io_context. The io_context::run() call must have returned\n+before it's safe to destruct the session. Which means you MUST\n+call session::abort() and save the session_proxy first, then\n+destruct the session object, then sync with the io_context, then\n+destruct the session_proxy object.

\n+
\n+[report issue]
\n+
\n+

~session()

\n+
\n+~session ();\n+
\n+

The destructor of session will notify all trackers that our torrents\n+have been shut down. If some trackers are down, they will time out.\n+All this before the destructor of session returns. So, it's advised\n+that any kind of interface (such as windows) are closed before\n+destructing the session object. Because it can take a few second for\n+it to finish. The timeout can be set with apply_settings().

\n+[report issue]
\n+
\n+

abort()

\n+
\n+session_proxy abort ();\n+
\n+

In case you want to destruct the session asynchronously, you can\n+request a session destruction proxy. If you don't do this, the\n+destructor of the session object will block while the trackers are\n+contacted. If you keep one session_proxy to the session when\n+destructing it, the destructor will not block, but start to close down\n+the session, the destructor of the proxy will then synchronize the\n+threads. So, the destruction of the session is performed from the\n+session destructor call until the session_proxy destructor\n+call. The session_proxy does not have any operations on it (since\n+the session is being closed down, no operations are allowed on it).\n+The only valid operation is calling the destructor:

\n+
\n+struct session_proxy {};\n+
\n [report issue]
\n
\n
\n

session_params

\n

Declared in "libtorrent/session_params.hpp"

\n

The session_params is a parameters pack for configuring the session\n before it's started.

\n
\n struct session_params\n {\n-   session_params (settings_pack const& sp);\n-   session_params ();\n    session_params (settings_pack&& sp);\n-   session_params (settings_pack&& sp\n-      , std::vector<std::shared_ptr<plugin>> exts);\n+   session_params ();\n+   session_params (settings_pack const& sp);\n    session_params (settings_pack const& sp\n       , std::vector<std::shared_ptr<plugin>> exts);\n+   session_params (settings_pack&& sp\n+      , std::vector<std::shared_ptr<plugin>> exts);\n \n    settings_pack settings;\n    std::vector<std::shared_ptr<plugin>> extensions;\n    dht::dht_state dht_state;\n    dht::dht_storage_constructor_type dht_storage_constructor;\n    disk_io_constructor_type disk_io_constructor;\n    std::map<std::string, std::string> ext_state;\n    libtorrent::ip_filter ip_filter;\n };\n 
\n [report issue]
\n

session_params()

\n
\n-session_params (settings_pack const& sp);\n-session_params ();\n session_params (settings_pack&& sp);\n+session_params ();\n+session_params (settings_pack const& sp);\n 
\n

This constructor can be used to start with the default plugins\n (ut_metadata, ut_pex and smart_ban). Pass a settings_pack to set the\n initial settings when the session starts.

\n [report issue]
\n
\n

session_params()

\n
\n-session_params (settings_pack&& sp\n-      , std::vector<std::shared_ptr<plugin>> exts);\n session_params (settings_pack const& sp\n       , std::vector<std::shared_ptr<plugin>> exts);\n+session_params (settings_pack&& sp\n+      , std::vector<std::shared_ptr<plugin>> exts);\n 
\n

This constructor helps to configure the set of initial plugins\n to be added to the session before it's started.

\n [report issue]
\n
settings
\n
The settings to configure the session with
\n
\n@@ -10429,2092 +11014,42 @@\n sessions, using read_session_params() and write_session_params().\n
\n [report issue]
\n
ip_filter
\n
the IP filter to use for the session. This restricts which peers are allowed\n to connect. As if passed to set_ip_filter().
\n
\n+\n \n-\n-[report issue]
\n+[report issue]
\n \n-
\n-

write_session_params_buf() read_session_params() write_session_params()

\n+
\n+

write_session_params() write_session_params_buf() read_session_params()

\n

Declared in "libtorrent/session_params.hpp"

\n
\n entry write_session_params (session_params const& sp\n    , save_state_flags_t flags = save_state_flags_t::all());\n-std::vector<char> write_session_params_buf (session_params const& sp\n-   , save_state_flags_t flags = save_state_flags_t::all());\n session_params read_session_params (span<char const> buf\n    , save_state_flags_t flags = save_state_flags_t::all());\n+std::vector<char> write_session_params_buf (session_params const& sp\n+   , save_state_flags_t flags = save_state_flags_t::all());\n session_params read_session_params (bdecode_node const& e\n    , save_state_flags_t flags = save_state_flags_t::all());\n 
\n

These functions serialize and de-serialize a session_params object to and\n from bencoded form. The session_params object is used to initialize a new\n session using the state from a previous one (or by programmatically configure\n the session up-front).\n The flags parameter can be used to only save and load certain aspects of the\n session's state.\n The _buf suffix indicates the function operates on buffer rather than the\n bencoded structure.\n The torrents in a session are not part of the session_params state, they have\n to be restored separately.

\n-[report issue]
\n-
\n-

peer_info

\n-

Declared in "libtorrent/peer_info.hpp"

\n-

holds information and statistics about one peer\n-that libtorrent is connected to

\n-
\n-struct peer_info\n-{\n-   std::string client;\n-   typed_bitfield<piece_index_t> pieces;\n-   std::int64_t total_download;\n-   std::int64_t total_upload;\n-   time_duration last_request;\n-   time_duration last_active;\n-   time_duration download_queue_time;\n-   static constexpr peer_flags_t interesting  = 0_bit;\n-   static constexpr peer_flags_t choked  = 1_bit;\n-   static constexpr peer_flags_t remote_interested  = 2_bit;\n-   static constexpr peer_flags_t remote_choked  = 3_bit;\n-   static constexpr peer_flags_t supports_extensions  = 4_bit;\n-   static constexpr peer_flags_t outgoing_connection  = 5_bit;\n-   static constexpr peer_flags_t local_connection  = 5_bit;\n-   static constexpr peer_flags_t handshake  = 6_bit;\n-   static constexpr peer_flags_t connecting  = 7_bit;\n-   static constexpr peer_flags_t on_parole  = 9_bit;\n-   static constexpr peer_flags_t seed  = 10_bit;\n-   static constexpr peer_flags_t optimistic_unchoke  = 11_bit;\n-   static constexpr peer_flags_t snubbed  = 12_bit;\n-   static constexpr peer_flags_t upload_only  = 13_bit;\n-   static constexpr peer_flags_t endgame_mode  = 14_bit;\n-   static constexpr peer_flags_t holepunched  = 15_bit;\n-   static constexpr peer_flags_t i2p_socket  = 16_bit;\n-   static constexpr peer_flags_t utp_socket  = 17_bit;\n-   static constexpr peer_flags_t ssl_socket  = 18_bit;\n-   static constexpr peer_flags_t rc4_encrypted  = 19_bit;\n-   static constexpr peer_flags_t plaintext_encrypted  = 20_bit;\n-   peer_flags_t flags;\n-   static constexpr peer_source_flags_t tracker  = 0_bit;\n-   static constexpr peer_source_flags_t dht  = 1_bit;\n-   static constexpr peer_source_flags_t pex  = 2_bit;\n-   static constexpr peer_source_flags_t lsd  = 3_bit;\n-   static constexpr peer_source_flags_t resume_data  = 4_bit;\n-   static constexpr peer_source_flags_t incoming  = 5_bit;\n-   peer_source_flags_t source;\n-   int up_speed;\n-   int down_speed;\n-   int payload_up_speed;\n-   int payload_down_speed;\n-   peer_id pid;\n-   int queue_bytes;\n-   int request_timeout;\n-   int send_buffer_size;\n-   int used_send_buffer;\n-   int receive_buffer_size;\n-   int used_receive_buffer;\n-   int receive_buffer_watermark;\n-   int num_hashfails;\n-   int download_queue_length;\n-   int timed_out_requests;\n-   int busy_requests;\n-   int requests_in_buffer;\n-   int target_dl_queue_length;\n-   int upload_queue_length;\n-   int failcount;\n-   piece_index_t downloading_piece_index;\n-   int downloading_block_index;\n-   int downloading_progress;\n-   int downloading_total;\n-   static constexpr connection_type_t standard_bittorrent  = 0_bit;\n-   static constexpr connection_type_t web_seed  = 1_bit;\n-   static constexpr connection_type_t http_seed  = 2_bit;\n-   connection_type_t connection_type;\n-   int pending_disk_bytes;\n-   int pending_disk_read_bytes;\n-   int send_quota;\n-   int receive_quota;\n-   int rtt;\n-   int num_pieces;\n-   int download_rate_peak;\n-   int upload_rate_peak;\n-   float progress;\n-   int progress_ppm;\n-   tcp::endpoint ip;\n-   tcp::endpoint local_endpoint;\n-   static constexpr bandwidth_state_flags_t bw_idle  = 0_bit;\n-   static constexpr bandwidth_state_flags_t bw_limit  = 1_bit;\n-   static constexpr bandwidth_state_flags_t bw_network  = 2_bit;\n-   static constexpr bandwidth_state_flags_t bw_disk  = 4_bit;\n-   bandwidth_state_flags_t read_state;\n-   bandwidth_state_flags_t write_state;\n-};\n-
\n-[report issue]
\n-
client
\n-
A human readable string describing the software at the other end of\n-the connection. In some cases this information is not available, then\n-it will contain a string that may give away something about which\n-software is running in the other end. In the case of a web seed, the\n-server type and version will be a part of this string. This is UTF-8\n-encoded.
\n-
\n-[report issue]
\n-
pieces
\n-
a bitfield, with one bit per piece in the torrent. Each bit tells you\n-if the peer has that piece (if it's set to 1) or if the peer miss that\n-piece (set to 0).
\n-
\n-\n-[report issue]
\n-
total_download total_upload
\n-
the total number of bytes downloaded from and uploaded to this peer.\n-These numbers do not include the protocol chatter, but only the\n-payload data.
\n-
\n-\n-[report issue]
\n-
last_request last_active
\n-
the time since we last sent a request to this peer and since any\n-transfer occurred with this peer
\n-
\n-[report issue]
\n-
download_queue_time
\n-
the time until all blocks in the request queue will be downloaded
\n-
\n-[report issue]
\n-
interesting
\n-
we are interested in pieces from this peer.
\n-
\n-[report issue]
\n-
choked
\n-
we have choked this peer.
\n-
\n-[report issue]
\n-
remote_interested
\n-
the peer is interested in us
\n-
\n-[report issue]
\n-
remote_choked
\n-
the peer has choked us.
\n-
\n-[report issue]
\n-
supports_extensions
\n-
means that this peer supports the\n-extension protocol.
\n-
\n-[report issue]
\n-
outgoing_connection
\n-
The connection was initiated by us, the peer has a\n-listen port open, and that port is the same as in the\n-address of this peer. If this flag is not set, this\n-peer connection was opened by this peer connecting to\n-us.
\n-
\n-[report issue]
\n-
local_connection
\n-
deprecated synonym for outgoing_connection
\n-
\n-[report issue]
\n-
handshake
\n-
The connection is opened, and waiting for the\n-handshake. Until the handshake is done, the peer\n-cannot be identified.
\n-
\n-[report issue]
\n-
connecting
\n-
The connection is in a half-open state (i.e. it is\n-being connected).
\n-
\n-[report issue]
\n-
on_parole
\n-
The peer has participated in a piece that failed the\n-hash check, and is now "on parole", which means we're\n-only requesting whole pieces from this peer until\n-it either fails that piece or proves that it doesn't\n-send bad data.
\n-
\n-[report issue]
\n-
seed
\n-
This peer is a seed (it has all the pieces).
\n-
\n-[report issue]
\n-
optimistic_unchoke
\n-
This peer is subject to an optimistic unchoke. It has\n-been unchoked for a while to see if it might unchoke\n-us in return an earn an upload/unchoke slot. If it\n-doesn't within some period of time, it will be choked\n-and another peer will be optimistically unchoked.
\n-
\n-[report issue]
\n-
snubbed
\n-
This peer has recently failed to send a block within\n-the request timeout from when the request was sent.\n-We're currently picking one block at a time from this\n-peer.
\n-
\n-[report issue]
\n-
upload_only
\n-
This peer has either explicitly (with an extension)\n-or implicitly (by becoming a seed) told us that it\n-will not downloading anything more, regardless of\n-which pieces we have.
\n-
\n-[report issue]
\n-
endgame_mode
\n-
This means the last time this peer picket a piece,\n-it could not pick as many as it wanted because there\n-were not enough free ones. i.e. all pieces this peer\n-has were already requested from other peers.
\n-
\n-[report issue]
\n-
holepunched
\n-
This flag is set if the peer was in holepunch mode\n-when the connection succeeded. This typically only\n-happens if both peers are behind a NAT and the peers\n-connect via the NAT holepunch mechanism.
\n-
\n-[report issue]
\n-
i2p_socket
\n-
indicates that this socket is running on top of the\n-I2P transport.
\n-
\n-[report issue]
\n-
utp_socket
\n-
indicates that this socket is a uTP socket
\n-
\n-[report issue]
\n-
ssl_socket
\n-
indicates that this socket is running on top of an SSL\n-(TLS) channel
\n-
\n-[report issue]
\n-
rc4_encrypted
\n-
this connection is obfuscated with RC4
\n-
\n-[report issue]
\n-
plaintext_encrypted
\n-
the handshake of this connection was obfuscated\n-with a Diffie-Hellman exchange
\n-
\n-[report issue]
\n-
flags
\n-
tells you in which state the peer is in. It is set to\n-any combination of the peer_flags_t flags above.
\n-
\n-[report issue]
\n-
tracker
\n-
The peer was received from the tracker.
\n-
\n-[report issue]
\n-
dht
\n-
The peer was received from the kademlia DHT.
\n-
\n-[report issue]
\n-
pex
\n-
The peer was received from the peer exchange\n-extension.
\n-
\n-[report issue]
\n-
lsd
\n-
The peer was received from the local service\n-discovery (The peer is on the local network).
\n-
\n-[report issue]
\n-
resume_data
\n-
The peer was added from the fast resume data.
\n-
\n-[report issue]
\n-
incoming
\n-
we received an incoming connection from this peer
\n-
\n-[report issue]
\n-
source
\n-
a combination of flags describing from which sources this peer\n-was received. A combination of the peer_source_flags_t above.
\n-
\n-\n-[report issue]
\n-
up_speed down_speed
\n-
the current upload and download speed we have to and from this peer\n-(including any protocol messages). updated about once per second
\n-
\n-\n-[report issue]
\n-
payload_up_speed payload_down_speed
\n-
The transfer rates of payload data only updated about once per second
\n-
\n-[report issue]
\n-
pid
\n-
the peer's id as used in the bit torrent protocol. This id can be used\n-to extract 'fingerprints' from the peer. Sometimes it can tell you\n-which client the peer is using. See identify_client()_
\n-
\n-[report issue]
\n-
queue_bytes
\n-
the number of bytes we have requested from this peer, but not yet\n-received.
\n-
\n-[report issue]
\n-
request_timeout
\n-
the number of seconds until the current front piece request will time\n-out. This timeout can be adjusted through\n-settings_pack::request_timeout.\n--1 means that there is not outstanding request.
\n-
\n-\n-[report issue]
\n-
send_buffer_size used_send_buffer
\n-
the number of bytes allocated\n-and used for the peer's send buffer, respectively.
\n-
\n-\n-\n-[report issue]
\n-
receive_buffer_size used_receive_buffer receive_buffer_watermark
\n-
the number of bytes\n-allocated and used as receive buffer, respectively.
\n-
\n-[report issue]
\n-
num_hashfails
\n-
the number of pieces this peer has participated in sending us that\n-turned out to fail the hash check.
\n-
\n-[report issue]
\n-
download_queue_length
\n-
this is the number of requests we have sent to this peer that we\n-haven't got a response for yet
\n-
\n-[report issue]
\n-
timed_out_requests
\n-
the number of block requests that have timed out, and are still in the\n-download queue
\n-
\n-[report issue]
\n-
busy_requests
\n-
the number of busy requests in the download queue. A busy request is a\n-request for a block we've also requested from a different peer
\n-
\n-[report issue]
\n-
requests_in_buffer
\n-
the number of requests messages that are currently in the send buffer\n-waiting to be sent.
\n-
\n-[report issue]
\n-
target_dl_queue_length
\n-
the number of requests that is tried to be maintained (this is\n-typically a function of download speed)
\n-
\n-[report issue]
\n-
upload_queue_length
\n-
the number of piece-requests we have received from this peer\n-that we haven't answered with a piece yet.
\n-
\n-[report issue]
\n-
failcount
\n-
the number of times this peer has "failed". i.e. failed to connect or\n-disconnected us. The failcount is decremented when we see this peer in\n-a tracker response or peer exchange message.
\n-
\n-\n-\n-\n-[report issue]
\n-
downloading_piece_index downloading_block_index downloading_progress downloading_total
\n-
You can know which piece, and which part of that piece, that is\n-currently being downloaded from a specific peer by looking at these\n-four members. downloading_piece_index is the index of the piece\n-that is currently being downloaded. This may be set to -1 if there's\n-currently no piece downloading from this peer. If it is >= 0, the\n-other three members are valid. downloading_block_index is the\n-index of the block (or sub-piece) that is being downloaded.\n-downloading_progress is the number of bytes of this block we have\n-received from the peer, and downloading_total is the total number\n-of bytes in this block.
\n-
\n-[report issue]
\n-
standard_bittorrent
\n-
Regular bittorrent connection
\n-
\n-[report issue]
\n-
web_seed
\n-
HTTP connection using the BEP 19 protocol
\n-
\n-[report issue]
\n-
http_seed
\n-
HTTP connection using the BEP 17 protocol
\n-
\n-[report issue]
\n-
connection_type
\n-
the kind of connection this peer uses. See connection_type_t.
\n-
\n-[report issue]
\n-
pending_disk_bytes
\n-
the number of bytes this peer has pending in the disk-io thread.\n-Downloaded and waiting to be written to disk. This is what is capped\n-by settings_pack::max_queued_disk_bytes.
\n-
\n-[report issue]
\n-
pending_disk_read_bytes
\n-
number of outstanding bytes to read\n-from disk
\n-
\n-\n-[report issue]
\n-
send_quota receive_quota
\n-
the number of bytes this peer has been assigned to be allowed to send\n-and receive until it has to request more quota from the bandwidth\n-manager.
\n-
\n-[report issue]
\n-
rtt
\n-
an estimated round trip time to this peer, in milliseconds. It is\n-estimated by timing the TCP connect(). It may be 0 for\n-incoming connections.
\n-
\n-[report issue]
\n-
num_pieces
\n-
the number of pieces this peer has.
\n-
\n-\n-[report issue]
\n-
download_rate_peak upload_rate_peak
\n-
the highest download and upload rates seen on this connection. They\n-are given in bytes per second. This number is reset to 0 on reconnect.
\n-
\n-[report issue]
\n-
progress
\n-
the progress of the peer in the range [0, 1]. This is always 0 when\n-floating point operations are disabled, instead use progress_ppm.
\n-
\n-[report issue]
\n-
progress_ppm
\n-
indicates the download progress of the peer in the range [0, 1000000]\n-(parts per million).
\n-
\n-[report issue]
\n-
ip
\n-
the IP-address to this peer. The type is an asio endpoint. For\n-more info, see the asio documentation.
\n-
\n-[report issue]
\n-
local_endpoint
\n-
the IP and port pair the socket is bound to locally. i.e. the IP\n-address of the interface it's going out over. This may be useful for\n-multi-homed clients with multiple interfaces to the internet.
\n-
\n-[report issue]
\n-
bw_idle
\n-
The peer is not waiting for any external events to\n-send or receive data.
\n-
\n-[report issue]
\n-
bw_limit
\n-
The peer is waiting for the rate limiter.
\n-
\n-[report issue]
\n-
bw_network
\n-
The peer has quota and is currently waiting for a\n-network read or write operation to complete. This is\n-the state all peers are in if there are no bandwidth\n-limits.
\n-
\n-[report issue]
\n-
bw_disk
\n-
The peer is waiting for the disk I/O thread to catch\n-up writing buffers to disk before downloading more.
\n-
\n-\n-[report issue]
\n-
read_state write_state
\n-
bitmasks indicating what state this peer\n-is in with regards to sending and receiving data. The states are\n-defined as independent flags of type bandwidth_state_flags_t, in this\n-class.
\n-
\n-[report issue]
\n-
\n-

peer_request

\n-

Declared in "libtorrent/peer_request.hpp"

\n-

represents a byte range within a piece. Internally this is is used for\n-incoming piece requests.

\n-
\n-struct peer_request\n-{\n-   bool operator== (peer_request const& r) const;\n-\n-   piece_index_t piece;\n-   int start;\n-   int length;\n-};\n-
\n-[report issue]
\n-

operator==()

\n-
\n-bool operator== (peer_request const& r) const;\n-
\n-

returns true if the right hand side peer_request refers to the same\n-range as this does.

\n-[report issue]
\n-
piece
\n-
The index of the piece in which the range starts.
\n-
\n-[report issue]
\n-
start
\n-
The byte offset within that piece where the range starts.
\n-
\n-[report issue]
\n-
length
\n-
The size of the range, in bytes.
\n-
\n-[report issue]
\n-
\n-
\n-

piece_block

\n-

Declared in "libtorrent/piece_block.hpp"

\n-
\n-struct piece_block\n-{\n-   piece_block () = default;\n-   piece_block (piece_index_t p_index, int b_index);\n-   bool operator< (piece_block const& b) const;\n-   bool operator== (piece_block const& b) const;\n-   bool operator!= (piece_block const& b) const;\n-\n-   static const piece_block invalid;\n-   piece_index_t piece_index {0};\n-   int block_index  = 0;\n-};\n-
\n-[report issue]
\n-
\n-

info_hash_t

\n-

Declared in "libtorrent/info_hash.hpp"

\n-

class holding the info-hash of a torrent. It can hold a v1 info-hash\n-(SHA-1) or a v2 info-hash (SHA-256) or both.

\n-
\n-

Note

\n-

If has_v2() is false then the v1 hash might actually be a truncated\n-v2 hash

\n-
\n-
\n-struct info_hash_t\n-{\n-   explicit info_hash_t (sha256_hash h2) noexcept;\n-   info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n-   explicit info_hash_t (sha1_hash h1) noexcept;\n-   info_hash_t () noexcept = default;\n-   bool has_v2 () const;\n-   bool has (protocol_version v) const;\n-   bool has_v1 () const;\n-   sha1_hash get (protocol_version v) const;\n-   sha1_hash get_best () const;\n-   friend bool operator!= (info_hash_t const& lhs, info_hash_t const& rhs);\n-   friend bool operator== (info_hash_t const& lhs, info_hash_t const& rhs) noexcept;\n-   template <typename F> void for_each (F f) const;\n-   bool operator< (info_hash_t const& o) const;\n-   friend std::ostream& operator<< (std::ostream& os, info_hash_t const& ih);\n-\n-   sha1_hash v1;\n-   sha256_hash v2;\n-};\n-
\n-[report issue]
\n-

info_hash_t()

\n-
\n-explicit info_hash_t (sha256_hash h2) noexcept;\n-info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n-explicit info_hash_t (sha1_hash h1) noexcept;\n-info_hash_t () noexcept = default;\n-
\n-

The default constructor creates an object that has neither a v1 or v2\n-hash.

\n-

For backwards compatibility, make it possible to construct directly\n-from a v1 hash. This constructor allows implicit conversion from a\n-v1 hash, but the implicitness is deprecated.

\n-\n-\n-[report issue]
\n-
\n-

has_v1() has_v2() has()

\n-
\n-bool has_v2 () const;\n-bool has (protocol_version v) const;\n-bool has_v1 () const;\n-
\n-

returns true if the corresponding info hash is present in this\n-object.

\n-[report issue]
\n-
\n-

get()

\n-
\n-sha1_hash get (protocol_version v) const;\n-
\n-

returns the has for the specified protocol version

\n-[report issue]
\n-
\n-

get_best()

\n-
\n-sha1_hash get_best () const;\n-
\n-

returns the v2 (truncated) info-hash, if there is one, otherwise\n-returns the v1 info-hash

\n-[report issue]
\n-
\n-

for_each()

\n-
\n-template <typename F> void for_each (F f) const;\n-
\n-

calls the function object f for each hash that is available.\n-starting with v1. The signature of F is:

\n-
\n-void(sha1_hash const&, protocol_version);\n-
\n-[report issue]
\n-
\n-
\n-

truncate_files()

\n-

Declared in "libtorrent/truncate.hpp"

\n-
\n-void truncate_files (file_storage const& fs, std::string const& save_path, storage_error& ec);\n-
\n-

Truncates files larger than specified in the file_storage, saved under\n-the specified save_path.

\n-[report issue]
\n-
\n-

version()

\n-

Declared in "libtorrent/version.hpp"

\n-
\n-char const* version ();\n-
\n-

returns the libtorrent version as string form in this format:\n-"<major>.<minor>.<tiny>.<tag>"

\n-[report issue]
\n-
\n-

make_magnet_uri()

\n-

Declared in "libtorrent/magnet_uri.hpp"

\n-
\n-std::string make_magnet_uri (add_torrent_params const& atp);\n-std::string make_magnet_uri (torrent_info const& info);\n-std::string make_magnet_uri (torrent_handle const& handle);\n-
\n-

Generates a magnet URI from the specified torrent.

\n-

Several fields from the add_torrent_params objects are recorded in the\n-magnet link. In order to not include them, they have to be cleared before\n-calling make_magnet_uri(). These fields are used:

\n-
\n-ti, info_hashes, url_seeds, dht_nodes,\n-file_priorities, trackers, name, peers.
\n-

Depending on what the use case for the resulting magnet link is, clearing\n-peers and dht_nodes is probably a good idea if the add_torrent_params\n-came from a running torrent. Those lists may be long and be ephemeral.

\n-

If none of the info_hashes or ti fields are set, there is not\n-info-hash available, and a magnet link cannot be created. In this case\n-make_magnet_uri() returns an empty string.

\n-

The recommended way to generate a magnet link from a torrent_handle is to\n-call save_resume_data(), which will post a save_resume_data_alert\n-containing an add_torrent_params object. This can then be passed to\n-make_magnet_uri().

\n-

The overload that takes a torrent_handle will make blocking calls to\n-query information about the torrent. If the torrent handle is invalid,\n-an empty string is returned.

\n-

For more information about magnet links, see magnet links.

\n-[report issue]
\n-
\n-

parse_magnet_uri()

\n-

Declared in "libtorrent/magnet_uri.hpp"

\n-
\n-void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec);\n-add_torrent_params parse_magnet_uri (string_view uri);\n-add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\n-
\n-

This function parses out information from the magnet link and populates the\n-add_torrent_params object. The overload that does not take an\n-error_code reference will throw a system_error on error\n-The overload taking an add_torrent_params reference will fill in the\n-fields specified in the magnet URI.

\n-\n-\n-[report issue]
\n-
\n-

load_torrent_buffer() load_torrent_parsed() load_torrent_file()

\n-

Declared in "libtorrent/load_torrent.hpp"

\n-
\n-add_torrent_params load_torrent_file (\n-   std::string const& filename);\n-add_torrent_params load_torrent_parsed (\n-   bdecode_node const& torrent_file);\n-add_torrent_params load_torrent_buffer (\n-   span<char const> buffer, load_torrent_limits const& cfg);\n-add_torrent_params load_torrent_buffer (\n-   span<char const> buffer);\n-add_torrent_params load_torrent_file (\n-   std::string const& filename, load_torrent_limits const& cfg);\n-add_torrent_params load_torrent_parsed (\n-   bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-
\n-

These functions load the content of a .torrent file into an\n-add_torrent_params object.\n-The immutable part of a torrent file (the info-dictionary) is stored in\n-the ti field in the add_torrent_params object (as a torrent_info\n-object).\n-The returned object is suitable to be:

\n-
\n-\n-
\n-[report issue]
\n-
\n-

enum event_t

\n-

Declared in "libtorrent/tracker_manager.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
none0 
completed1 
started2 
stopped3 
paused4 
\n-[report issue]
\n-
\n-

enum connection_type

\n-

Declared in "libtorrent/peer_connection.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
bittorrent0 
url_seed1 
http_seed2 
\n-[report issue]
\n-
\n-

enum protocol_version

\n-

Declared in "libtorrent/info_hash.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
V10The original BitTorrent version, using SHA-1 hashes
V21Version 2 of the BitTorrent protocol, using SHA-256 hashes
NUM2 
\n-[report issue]
\n-
\n-

enum portmap_transport

\n-

Declared in "libtorrent/portmap.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
natpmp0natpmp can be NAT-PMP or PCP
upnp1 
\n-[report issue]
\n-
\n-

enum portmap_protocol

\n-

Declared in "libtorrent/portmap.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
none0 
tcp1 
udp2 
\n-[report issue]
\n-
\n-

enum socket_type_t

\n-

Declared in "libtorrent/socket_type.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
tcp0 
socks51 
http2 
utp3 
i2p4 
tcp_ssl5 
socks5_ssl6 
http_ssl7 
utp_ssl8 
\n-[report issue]
\n-
\n-

torrent_flags_t

\n-

Declared in "libtorrent/torrent_flags.hpp"

\n-
\n-
seed_mode
\n-

If seed_mode is set, libtorrent will assume that all files\n-are present for this torrent and that they all match the hashes in\n-the torrent file. Each time a peer requests to download a block,\n-the piece is verified against the hash, unless it has been verified\n-already. If a hash fails, the torrent will automatically leave the\n-seed mode and recheck all the files. The use case for this mode is\n-if a torrent is created and seeded, or if the user already know\n-that the files are complete, this is a way to avoid the initial\n-file checks, and significantly reduce the startup time.

\n-

Setting seed_mode on a torrent without metadata (a\n-.torrent file) is a no-op and will be ignored.

\n-

It is not possible to set the seed_mode flag on a torrent after it has\n-been added to a session. It is possible to clear it though.

\n-
\n-
\n-
\n-
upload_mode
\n-

If upload_mode is set, the torrent will be initialized in\n-upload-mode, which means it will not make any piece requests. This\n-state is typically entered on disk I/O errors, and if the torrent\n-is also auto managed, it will be taken out of this state\n-periodically (see settings_pack::optimistic_disk_retry).

\n-

This mode can be used to avoid race conditions when\n-adjusting priorities of pieces before allowing the torrent to start\n-downloading.

\n-

If the torrent is auto-managed (auto_managed), the torrent\n-will eventually be taken out of upload-mode, regardless of how it\n-got there. If it's important to manually control when the torrent\n-leaves upload mode, don't make it auto managed.

\n-
\n-
\n-
\n-
share_mode
\n-

determines if the torrent should be added in share mode or not.\n-Share mode indicates that we are not interested in downloading the\n-torrent, but merely want to improve our share ratio (i.e. increase\n-it). A torrent started in share mode will do its best to never\n-download more than it uploads to the swarm. If the swarm does not\n-have enough demand for upload capacity, the torrent will not\n-download anything. This mode is intended to be safe to add any\n-number of torrents to, without manual screening, without the risk\n-of downloading more than is uploaded.

\n-

A torrent in share mode sets the priority to all pieces to 0,\n-except for the pieces that are downloaded, when pieces are decided\n-to be downloaded. This affects the progress bar, which might be set\n-to "100% finished" most of the time. Do not change file or piece\n-priorities for torrents in share mode, it will make it not work.

\n-

The share mode has one setting, the share ratio target, see\n-settings_pack::share_mode_target for more info.

\n-
\n-
\n-
\n-
apply_ip_filter
\n-
determines if the IP filter should apply to this torrent or not. By\n-default all torrents are subject to filtering by the IP filter\n-(i.e. this flag is set by default). This is useful if certain\n-torrents needs to be exempt for some reason, being an auto-update\n-torrent for instance.
\n-
\n-
\n-
paused
\n-
specifies whether or not the torrent is paused. i.e. it won't connect to the tracker or any of the peers\n-until it's resumed. Note that a paused torrent that also has the\n-auto_managed flag set can be started at any time by libtorrent's queuing\n-logic. See queuing.
\n-
\n-
\n-
auto_managed
\n-

If the torrent is auto-managed (auto_managed), the torrent\n-may be resumed at any point, regardless of how it paused. If it's\n-important to manually control when the torrent is paused and\n-resumed, don't make it auto managed.

\n-

If auto_managed is set, the torrent will be queued,\n-started and seeded automatically by libtorrent. When this is set,\n-the torrent should also be started as paused. The default queue\n-order is the order the torrents were added. They are all downloaded\n-in that order. For more details, see queuing.

\n-
\n-
\n-
\n-
duplicate_is_error
\n-
used in add_torrent_params to indicate that it's an error to attempt\n-to add a torrent that's already in the session. If it's not considered an\n-error, a handle to the existing torrent is returned.\n-This flag is not saved by write_resume_data(), since it is only meant for\n-adding torrents.
\n-
\n-
\n-
update_subscribe
\n-
on by default and means that this torrent will be part of state\n-updates when calling post_torrent_updates().\n-This flag is not saved by write_resume_data().
\n-
\n-
\n-
super_seeding
\n-
sets the torrent into super seeding/initial seeding mode. If the torrent\n-is not a seed, this flag has no effect.
\n-
\n-
\n-
sequential_download
\n-
sets the sequential download state for the torrent. In this mode the\n-piece picker will pick pieces with low index numbers before pieces with\n-high indices. The actual pieces that are picked depend on other factors\n-still, such as which pieces a peer has and whether it is in parole mode\n-or "prefer whole pieces"-mode. Sequential mode is not ideal for streaming\n-media. For that, see set_piece_deadline() instead.
\n-
\n-
\n-
stop_when_ready
\n-

When this flag is set, the torrent will force stop whenever it\n-transitions from a non-data-transferring state into a data-transferring\n-state (referred to as being ready to download or seed). This is useful\n-for torrents that should not start downloading or seeding yet, but want\n-to be made ready to do so. A torrent may need to have its files checked\n-for instance, so it needs to be started and possibly queued for checking\n-(auto-managed and started) but as soon as it's done, it should be\n-stopped.

\n-

Force stopped means auto-managed is set to false and it's paused. As\n-if the auto_manages flag is cleared and the paused flag is set on the torrent.

\n-

Note that the torrent may transition into a downloading state while\n-setting this flag, and since the logic is edge triggered you may\n-miss the edge. To avoid this race, if the torrent already is in a\n-downloading state when this call is made, it will trigger the\n-stop-when-ready immediately.

\n-

When the stop-when-ready logic fires, the flag is cleared. Any\n-subsequent transitions between downloading and non-downloading states\n-will not be affected, until this flag is set again.

\n-

The behavior is more robust when setting this flag as part of adding\n-the torrent. See add_torrent_params.

\n-

The stop-when-ready flag fixes the inherent race condition of waiting\n-for the state_changed_alert and then call pause(). The download/seeding\n-will most likely start in between posting the alert and receiving the\n-call to pause.

\n-

A downloading state is one where peers are being connected. Which means\n-just downloading the metadata via the ut_metadata extension counts\n-as a downloading state. In order to stop a torrent once the metadata\n-has been downloaded, instead set all file priorities to dont_download

\n-
\n-
\n-
\n-
override_trackers
\n-
when this flag is set, the tracker list in the add_torrent_params\n-object override any trackers from the torrent file. If the flag is\n-not set, the trackers from the add_torrent_params object will be\n-added to the list of trackers used by the torrent.\n-This flag is set by read_resume_data() if there are trackers present in\n-the resume data file. This effectively makes the trackers saved in the\n-resume data take precedence over the original trackers. This includes if\n-there's an empty list of trackers, to support the case where they were\n-explicitly removed in the previous session.\n-This flag is not saved by write_resume_data()
\n-
\n-
\n-
override_web_seeds
\n-
If this flag is set, the web seeds from the add_torrent_params\n-object will override any web seeds in the torrent file. If it's not\n-set, web seeds in the add_torrent_params object will be added to the\n-list of web seeds used by the torrent.\n-This flag is set by read_resume_data() if there are web seeds present in\n-the resume data file. This effectively makes the web seeds saved in the\n-resume data take precedence over the original ones. This includes if\n-there's an empty list of web seeds, to support the case where they were\n-explicitly removed in the previous session.\n-This flag is not saved by write_resume_data()
\n-
\n-
\n-
need_save_resume
\n-
if this flag is set (which it is by default) the torrent will be\n-considered needing to save its resume data immediately as it's\n-added. New torrents that don't have any resume data should do that.\n-This flag is cleared by a successful call to save_resume_data()\n-This flag is not saved by write_resume_data(), since it represents an\n-ephemeral state of a running torrent.
\n-
\n-
\n-
disable_dht
\n-
set this flag to disable DHT for this torrent. This lets you have the DHT\n-enabled for the whole client, and still have specific torrents not\n-participating in it. i.e. not announcing to the DHT nor picking up peers\n-from it.
\n-
\n-
\n-
disable_lsd
\n-
set this flag to disable local service discovery for this torrent.
\n-
\n-
\n-
disable_pex
\n-
set this flag to disable peer exchange for this torrent.
\n-
\n-
\n-
no_verify_files
\n-
if this flag is set, the resume data will be assumed to be correct\n-without validating it against any files on disk. This may be used when\n-restoring a session by loading resume data from disk. It will save time\n-and also delay any hard disk errors until files are actually needed. If\n-the resume data cannot be trusted, or if a torrent is added for the first\n-time to some save path that may already have some of the files, this flag\n-should not be set.
\n-
\n-
\n-
default_dont_download
\n-
default all file priorities to dont_download. This is useful for adding\n-magnet links where the number of files is unknown, but the\n-file_priorities is still set for some files. Any file not covered by\n-the file_priorities list will be set to normal download priority,\n-unless this flag is set, in which case they will be set to 0\n-(dont_download).
\n-
\n-
\n-
all
\n-
all torrent flags combined. Can conveniently be used when creating masks\n-for flags
\n-
\n-[report issue]
\n-
\n-

int

\n-

Declared in "libtorrent/version.hpp"

\n-
\n-
version_major
\n-
the major, minor and tiny versions of libtorrent
\n-
\n-
\n-
version_minor
\n-
the major, minor and tiny versions of libtorrent
\n-
\n-
\n-
version_tiny
\n-
the major, minor and tiny versions of libtorrent
\n-
\n-[report issue]
\n-
\n-

char const*

\n-

Declared in "libtorrent/version.hpp"

\n-
\n-
version_str
\n-
the libtorrent version in string form
\n-
\n-[report issue]
\n-
\n-

std::uint64_t

\n-

Declared in "libtorrent/version.hpp"

\n-
\n-
version_revision
\n-
the git commit of this libtorrent version
\n-
\n-[report issue]
\n-
\n-

pex_flags_t

\n-

Declared in "libtorrent/pex_flags.hpp"

\n-
\n-
pex_encryption
\n-
the peer supports protocol encryption
\n-
\n-
\n-
pex_seed
\n-
the peer is a seed
\n-
\n-
\n-
pex_utp
\n-
the peer supports the uTP, transport protocol over UDP.
\n-
\n-
\n-
pex_holepunch
\n-
the peer supports the holepunch extension If this flag is received from a\n-peer, it can be used as a rendezvous point in case direct connections to\n-the peer fail
\n-
\n-
\n-
pex_lt_v2
\n-
protocol v2\n-this is not a standard flag, it is only used internally
\n-
\n-[report issue]
\n-
\n-

download_priority_t

\n-

Declared in "libtorrent/download_priority.hpp"

\n-
\n-
dont_download
\n-
Don't download the file or piece. Partial pieces may still be downloaded when\n-setting file priorities.
\n-
\n-
\n-
default_priority
\n-
The default priority for files and pieces.
\n-
\n-
\n-
low_priority
\n-
The lowest priority for files and pieces.
\n-
\n-
\n-
top_priority
\n-
The highest priority for files and pieces.
\n-
\n-[report issue]
\n-
\n-

web_seed_entry

\n-

Declared in "libtorrent/torrent_info.hpp"

\n-

the web_seed_entry holds information about a web seed (also known\n-as URL seed or HTTP seed). It is essentially a URL with some state\n-associated with it. For more information, see BEP 17 and BEP 19.

\n-
\n-struct web_seed_entry\n-{\n-   bool operator== (web_seed_entry const& e) const;\n-   bool operator< (web_seed_entry const& e) const;\n-\n-   enum type_t\n-   {\n-      url_seed,\n-      http_seed,\n-   };\n-\n-   std::string url;\n-   std::string auth;\n-   headers_t extra_headers;\n-   std::uint8_t type;\n-};\n-
\n-[report issue]
\n-

operator==()

\n-
\n-bool operator== (web_seed_entry const& e) const;\n-
\n-

URL and type comparison

\n-[report issue]
\n-
\n-

operator<()

\n-
\n-bool operator< (web_seed_entry const& e) const;\n-
\n-

URL and type less-than comparison

\n-[report issue]
\n-
\n-

enum type_t

\n-

Declared in "libtorrent/torrent_info.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
url_seed0 
http_seed1 
\n-[report issue]
\n-
url
\n-
The URL of the web seed
\n-
\n-[report issue]
\n-
auth
\n-
Optional authentication. If this is set, it's passed\n-in as HTTP basic auth to the web seed. The format is:\n-username:password.
\n-
\n-[report issue]
\n-
extra_headers
\n-
Any extra HTTP headers that need to be passed to the web seed
\n-
\n-[report issue]
\n-
type
\n-
The type of web seed (see type_t)
\n-
\n-[report issue]
\n-
\n-
\n-

load_torrent_limits

\n-

Declared in "libtorrent/torrent_info.hpp"

\n-

this object holds configuration options for limits to use when loading\n-torrents. They are meant to prevent loading potentially malicious torrents\n-that cause excessive memory allocations.

\n-
\n-struct load_torrent_limits\n-{\n-   int max_buffer_size  = 10000000;\n-   int max_pieces  = 0x200000;\n-   int max_decode_depth  = 100;\n-   int max_decode_tokens  = 3000000;\n-};\n-
\n-[report issue]
\n-
max_buffer_size
\n-
the max size of a .torrent file to load into RAM
\n-
\n-[report issue]
\n-
max_pieces
\n-
the max number of pieces allowed in the torrent
\n-
\n-[report issue]
\n-
max_decode_depth
\n-
the max recursion depth in the bdecoded structure
\n-
\n-[report issue]
\n-
max_decode_tokens
\n-
the max number of bdecode tokens
\n-
\n-[report issue]
\n-
\n-

torrent_info

\n-

Declared in "libtorrent/torrent_info.hpp"

\n-

the torrent_info class holds the information found in a .torrent file.

\n-
\n-class torrent_info\n-{\n-   explicit torrent_info (info_hash_t const& info_hash);\n-   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n-   torrent_info (bdecode_node const& torrent_file, error_code& ec);\n-   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n-   torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n-   torrent_info (char const* buffer, int size, error_code& ec);\n-   torrent_info (torrent_info const& t);\n-   torrent_info (std::string const& filename, error_code& ec);\n-   explicit torrent_info (std::string const& filename);\n-   explicit torrent_info (bdecode_node const& torrent_file);\n-   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-   torrent_info (char const* buffer, int size);\n-   explicit torrent_info (span<char const> buffer, from_span_t);\n-   ~torrent_info ();\n-   file_storage const& orig_files () const;\n-   file_storage const& files () const;\n-   void rename_file (file_index_t index, std::string const& new_filename);\n-   void remap_files (file_storage const& f);\n-   void add_tracker (std::string const& url, int tier = 0);\n-   void add_tracker (std::string const& url, int tier\n-      , announce_entry::tracker_source source);\n-   void clear_trackers ();\n-   std::vector<announce_entry> const& trackers () const;\n-   std::vector<sha1_hash> similar_torrents () const;\n-   std::vector<std::string> collections () const;\n-   std::vector<web_seed_entry> const& web_seeds () const;\n-   void set_web_seeds (std::vector<web_seed_entry> seeds);\n-   void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-   void add_http_seed (std::string const& url\n-      , std::string const& extern_auth = std::string()\n-      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n-   std::int64_t total_size () const;\n-   int piece_length () const;\n-   int num_pieces () const;\n-   index_range<piece_index_t> piece_range () const;\n-   piece_index_t last_piece () const;\n-   piece_index_t end_piece () const;\n-   sha1_hash info_hash () const noexcept;\n-   info_hash_t const& info_hashes () const;\n-   bool v2 () const;\n-   bool v1 () const;\n-   int num_files () const;\n-   std::vector<file_slice> map_block (piece_index_t const piece\n-      , std::int64_t offset, int size) const;\n-   peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n-   string_view ssl_cert () const;\n-   bool is_valid () const;\n-   bool priv () const;\n-   bool is_i2p () const;\n-   int piece_size (piece_index_t index) const;\n-   char const* hash_for_piece_ptr (piece_index_t const index) const;\n-   sha1_hash hash_for_piece (piece_index_t index) const;\n-   bool is_loaded () const;\n-   const std::string& name () const;\n-   std::time_t creation_date () const;\n-   const std::string& creator () const;\n-   const std::string& comment () const;\n-   std::vector<std::pair<std::string, int>> const& nodes () const;\n-   void add_node (std::pair<std::string, int> const& node);\n-   bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n-   bdecode_node info (char const* key) const;\n-   span<char const> info_section () const;\n-   span<char const> piece_layer (file_index_t) const;\n-   void free_piece_layers ();\n-};\n-
\n-[report issue]
\n-

torrent_info()

\n-
\n-explicit torrent_info (info_hash_t const& info_hash);\n-torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n-torrent_info (bdecode_node const& torrent_file, error_code& ec);\n-torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n-torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n-torrent_info (char const* buffer, int size, error_code& ec);\n-torrent_info (torrent_info const& t);\n-torrent_info (std::string const& filename, error_code& ec);\n-explicit torrent_info (std::string const& filename);\n-explicit torrent_info (bdecode_node const& torrent_file);\n-torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-torrent_info (char const* buffer, int size);\n-explicit torrent_info (span<char const> buffer, from_span_t);\n-
\n-

The constructor that takes an info-hash will initialize the info-hash\n-to the given value, but leave all other fields empty. This is used\n-internally when downloading torrents without the metadata. The\n-metadata will be created by libtorrent as soon as it has been\n-downloaded from the swarm.

\n-

The constructor that takes a bdecode_node will create a torrent_info\n-object from the information found in the given torrent_file. The\n-bdecode_node represents a tree node in an bencoded file. To load an\n-ordinary .torrent file into a bdecode_node, use bdecode().

\n-

The version that takes a buffer pointer and a size will decode it as a\n-.torrent file and initialize the torrent_info object for you.

\n-

The version that takes a filename will simply load the torrent file\n-and decode it inside the constructor, for convenience. This might not\n-be the most suitable for applications that want to be able to report\n-detailed errors on what might go wrong.

\n-

There is an upper limit on the size of the torrent file that will be\n-loaded by the overload taking a filename. If it's important that even\n-very large torrent files are loaded, use one of the other overloads.

\n-

The overloads that takes an error_code const& never throws if an\n-error occur, they will simply set the error code to describe what went\n-wrong and not fully initialize the torrent_info object. The overloads\n-that do not take the extra error_code parameter will always throw if\n-an error occurs. These overloads are not available when building\n-without exception support.

\n-

The overload that takes a span also needs an extra parameter of\n-type from_span_t to disambiguate the std::string overload for\n-string literals. There is an object in the libtorrent namespace of this\n-type called from_span.

\n-[report issue]
\n-
\n-

~torrent_info()

\n-
\n-~torrent_info ();\n-
\n-

frees all storage associated with this torrent_info object

\n-\n-[report issue]
\n-
\n-

files() orig_files()

\n-
\n-file_storage const& orig_files () const;\n-file_storage const& files () const;\n-
\n-

The file_storage object contains the information on how to map the\n-pieces to files. It is separated from the torrent_info object because\n-when creating torrents a storage object needs to be created without\n-having a torrent file. When renaming files in a storage, the storage\n-needs to make its own copy of the file_storage in order to make its\n-mapping differ from the one in the torrent file.

\n-

orig_files() returns the original (unmodified) file storage for\n-this torrent. This is used by the web server connection, which needs\n-to request files with the original names. Filename may be changed using\n-torrent_info::rename_file().

\n-

For more information on the file_storage object, see the separate\n-document on how to create torrents.

\n-[report issue]
\n-
\n-

rename_file()

\n-
\n-void rename_file (file_index_t index, std::string const& new_filename);\n-
\n-

Renames the file with the specified index to the new name. The new\n-filename is reflected by the file_storage returned by files()\n-but not by the one returned by orig_files().

\n-

If you want to rename the base name of the torrent (for a multi file\n-torrent), you can copy the file_storage (see files() and\n-orig_files() ), change the name, and then use remap_files().

\n-

The new_filename can both be a relative path, in which case the\n-file name is relative to the save_path of the torrent. If the\n-new_filename is an absolute path (i.e. is_complete(new_filename)\n-== true), then the file is detached from the save_path of the\n-torrent. In this case the file is not moved when move_storage() is\n-invoked.

\n-[report issue]
\n-
\n-

remap_files()

\n-
\n-void remap_files (file_storage const& f);\n-
\n-
\n-

Warning

\n-

Using remap_files() is discouraged as it's incompatible with v2\n-torrents. This is because the piece boundaries and piece hashes in\n-v2 torrents are intimately tied to the file boundaries. Instead,\n-just rename individual files, or implement a custom disk_interface\n-to customize how to store files.

\n-
\n-

Remaps the file storage to a new file layout. This can be used to, for\n-instance, download all data in a torrent to a single file, or to a\n-number of fixed size sector aligned files, regardless of the number\n-and sizes of the files in the torrent.

\n-

The new specified file_storage must have the exact same size as\n-the current one.

\n-\n-\n-[report issue]
\n-
\n-

trackers() clear_trackers() add_tracker()

\n-
\n-void add_tracker (std::string const& url, int tier = 0);\n-void add_tracker (std::string const& url, int tier\n-      , announce_entry::tracker_source source);\n-void clear_trackers ();\n-std::vector<announce_entry> const& trackers () const;\n-
\n-

add_tracker() adds a tracker to the announce-list. The tier\n-determines the order in which the trackers are to be tried.\n-The trackers() function will return a sorted vector of\n-announce_entry. Each announce entry contains a string, which is\n-the tracker url, and a tier index. The tier index is the high-level\n-priority. No matter which trackers that works or not, the ones with\n-lower tier will always be tried before the one with higher tier\n-number. For more information, see announce_entry.

\n-

trackers() returns all entries from announce-list.

\n-

clear_trackers() removes all trackers from announce-list.

\n-\n-[report issue]
\n-
\n-

similar_torrents() collections()

\n-
\n-std::vector<sha1_hash> similar_torrents () const;\n-std::vector<std::string> collections () const;\n-
\n-

These two functions are related to BEP 38 (mutable torrents). The\n-vectors returned from these correspond to the "similar" and\n-"collections" keys in the .torrent file. Both info-hashes and\n-collections from within the info-dict and from outside of it are\n-included.

\n-\n-\n-\n-[report issue]
\n-
\n-

add_url_seed() web_seeds() add_http_seed() set_web_seeds()

\n-
\n-std::vector<web_seed_entry> const& web_seeds () const;\n-void set_web_seeds (std::vector<web_seed_entry> seeds);\n-void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-void add_http_seed (std::string const& url\n-      , std::string const& extern_auth = std::string()\n-      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n-
\n-

web_seeds() returns all url seeds and http seeds in the torrent.\n-Each entry is a web_seed_entry and may refer to either a url seed\n-or http seed.

\n-

add_url_seed() and add_http_seed() adds one url to the list of\n-url/http seeds.

\n-

set_web_seeds() replaces all web seeds with the ones specified in\n-the seeds vector.

\n-

The extern_auth argument can be used for other authorization\n-schemes than basic HTTP authorization. If set, it will override any\n-username and password found in the URL itself. The string will be sent\n-as the HTTP authorization header's value (without specifying "Basic").

\n-

The extra_headers argument defaults to an empty list, but can be\n-used to insert custom HTTP headers in the requests to a specific web\n-seed.

\n-

See http seeding for more information.

\n-[report issue]
\n-
\n-

total_size()

\n-
\n-std::int64_t total_size () const;\n-
\n-

total_size() returns the total number of bytes the torrent-file\n-represents. Note that this is the number of pieces times the piece\n-size (modulo the last piece possibly being smaller). With pad files,\n-the total size will be larger than the sum of all (regular) file\n-sizes.

\n-\n-[report issue]
\n-
\n-

piece_length() num_pieces()

\n-
\n-int piece_length () const;\n-int num_pieces () const;\n-
\n-

piece_length() and num_pieces() returns the number of byte\n-for each piece and the total number of pieces, respectively. The\n-difference between piece_size() and piece_length() is that\n-piece_size() takes the piece index as argument and gives you the\n-exact size of that piece. It will always be the same as\n-piece_length() except in the case of the last piece, which may be\n-smaller.

\n-\n-\n-[report issue]
\n-
\n-

piece_range() end_piece() last_piece()

\n-
\n-index_range<piece_index_t> piece_range () const;\n-piece_index_t last_piece () const;\n-piece_index_t end_piece () const;\n-
\n-

last_piece() returns the index to the last piece in the torrent and\n-end_piece() returns the index to the one-past-end piece in the\n-torrent\n-piece_range() returns an implementation-defined type that can be\n-used as the container in a range-for loop. Where the values are the\n-indices of all pieces in the file_storage.

\n-\n-[report issue]
\n-
\n-

info_hashes() info_hash()

\n-
\n-sha1_hash info_hash () const noexcept;\n-info_hash_t const& info_hashes () const;\n-
\n-

returns the info-hash of the torrent. For BitTorrent v2 support, use\n-info_hashes() to get an object that may hold both a v1 and v2\n-info-hash

\n-\n-[report issue]
\n-
\n-

v2() v1()

\n-
\n-bool v2 () const;\n-bool v1 () const;\n-
\n-

returns whether this torrent has v1 and/or v2 metadata, respectively.\n-Hybrid torrents have both. These are shortcuts for\n-info_hashes().has_v1() and info_hashes().has_v2() calls.

\n-[report issue]
\n-
\n-

num_files()

\n-
\n-int num_files () const;\n-
\n-

If you need index-access to files you can use the num_files() along\n-with the file_path(), file_size()-family of functions to access\n-files using indices.

\n-[report issue]
\n-
\n-

map_block()

\n-
\n-std::vector<file_slice> map_block (piece_index_t const piece\n-      , std::int64_t offset, int size) const;\n-
\n-

This function will map a piece index, a byte offset within that piece\n-and a size (in bytes) into the corresponding files with offsets where\n-that data for that piece is supposed to be stored. See file_slice.

\n-[report issue]
\n-
\n-

map_file()

\n-
\n-peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n-
\n-

This function will map a range in a specific file into a range in the\n-torrent. The file_offset parameter is the offset in the file,\n-given in bytes, where 0 is the start of the file. See peer_request.

\n-

The input range is assumed to be valid within the torrent.\n-file_offset + size is not allowed to be greater than the file\n-size. file_index must refer to a valid file, i.e. it cannot be >=\n-num_files().

\n-[report issue]
\n-
\n-

ssl_cert()

\n-
\n-string_view ssl_cert () const;\n-
\n-

Returns the SSL root certificate for the torrent, if it is an SSL\n-torrent. Otherwise returns an empty string. The certificate is\n-the public certificate in x509 format.

\n-[report issue]
\n-
\n-

is_valid()

\n-
\n-bool is_valid () const;\n-
\n-

returns true if this torrent_info object has a torrent loaded.\n-This is primarily used to determine if a magnet link has had its\n-metadata resolved yet or not.

\n-[report issue]
\n-
\n-

priv()

\n-
\n-bool priv () const;\n-
\n-

returns true if this torrent is private. i.e., the client should not\n-advertise itself on the trackerless network (the Kademlia DHT) for this torrent.

\n-[report issue]
\n-
\n-

is_i2p()

\n-
\n-bool is_i2p () const;\n-
\n-

returns true if this is an i2p torrent. This is determined by whether\n-or not it has a tracker whose URL domain name ends with ".i2p". i2p\n-torrents disable the DHT and local peer discovery as well as talking\n-to peers over anything other than the i2p network.

\n-[report issue]
\n-
\n-

piece_size()

\n-
\n-int piece_size (piece_index_t index) const;\n-
\n-

returns the piece size of file with index. This will be the same as piece_length(),\n-except for the last piece, which may be shorter.

\n-\n-[report issue]
\n-
\n-

hash_for_piece_ptr() hash_for_piece()

\n-
\n-char const* hash_for_piece_ptr (piece_index_t const index) const;\n-sha1_hash hash_for_piece (piece_index_t index) const;\n-
\n-

hash_for_piece() takes a piece-index and returns the 20-bytes\n-sha1-hash for that piece and info_hash() returns the 20-bytes\n-sha1-hash for the info-section of the torrent file.\n-hash_for_piece_ptr() returns a pointer to the 20 byte sha1 digest\n-for the piece. Note that the string is not 0-terminated.

\n-[report issue]
\n-
\n-

name()

\n-
\n-const std::string& name () const;\n-
\n-

name() returns the name of the torrent.\n-name contains UTF-8 encoded string.

\n-[report issue]
\n-
\n-

creation_date()

\n-
\n-std::time_t creation_date () const;\n-
\n-

creation_date() returns the creation date of the torrent as time_t\n-(posix time). If there's no time stamp in the torrent file, 0 is\n-returned.\n-.. posix time: http://www.opengroup.org/onlinepubs/009695399/functions/time.html

\n-[report issue]
\n-
\n-

creator()

\n-
\n-const std::string& creator () const;\n-
\n-

creator() returns the creator string in the torrent. If there is\n-no creator string it will return an empty string.

\n-[report issue]
\n-
\n-

comment()

\n-
\n-const std::string& comment () const;\n-
\n-

comment() returns the comment associated with the torrent. If\n-there's no comment, it will return an empty string.\n-comment contains UTF-8 encoded string.

\n-[report issue]
\n-
\n-

nodes()

\n-
\n-std::vector<std::pair<std::string, int>> const& nodes () const;\n-
\n-

If this torrent contains any DHT nodes, they are put in this vector in\n-their original form (host name and port number).

\n-[report issue]
\n-
\n-

add_node()

\n-
\n-void add_node (std::pair<std::string, int> const& node);\n-
\n-

This is used when creating torrent. Use this to add a known DHT node.\n-It may be used, by the client, to bootstrap into the DHT network.

\n-[report issue]
\n-
\n-

parse_info_section()

\n-
\n-bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n-
\n-

populates the torrent_info by providing just the info-dict buffer.\n-This is used when loading a torrent from a magnet link for instance,\n-where we only have the info-dict. The bdecode_node e points to a\n-parsed info-dictionary. ec returns an error code if something\n-fails (typically if the info dictionary is malformed).\n-The max_pieces parameter allows limiting the amount of memory\n-dedicated to loading the torrent, and fails for torrents that exceed\n-the limit. To load large torrents, this limit may also need to be\n-raised in settings_pack::max_piece_count and in calls to\n-read_resume_data().

\n-[report issue]
\n-
\n-

info()

\n-
\n-bdecode_node info (char const* key) const;\n-
\n-

This function looks up keys from the info-dictionary of the loaded\n-torrent file. It can be used to access extension values put in the\n-.torrent file. If the specified key cannot be found, it returns nullptr.

\n-[report issue]
\n-
\n-

info_section()

\n-
\n-span<char const> info_section () const;\n-
\n-

returns a the raw info section of the torrent file.\n-The underlying buffer is still owned by the torrent_info object

\n-[report issue]
\n-
\n-

piece_layer()

\n-
\n-span<char const> piece_layer (file_index_t) const;\n-
\n-

return the bytes of the piece layer hashes for the specified file. If\n-the file doesn't have a piece layer, an empty span is returned.\n-The span size is divisible by 32, the size of a SHA-256 hash.\n-If the size of the file is smaller than or equal to the piece size,\n-the files "root hash" is the hash of the file and is not saved\n-separately in the "piece layers" field, but this function still\n-returns the root hash of the file in that case.

\n-[report issue]
\n-
\n-

free_piece_layers()

\n-
\n-void free_piece_layers ();\n-
\n-

clears the piece layers from the torrent_info. This is done by the\n-session when a torrent is added, to avoid storing it twice. The piece\n-layer (or other hashes part of the merkle tree) are stored in the\n-internal torrent object.

\n-[report issue]
\n-
\n-
\n-

announce_infohash

\n-

Declared in "libtorrent/announce_entry.hpp"

\n-
\n-struct announce_infohash\n-{\n-   std::string message;\n-   error_code last_error;\n-   int scrape_incomplete  = -1;\n-   int scrape_complete  = -1;\n-   int scrape_downloaded  = -1;\n-   std::uint8_t fails : 7;\n-   bool updating : 1;\n-   bool start_sent : 1;\n-   bool complete_sent : 1;\n-};\n-
\n-[report issue]
\n-
message
\n-
if this tracker has returned an error or warning message\n-that message is stored here
\n-
\n-[report issue]
\n-
last_error
\n-
if this tracker failed the last time it was contacted\n-this error code specifies what error occurred
\n-
\n-\n-\n-[report issue]
\n-
scrape_incomplete scrape_complete scrape_downloaded
\n-
if this tracker has returned scrape data, these fields are filled in\n-with valid numbers. Otherwise they are set to -1. incomplete counts\n-the number of current downloaders. complete counts the number of\n-current peers completed the download, or "seeds". downloaded is the\n-cumulative number of completed downloads.
\n-
\n-[report issue]
\n-
fails
\n-
the number of times in a row we have failed to announce to this\n-tracker.
\n-
\n-[report issue]
\n-
updating
\n-
true while we're waiting for a response from the tracker.
\n-
\n-[report issue]
\n-
start_sent
\n-
set to true when we get a valid response from an announce\n-with event=started. If it is set, we won't send start in the subsequent\n-announces.
\n-
\n-[report issue]
\n-
complete_sent
\n-
set to true when we send a event=completed.
\n-
\n-[report issue]
\n-
\n-

announce_endpoint

\n-

Declared in "libtorrent/announce_entry.hpp"

\n-

announces are sent to each tracker using every listen socket\n-this class holds information about one listen socket for one tracker

\n-
\n-struct announce_endpoint\n-{\n-   announce_endpoint ();\n-\n-   tcp::endpoint local_endpoint;\n-   aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;\n-   bool enabled  = true;\n-};\n-
\n-[report issue]
\n-
local_endpoint
\n-
the local endpoint of the listen interface associated with this endpoint
\n-
\n-[report issue]
\n-
info_hashes
\n-
info_hashes[0] is the v1 info hash (SHA1)\n-info_hashes[1] is the v2 info hash (truncated SHA-256)
\n-
\n-[report issue]
\n-
enabled
\n-
set to false to not announce from this endpoint
\n-
\n-[report issue]
\n-
\n-

announce_entry

\n-

Declared in "libtorrent/announce_entry.hpp"

\n-

this class holds information about one bittorrent tracker, as it\n-relates to a specific torrent.

\n-
\n-struct announce_entry\n-{\n-   announce_entry ();\n-   announce_entry& operator= (announce_entry const&) &;\n-   ~announce_entry ();\n-   explicit announce_entry (string_view u);\n-   announce_entry (announce_entry const&);\n-\n-   enum tracker_source\n-   {\n-      source_torrent,\n-      source_client,\n-      source_magnet_link,\n-      source_tex,\n-   };\n-\n-   std::string url;\n-   std::string trackerid;\n-   std::vector<announce_endpoint> endpoints;\n-   std::uint8_t tier  = 0;\n-   std::uint8_t fail_limit  = 0;\n-   std::uint8_t source:4;\n-   bool verified:1;\n-};\n-
\n-\n-\n-[report issue]
\n-

announce_entry() operator=() ~announce_entry()

\n-
\n-announce_entry ();\n-announce_entry& operator= (announce_entry const&) &;\n-~announce_entry ();\n-explicit announce_entry (string_view u);\n-announce_entry (announce_entry const&);\n-
\n-

constructs a tracker announce entry with u as the URL.

\n-[report issue]
\n-
\n-

enum tracker_source

\n-

Declared in "libtorrent/announce_entry.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
source_torrent1the tracker was part of the .torrent file
source_client2the tracker was added programmatically via the add_tracker() function
source_magnet_link4the tracker was part of a magnet link
source_tex8the tracker was received from the swarm via tracker exchange
\n-[report issue]
\n-
url
\n-
tracker URL as it appeared in the torrent file
\n-
\n-[report issue]
\n-
trackerid
\n-
the current &trackerid= argument passed to the tracker.\n-this is optional and is normally empty (in which case no\n-trackerid is sent).
\n-
\n-[report issue]
\n-
endpoints
\n-
each local listen socket (endpoint) will announce to the tracker. This\n-list contains state per endpoint.
\n-
\n-[report issue]
\n-
tier
\n-
the tier this tracker belongs to
\n-
\n-[report issue]
\n-
fail_limit
\n-
the max number of failures to announce to this tracker in\n-a row, before this tracker is not used anymore. 0 means unlimited
\n-
\n-[report issue]
\n-
source
\n-
a bitmask specifying which sources we got this tracker from.
\n-
\n-[report issue]
\n-
verified
\n-
set to true the first time we receive a valid response\n-from this tracker.
\n-
\n [report issue]
\n-
\n
\n

block_info

\n

Declared in "libtorrent/torrent_handle.hpp"

\n

holds the state of a block in a piece. Who we requested\n it from and how far along we are at downloading it.

\n
\n struct block_info\n@@ -12532,17 +11067,17 @@\n \n    unsigned bytes_progress:15;\n    unsigned block_size:15;\n    unsigned state:2;\n    unsigned num_peers:14;\n };\n 
\n-\n-[report issue]
\n-

set_peer() peer()

\n+\n+[report issue]
\n+

peer() set_peer()

\n
\n void set_peer (tcp::endpoint const& ep);\n tcp::endpoint peer () const;\n 
\n

The peer is the ip address of the peer this block was downloaded from.

\n [report issue]
\n
\n@@ -12673,112 +11208,112 @@\n Which means you cannot perform any operation on it, unless you first\n assign it a valid handle. If you try to perform any operation on an\n uninitialized handle, it will throw invalid_handle.

\n
\n

Warning

\n

All operations on a torrent_handle may throw system_error\n exception, in case the handle is no longer referring to a torrent.\n-There is one exception is_valid() will never throw. Since the torrents\n+There is one exception is_valid() will never throw. Since the torrents\n are processed by a background thread, there is no guarantee that a\n handle will remain valid between two calls.

\n
\n
\n struct torrent_handle\n {\n    friend std::size_t hash_value (torrent_handle const& th);\n    torrent_handle () noexcept = default;\n    void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n    void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n    void read_piece (piece_index_t piece) const;\n    bool have_piece (piece_index_t piece) const;\n    void get_peer_info (std::vector<peer_info>& v) const;\n    torrent_status status (status_flags_t flags = status_flags_t::all()) const;\n-   std::vector<partial_piece_info> get_download_queue () const;\n    void get_download_queue (std::vector<partial_piece_info>& queue) const;\n+   std::vector<partial_piece_info> get_download_queue () const;\n    void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n    void reset_piece_deadline (piece_index_t index) const;\n    void clear_piece_deadlines () const;\n-   void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n    std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;\n+   void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n    std::vector<open_file_state> file_status () const;\n    void clear_error () const;\n-   void add_tracker (announce_entry const&) const;\n-   std::vector<announce_entry> trackers () const;\n    void replace_trackers (std::vector<announce_entry> const&) const;\n+   std::vector<announce_entry> trackers () const;\n+   void add_tracker (announce_entry const&) const;\n    std::set<std::string> url_seeds () const;\n    void remove_url_seed (std::string const& url) const;\n    void add_url_seed (std::string const& url) const;\n-   std::set<std::string> http_seeds () const;\n    void remove_http_seed (std::string const& url) const;\n    void add_http_seed (std::string const& url) const;\n+   std::set<std::string> http_seeds () const;\n    void add_extension (\n       std::function<std::shared_ptr<torrent_plugin>(torrent_handle const&, client_data_t)> const& ext\n       , client_data_t userdata = client_data_t{});\n    bool set_metadata (span<char const> metadata) const;\n    bool is_valid () const;\n    void resume () const;\n    void pause (pause_flags_t flags = {}) const;\n    void set_flags (torrent_flags_t flags) const;\n    void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n-   void unset_flags (torrent_flags_t flags) const;\n    torrent_flags_t flags () const;\n+   void unset_flags (torrent_flags_t flags) const;\n    void flush_cache () const;\n    void force_recheck () const;\n    void save_resume_data (resume_data_flags_t flags = {}) const;\n    bool need_save_resume_data () const;\n-   void queue_position_bottom () const;\n-   queue_position_t queue_position () const;\n    void queue_position_down () const;\n    void queue_position_top () const;\n+   queue_position_t queue_position () const;\n+   void queue_position_bottom () const;\n    void queue_position_up () const;\n    void queue_position_set (queue_position_t p) const;\n+   void set_ssl_certificate_buffer (std::string const& certificate\n+      , std::string const& private_key\n+      , std::string const& dh_params);\n    void set_ssl_certificate (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params\n       , std::string const& passphrase = "");\n-   void set_ssl_certificate_buffer (std::string const& certificate\n-      , std::string const& private_key\n-      , std::string const& dh_params);\n-   std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n    std::shared_ptr<const torrent_info> torrent_file () const;\n+   std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n    std::vector<std::vector<sha256_hash>> piece_layers () const;\n    void piece_availability (std::vector<int>& avail) const;\n-   download_priority_t piece_priority (piece_index_t index) const;\n+   void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n    std::vector<download_priority_t> get_piece_priorities () const;\n    void piece_priority (piece_index_t index, download_priority_t priority) const;\n-   void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n    void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n-   download_priority_t file_priority (file_index_t index) const;\n+   download_priority_t piece_priority (piece_index_t index) const;\n    void prioritize_files (std::vector<download_priority_t> const& files) const;\n+   download_priority_t file_priority (file_index_t index) const;\n    std::vector<download_priority_t> get_file_priorities () const;\n    void file_priority (file_index_t index, download_priority_t priority) const;\n-   void force_lsd_announce () const;\n-   void force_dht_announce () const;\n    void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+   void force_dht_announce () const;\n+   void force_lsd_announce () const;\n    void scrape_tracker (int idx = -1) const;\n-   int upload_limit () const;\n-   void set_upload_limit (int limit) const;\n-   void set_download_limit (int limit) const;\n    int download_limit () const;\n+   void set_download_limit (int limit) const;\n+   void set_upload_limit (int limit) const;\n+   int upload_limit () const;\n    void connect_peer (tcp::endpoint const& adr, peer_source_flags_t source = {}\n       , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n    void clear_peers ();\n    int max_uploads () const;\n    void set_max_uploads (int max_uploads) const;\n-   void set_max_connections (int max_connections) const;\n    int max_connections () const;\n+   void set_max_connections (int max_connections) const;\n    void move_storage (std::string const& save_path\n       , move_flags_t flags = move_flags_t::always_replace_files\n       ) const;\n    void rename_file (file_index_t index, std::string const& new_name) const;\n-   info_hash_t info_hashes () const;\n    sha1_hash info_hash () const;\n-   bool operator!= (const torrent_handle& h) const;\n-   bool operator== (const torrent_handle& h) const;\n+   info_hash_t info_hashes () const;\n    bool operator< (const torrent_handle& h) const;\n+   bool operator== (const torrent_handle& h) const;\n+   bool operator!= (const torrent_handle& h) const;\n    std::uint32_t id () const;\n    std::shared_ptr<torrent> native_handle () const;\n    client_data_t userdata () const;\n    bool in_session () const;\n \n    static constexpr add_piece_flags_t overwrite_existing  = 0_bit;\n    static constexpr status_flags_t query_distributed_copies  = 0_bit;\n@@ -12800,15 +11335,15 @@\n 
\n [report issue]
\n

torrent_handle()

\n
\n torrent_handle () noexcept = default;\n 
\n

constructs a torrent handle that does not refer to a torrent.\n-i.e. is_valid() will return false.

\n+i.e. is_valid() will return false.

\n [report issue]
\n
\n

add_piece()

\n
\n void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n 
\n@@ -12881,16 +11416,16 @@\n filter them out.

\n

By default everything is included. The flags you can use to decide\n what to include are defined in this class.

\n [report issue]
\n
\n

get_download_queue()

\n
\n-std::vector<partial_piece_info> get_download_queue () const;\n void get_download_queue (std::vector<partial_piece_info>& queue) const;\n+std::vector<partial_piece_info> get_download_queue () const;\n 
\n

get_download_queue() returns a vector with information about pieces\n that are partially downloaded or not downloaded but partially\n requested. See partial_piece_info for the fields in the returned\n vector.

\n \n \n@@ -12919,16 +11454,16 @@\n priority.

\n

clear_piece_deadlines() removes deadlines on all pieces in\n the torrent. As if reset_piece_deadline() was called on all pieces.

\n [report issue]
\n
\n

file_progress()

\n
\n-void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;\n+void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n 
\n

This function fills in the supplied vector, or returns a vector, with\n the number of bytes downloaded of each file in this torrent. The\n progress values are ordered the same as the files in the\n torrent_info.

\n

This operation is not very cheap. Its complexity is O(n + mj).\n Where n is the number of files, m is the number of currently\n@@ -12958,22 +11493,22 @@\n

clear_error()

\n
\n void clear_error () const;\n 
\n

If the torrent is in an error state (i.e. torrent_status::error is\n non-empty), this will clear the error and start the torrent again.

\n \n-\n-[report issue]
\n-
\n-

trackers() replace_trackers() add_tracker()

\n+\n+[report issue]
\n+
\n+

trackers() add_tracker() replace_trackers()

\n
\n-void add_tracker (announce_entry const&) const;\n-std::vector<announce_entry> trackers () const;\n void replace_trackers (std::vector<announce_entry> const&) const;\n+std::vector<announce_entry> trackers () const;\n+void add_tracker (announce_entry const&) const;\n 
\n

trackers() will return the list of trackers for this torrent. The\n announce entry contains both a string url which specify the\n announce url for the tracker as well as an int tier, which is\n specifies the order in which this tracker is tried. If you want\n libtorrent to use another list of trackers for this torrent, you can\n use replace_trackers() which takes a list of the same form as the\n@@ -12984,41 +11519,41 @@\n set. If it is, it doesn't do anything. If it's not in the current set\n of trackers, it will insert it in the tier specified in the\n announce_entry.

\n

The updated set of trackers will be saved in the resume data, and when\n a torrent is started with resume data, the trackers from the resume\n data will replace the original ones.

\n \n-\n-[report issue]
\n-
\n-

add_url_seed() url_seeds() remove_url_seed()

\n+\n+[report issue]
\n+
\n+

add_url_seed() remove_url_seed() url_seeds()

\n
\n std::set<std::string> url_seeds () const;\n void remove_url_seed (std::string const& url) const;\n void add_url_seed (std::string const& url) const;\n 
\n

add_url_seed() adds another url to the torrent's list of url\n seeds. If the given url already exists in that list, the call has no\n effect. The torrent will connect to the server and try to download\n pieces from it, unless it's paused, queued, checking or seeding.\n remove_url_seed() removes the given url if it exists already.\n url_seeds() return a set of the url seeds currently in this\n torrent. Note that URLs that fails may be removed automatically from\n the list.

\n

See http seeding for more information.

\n+\n \n-\n-[report issue]
\n-
\n-

add_http_seed() remove_http_seed() http_seeds()

\n+[report issue]
\n+
\n+

http_seeds() add_http_seed() remove_http_seed()

\n
\n-std::set<std::string> http_seeds () const;\n void remove_http_seed (std::string const& url) const;\n void add_http_seed (std::string const& url) const;\n+std::set<std::string> http_seeds () const;\n 
\n

These functions are identical as the *_url_seed() variants, but\n they operate on BEP 17 web seeds instead of BEP 19.

\n

See http seeding for more information.

\n [report issue]
\n
\n

add_extension()

\n@@ -13054,17 +11589,17 @@\n

Returns true if this handle refers to a valid torrent and false if it\n hasn't been initialized or if the torrent it refers to has been\n removed from the session AND destructed.

\n

To tell if the torrent_handle is in the session, use\n torrent_handle::in_session(). This will return true before\n session_handle::remove_torrent() is called, and false\n afterward.

\n-

Clients should only use is_valid() to determine if the result of\n+

Clients should only use is_valid() to determine if the result of\n session::find_torrent() was successful.

\n-

Unlike other member functions which return a value, is_valid()\n+

Unlike other member functions which return a value, is_valid()\n completes immediately, without blocking on a result from the\n network thread. Also unlike other functions, it never throws\n the system_error exception.

\n \n [report issue]
\n
\n

resume() pause()

\n@@ -13093,16 +11628,16 @@\n \n [report issue]
\n
\n

unset_flags() set_flags() flags()

\n
\n void set_flags (torrent_flags_t flags) const;\n void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n-void unset_flags (torrent_flags_t flags) const;\n torrent_flags_t flags () const;\n+void unset_flags (torrent_flags_t flags) const;\n 
\n

sets and gets the torrent state flags. See torrent_flags_t.\n The set_flags overload that take a mask will affect all\n flags part of the mask, and set their values to what the\n flags argument is set to. This allows clearing and\n setting flags in a single function call.\n The set_flags overload that just takes flags, sets all\n@@ -13253,26 +11788,26 @@\n

\n

Note

\n

A torrent's resume data is considered saved as soon as the\n save_resume_data_alert is posted. It is important to make sure this\n alert is received and handled in order for this function to be\n meaningful.

\n
\n+\n \n-\n+\n \n-\n-[report issue]
\n-
\n-

queue_position_up() queue_position_down() queue_position_bottom() queue_position_top() queue_position()

\n+[report issue]
\n+
\n+

queue_position_top() queue_position_up() queue_position() queue_position_bottom() queue_position_down()

\n
\n-void queue_position_bottom () const;\n-queue_position_t queue_position () const;\n void queue_position_down () const;\n void queue_position_top () const;\n+queue_position_t queue_position () const;\n+void queue_position_bottom () const;\n void queue_position_up () const;\n 
\n

Every torrent that is added is assigned a queue position exactly one\n greater than the greatest queue position of all existing torrents.\n Torrents that are being seeded have -1 as their queue position, since\n they're no longer in line to be downloaded.

\n

When a torrent is removed or turns into a seed, all torrents with\n@@ -13297,21 +11832,21 @@\n of all other torrents remain intact but their numerical queue position\n shifts to make space for this torrent's new position

\n \n [report issue]
\n
\n

set_ssl_certificate() set_ssl_certificate_buffer()

\n
\n+void set_ssl_certificate_buffer (std::string const& certificate\n+      , std::string const& private_key\n+      , std::string const& dh_params);\n void set_ssl_certificate (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params\n       , std::string const& passphrase = "");\n-void set_ssl_certificate_buffer (std::string const& certificate\n-      , std::string const& private_key\n-      , std::string const& dh_params);\n 
\n

For SSL torrents, use this to specify a path to a .pem file to use as\n this client's certificate. The certificate must be signed by the\n certificate in the .torrent file to be valid.

\n

The set_ssl_certificate_buffer() overload takes the actual certificate,\n private key and DH params as strings, rather than paths to files.

\n

cert is a path to the (signed) certificate in .pem format\n@@ -13327,21 +11862,21 @@\n

Note that when a torrent first starts up, and it needs a certificate,\n it will suspend connecting to any peers until it has one. It's\n typically desirable to resume the torrent after setting the SSL\n certificate.

\n

If you receive a torrent_need_cert_alert, you need to call this to\n provide a valid cert. If you don't have a cert you won't be allowed to\n connect to any peers.

\n-\n-[report issue]
\n-
\n-

torrent_file_with_hashes() torrent_file()

\n+\n+[report issue]
\n+
\n+

torrent_file() torrent_file_with_hashes()

\n
\n-std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n std::shared_ptr<const torrent_info> torrent_file () const;\n+std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n 
\n

torrent_file() returns a pointer to the torrent_info object\n associated with this torrent. The torrent_info object may be a copy\n of the internal object. If the torrent doesn't have metadata, the\n pointer will not be initialized (i.e. a nullptr). The torrent may be\n in a state without metadata only if it was started without a .torrent\n file, e.g. by being added by magnet link.

\n@@ -13386,25 +11921,25 @@\n

Fills the specified std::vector<int> with the availability for\n each piece in this torrent. libtorrent does not keep track of\n availability for seeds, so if the torrent is seeding the availability\n for all pieces is reported as 0.

\n

The piece availability is the number of peers that we are connected\n that has advertised having a particular piece. This is the information\n that libtorrent uses in order to prefer picking rare pieces.

\n+\n \n-\n-[report issue]
\n-
\n-

piece_priority() get_piece_priorities() prioritize_pieces()

\n+[report issue]
\n+
\n+

prioritize_pieces() piece_priority() get_piece_priorities()

\n
\n-download_priority_t piece_priority (piece_index_t index) const;\n+void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n std::vector<download_priority_t> get_piece_priorities () const;\n void piece_priority (piece_index_t index, download_priority_t priority) const;\n-void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n+download_priority_t piece_priority (piece_index_t index) const;\n 
\n

These functions are used to set and get the priority of individual\n pieces. By default all pieces have priority 4. That means that the\n random rarest first algorithm is effectively active for all pieces.\n You may however change the priority of individual pieces. There are 8\n priority levels. 0 means not to download the piece at all. Otherwise,\n lower priority values means less likely to be picked. Piece priority\n@@ -13426,22 +11961,22 @@\n Invalid entries, where the piece index or priority is out of range, are\n not allowed.

\n

get_piece_priorities returns a vector with one element for each piece\n in the torrent. Each element is the current priority of that piece.

\n

It's possible to cancel the effect of file priorities by setting the\n priorities for the affected pieces. Care has to be taken when mixing\n usage of file- and piece priorities.

\n-\n+\n \n-[report issue]
\n-
\n-

file_priority() get_file_priorities() prioritize_files()

\n+[report issue]
\n+
\n+

prioritize_files() get_file_priorities() file_priority()

\n
\n-download_priority_t file_priority (file_index_t index) const;\n void prioritize_files (std::vector<download_priority_t> const& files) const;\n+download_priority_t file_priority (file_index_t index) const;\n std::vector<download_priority_t> get_file_priorities () const;\n void file_priority (file_index_t index, download_priority_t priority) const;\n 
\n

index must be in the range [0, number_of_files).

\n

file_priority() queries or sets the priority of file index.

\n

prioritize_files() takes a vector that has at as many elements as\n there are files in the torrent. Each entry is the priority of that\n@@ -13466,23 +12001,23 @@\n file_prio_alert.

\n

When combining file- and piece priorities, the resume file will record\n both. When loading the resume data, the file priorities will be applied\n first, then the piece priorities.

\n

Moving data from a file into the part file is currently not\n supported. If a file has its priority set to 0 after it has already\n been created, it will not be moved into the partfile.

\n-\n+\n \n-[report issue]
\n-
\n-

force_dht_announce() force_reannounce() force_lsd_announce()

\n+[report issue]
\n+
\n+

force_lsd_announce() force_reannounce() force_dht_announce()

\n
\n-void force_lsd_announce () const;\n-void force_dht_announce () const;\n void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+void force_dht_announce () const;\n+void force_lsd_announce () const;\n 
\n

force_reannounce() will force this torrent to do another tracker\n request, to receive new peers. The seconds argument specifies how\n many seconds from now to issue the tracker announces.

\n

If the tracker's min_interval has not passed since the last\n announce, the forced announce will be scheduled to happen immediately\n as the min_interval expires. This is to honor trackers minimum\n@@ -13506,25 +12041,25 @@\n idx is >= 0, the tracker with the specified index will scraped.

\n

A scrape request queries the tracker for statistics such as total\n number of incomplete peers, complete peers, number of downloads etc.

\n

This request will specifically update the num_complete and\n num_incomplete fields in the torrent_status struct once it\n completes. When it completes, it will generate a scrape_reply_alert.\n If it fails, it will generate a scrape_failed_alert.

\n-\n \n-\n-[report issue]
\n-
\n-

set_upload_limit() set_download_limit() download_limit() upload_limit()

\n+\n+\n+[report issue]
\n+
\n+

set_download_limit() upload_limit() set_upload_limit() download_limit()

\n
\n-int upload_limit () const;\n-void set_upload_limit (int limit) const;\n-void set_download_limit (int limit) const;\n int download_limit () const;\n+void set_download_limit (int limit) const;\n+void set_upload_limit (int limit) const;\n+int upload_limit () const;\n 
\n

set_upload_limit will limit the upload bandwidth used by this\n particular torrent to the limit you set. It is given as the number of\n bytes per second the torrent is allowed to upload.\n set_download_limit works the same way but for download bandwidth\n instead of upload bandwidth. Note that setting a higher limit on a\n torrent then the global limit\n@@ -13570,21 +12105,21 @@\n \n

set_max_uploads() sets the maximum number of peers that's unchoked\n at the same time on this torrent. If you set this to -1, there will be\n no limit. This defaults to infinite. The primary setting controlling\n this is the global unchoke slots limit, set by unchoke_slots_limit in\n settings_pack.

\n

max_uploads() returns the current settings.

\n-\n-[report issue]
\n-
\n-

set_max_connections() max_connections()

\n+\n+[report issue]
\n+
\n+

max_connections() set_max_connections()

\n
\n-void set_max_connections (int max_connections) const;\n int max_connections () const;\n+void set_max_connections (int max_connections) const;\n 
\n

set_max_connections() sets the maximum number of connection this\n torrent will open. If all connections are used up, incoming\n connections may be refused or poor connections may be closed. This\n must be at least 2. The default is unlimited number of connections. If\n -1 is given to the function, it means unlimited. There is also a\n global limit of the number of connections, set by\n@@ -13647,37 +12182,37 @@\n

rename_file()

\n
\n void rename_file (file_index_t index, std::string const& new_name) const;\n 
\n

Renames the file with the given index asynchronously. The rename\n operation is complete when either a file_renamed_alert or\n file_rename_failed_alert is posted.

\n-\n-[report issue]
\n-
\n-

info_hashes() info_hash()

\n+\n+[report issue]
\n+
\n+

info_hash() info_hashes()

\n
\n-info_hash_t info_hashes () const;\n sha1_hash info_hash () const;\n+info_hash_t info_hashes () const;\n 
\n

returns the info-hash(es) of the torrent. If this handle is to a\n torrent that hasn't loaded yet (for instance by being added) by a\n URL, the returned value is undefined.\n The info_hash() returns the SHA-1 info-hash for v1 torrents and a\n truncated hash for v2 torrents. For the full v2 info-hash, use\n info_hashes() instead.

\n+\n \n-\n-[report issue]
\n+[report issue]
\n
\n-

operator==() operator!=() operator<()

\n+

operator<() operator==() operator!=()

\n
\n-bool operator!= (const torrent_handle& h) const;\n-bool operator== (const torrent_handle& h) const;\n bool operator< (const torrent_handle& h) const;\n+bool operator== (const torrent_handle& h) const;\n+bool operator!= (const torrent_handle& h) const;\n 
\n

comparison operators. The order of the torrents is unspecified\n but stable.

\n [report issue]
\n
\n

id()

\n
\n@@ -13822,713 +12357,14 @@\n 
\n

hash_value()

\n

Declared in "libtorrent/torrent_handle.hpp"

\n
\n std::size_t hash_value (torrent_handle const& h);\n 
\n

for std::hash (and to support using this type in unordered_map etc.)

\n-[report issue]
\n-
\n-

storage_params

\n-

Declared in "libtorrent/storage_defs.hpp"

\n-

a parameter pack used to construct the storage for a torrent, used in\n-disk_interface

\n-
\n-struct storage_params\n-{\n-   storage_params (file_storage const& f, file_storage const* mf\n-      , std::string const& sp, storage_mode_t const sm\n-      , aux::vector<download_priority_t, file_index_t> const& prio\n-      , sha1_hash const& ih);\n-\n-   file_storage const& files;\n-   file_storage const* mapped_files  = nullptr;\n-   std::string const& path;\n-   storage_mode_t mode {storage_mode_sparse};\n-   aux::vector<download_priority_t, file_index_t> const& priorities;\n-   sha1_hash info_hash;\n-};\n-
\n-[report issue]
\n-
\n-

file_slice

\n-

Declared in "libtorrent/file_storage.hpp"

\n-

represents a window of a file in a torrent.

\n-

The file_index refers to the index of the file (in the torrent_info).\n-To get the path and filename, use file_path() and give the file_index\n-as argument. The offset is the byte offset in the file where the range\n-starts, and size is the number of bytes this range is. The size + offset\n-will never be greater than the file size.

\n-
\n-struct file_slice\n-{\n-   file_index_t file_index;\n-   std::int64_t offset;\n-   std::int64_t size;\n-};\n-
\n-[report issue]
\n-
file_index
\n-
the index of the file
\n-
\n-[report issue]
\n-
offset
\n-
the offset from the start of the file, in bytes
\n-
\n-[report issue]
\n-
size
\n-
the size of the window, in bytes
\n-
\n-[report issue]
\n-
\n-

file_storage

\n-

Declared in "libtorrent/file_storage.hpp"

\n-

The file_storage class represents a file list and the piece\n-size. Everything necessary to interpret a regular bittorrent storage\n-file structure.

\n-
\n-class file_storage\n-{\n-   bool is_valid () const;\n-   void reserve (int num_files);\n-   void add_file (std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void add_file_borrow (error_code& ec, string_view filename\n-      , std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}, char const* filehash = nullptr\n-      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void add_file_borrow (string_view filename\n-      , std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}, char const* filehash = nullptr\n-      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void rename_file (file_index_t index, std::string const& new_filename);\n-   std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n-      , std::int64_t size) const;\n-   peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n-   int num_files () const noexcept;\n-   file_index_t end_file () const noexcept;\n-   index_range<file_index_t> file_range () const noexcept;\n-   std::int64_t total_size () const;\n-   int num_pieces () const;\n-   void set_num_pieces (int n);\n-   piece_index_t end_piece () const;\n-   piece_index_t last_piece () const;\n-   index_range<piece_index_t> piece_range () const noexcept;\n-   void set_piece_length (int l);\n-   int piece_length () const;\n-   int piece_size (piece_index_t index) const;\n-   int piece_size2 (piece_index_t index) const;\n-   int blocks_in_piece2 (piece_index_t index) const;\n-   std::string const& name () const;\n-   void set_name (std::string const& n);\n-   void swap (file_storage& ti) noexcept;\n-   void canonicalize ();\n-   bool pad_file_at (file_index_t index) const;\n-   sha1_hash hash (file_index_t index) const;\n-   sha256_hash root (file_index_t index) const;\n-   std::int64_t file_offset (file_index_t index) const;\n-   std::int64_t file_size (file_index_t index) const;\n-   std::time_t mtime (file_index_t index) const;\n-   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n-   string_view file_name (file_index_t index) const;\n-   std::string symlink (file_index_t index) const;\n-   char const* root_ptr (file_index_t const index) const;\n-   index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const;\n-   int file_num_blocks (file_index_t index) const;\n-   int file_num_pieces (file_index_t index) const;\n-   int file_first_piece_node (file_index_t index) const;\n-   int file_first_block_node (file_index_t index) const;\n-   std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n-   void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n-   file_flags_t file_flags (file_index_t index) const;\n-   bool file_absolute_path (file_index_t index) const;\n-   file_index_t file_index_at_piece (piece_index_t piece) const;\n-   file_index_t file_index_at_offset (std::int64_t offset) const;\n-   file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n-   piece_index_t piece_index_at_file (file_index_t f) const;\n-   void sanitize_symlinks ();\n-   bool v2 () const;\n-\n-   static constexpr file_flags_t flag_pad_file  = 0_bit;\n-   static constexpr file_flags_t flag_hidden  = 1_bit;\n-   static constexpr file_flags_t flag_executable  = 2_bit;\n-   static constexpr file_flags_t flag_symlink  = 3_bit;\n-};\n-
\n-[report issue]
\n-

is_valid()

\n-
\n-bool is_valid () const;\n-
\n-

returns true if the piece length has been initialized\n-on the file_storage. This is typically taken as a proxy\n-of whether the file_storage as a whole is initialized or\n-not.

\n-[report issue]
\n-
\n-

reserve()

\n-
\n-void reserve (int num_files);\n-
\n-

allocates space for num_files in the internal file list. This can\n-be used to avoid reallocating the internal file list when the number\n-of files to be added is known up-front.

\n-\n-[report issue]
\n-
\n-

add_file_borrow() add_file()

\n-
\n-void add_file (std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-void add_file_borrow (error_code& ec, string_view filename\n-      , std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}, char const* filehash = nullptr\n-      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-void add_file_borrow (string_view filename\n-      , std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}, char const* filehash = nullptr\n-      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-
\n-

Adds a file to the file storage. The add_file_borrow version\n-expects that filename is the file name (without a path) of\n-the file that's being added.\n-This memory is borrowed, i.e. it is the caller's\n-responsibility to make sure it stays valid throughout the lifetime\n-of this file_storage object or any copy of it. The same thing applies\n-to filehash, which is an optional pointer to a 20 byte binary\n-SHA-1 hash of the file.

\n-

if filename is empty, the filename from path is used and not\n-borrowed.

\n-

The path argument is the full path (in the torrent file) to\n-the file to add. Note that this is not supposed to be an absolute\n-path, but it is expected to include the name of the torrent as the\n-first path element.

\n-

file_size is the size of the file in bytes.

\n-

The file_flags argument sets attributes on the file. The file\n-attributes is an extension and may not work in all bittorrent clients.

\n-

For possible file attributes, see file_storage::flags_t.

\n-

The mtime argument is optional and can be set to 0. If non-zero,\n-it is the posix time of the last modification time of this file.

\n-

symlink_path is the path the file is a symlink to. To make this a\n-symlink you also need to set the file_storage::flag_symlink file flag.

\n-

root_hash is an optional pointer to a 32 byte SHA-256 hash, being\n-the merkle tree root hash for this file. This is only used for v2\n-torrents. If the root hash is specified for one file, it has to\n-be specified for all, otherwise this function will fail.\n-Note that the buffer root_hash points to must out-live the\n-file_storage object, it will not be copied. This parameter is only\n-used when loading torrents, that already have their file hashes\n-computed. When creating torrents, the file hashes will be computed by\n-the piece hashes.

\n-

If more files than one are added, certain restrictions to their paths\n-apply. In a multi-file file storage (torrent), all files must share\n-the same root directory.

\n-

That is, the first path element of all files must be the same.\n-This shared path element is also set to the name of the torrent. It\n-can be changed by calling set_name.

\n-

The overloads that take an error_code reference will report failures\n-via that variable, otherwise system_error is thrown.

\n-[report issue]
\n-
\n-

rename_file()

\n-
\n-void rename_file (file_index_t index, std::string const& new_filename);\n-
\n-

renames the file at index to new_filename. Keep in mind\n-that filenames are expected to be UTF-8 encoded.

\n-[report issue]
\n-
\n-

map_block()

\n-
\n-std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n-      , std::int64_t size) const;\n-
\n-

returns a list of file_slice objects representing the portions of\n-files the specified piece index, byte offset and size range overlaps.\n-this is the inverse mapping of map_file().

\n-

Preconditions of this function is that the input range is within the\n-torrents address space. piece may not be negative and

\n-
\n-piece * piece_size + offset + size
\n-

may not exceed the total size of the torrent.

\n-[report issue]
\n-
\n-

map_file()

\n-
\n-peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n-
\n-

returns a peer_request representing the piece index, byte offset\n-and size the specified file range overlaps. This is the inverse\n-mapping over map_block(). Note that the peer_request return type\n-is meant to hold bittorrent block requests, which may not be larger\n-than 16 kiB. Mapping a range larger than that may return an overflown\n-integer.

\n-[report issue]
\n-
\n-

num_files()

\n-
\n-int num_files () const noexcept;\n-
\n-

returns the number of files in the file_storage

\n-[report issue]
\n-
\n-

end_file()

\n-
\n-file_index_t end_file () const noexcept;\n-
\n-

returns the index of the one-past-end file in the file storage

\n-[report issue]
\n-
\n-

file_range()

\n-
\n-index_range<file_index_t> file_range () const noexcept;\n-
\n-

returns an implementation-defined type that can be used as the\n-container in a range-for loop. Where the values are the indices of all\n-files in the file_storage.

\n-[report issue]
\n-
\n-

total_size()

\n-
\n-std::int64_t total_size () const;\n-
\n-

returns the total number of bytes all the files in this torrent spans

\n-\n-[report issue]
\n-
\n-

num_pieces() set_num_pieces()

\n-
\n-int num_pieces () const;\n-void set_num_pieces (int n);\n-
\n-

set and get the number of pieces in the torrent

\n-[report issue]
\n-
\n-

end_piece()

\n-
\n-piece_index_t end_piece () const;\n-
\n-

returns the index of the one-past-end piece in the file storage

\n-[report issue]
\n-
\n-

last_piece()

\n-
\n-piece_index_t last_piece () const;\n-
\n-

returns the index of the last piece in the torrent. The last piece is\n-special in that it may be smaller than the other pieces (and the other\n-pieces are all the same size).

\n-[report issue]
\n-
\n-

piece_range()

\n-
\n-index_range<piece_index_t> piece_range () const noexcept;\n-
\n-

returns an implementation-defined type that can be used as the\n-container in a range-for loop. Where the values are the indices of all\n-pieces in the file_storage.

\n-\n-[report issue]
\n-
\n-

piece_length() set_piece_length()

\n-
\n-void set_piece_length (int l);\n-int piece_length () const;\n-
\n-

set and get the size of each piece in this torrent. It must be a power of two\n-and at least 16 kiB.

\n-[report issue]
\n-
\n-

piece_size()

\n-
\n-int piece_size (piece_index_t index) const;\n-
\n-

returns the piece size of index. This will be the same as piece_length(), except\n-for the last piece, which may be shorter.

\n-[report issue]
\n-
\n-

piece_size2()

\n-
\n-int piece_size2 (piece_index_t index) const;\n-
\n-

Returns the size of the given piece. If the piece spans multiple files,\n-only the first file is considered part of the piece. This is used for\n-v2 torrents, where all files are piece aligned and padded. i.e. The pad\n-files are not considered part of the piece for this purpose.

\n-[report issue]
\n-
\n-

blocks_in_piece2()

\n-
\n-int blocks_in_piece2 (piece_index_t index) const;\n-
\n-

returns the number of blocks in the specified piece, for v2 torrents.

\n-\n-[report issue]
\n-
\n-

name() set_name()

\n-
\n-std::string const& name () const;\n-void set_name (std::string const& n);\n-
\n-

set and get the name of this torrent. For multi-file torrents, this is also\n-the name of the root directory all the files are stored in.

\n-[report issue]
\n-
\n-

swap()

\n-
\n-void swap (file_storage& ti) noexcept;\n-
\n-

swap all content of this with ti.

\n-[report issue]
\n-
\n-

canonicalize()

\n-
\n-void canonicalize ();\n-
\n-

arrange files and padding to match the canonical form required\n-by BEP 52

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-[report issue]
\n-\n-
\n-

file_num_pieces() file_num_blocks() file_piece_range()

\n-
\n-index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const;\n-int file_num_blocks (file_index_t index) const;\n-int file_num_pieces (file_index_t index) const;\n-
\n-

Returns the number of pieces or blocks the file at index spans,\n-under the assumption that the file is aligned to the start of a piece.\n-This is only meaningful for v2 torrents, where files are guaranteed\n-such alignment.\n-These numbers are used to size and navigate the merkle hash tree for\n-each file.

\n-\n-[report issue]
\n-
\n-

file_first_block_node() file_first_piece_node()

\n-
\n-int file_first_piece_node (file_index_t index) const;\n-int file_first_block_node (file_index_t index) const;\n-
\n-

index of first piece node in the merkle tree

\n-[report issue]
\n-
\n-

file_path_hash()

\n-
\n-std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n-
\n-

returns the crc32 hash of file_path(index)

\n-[report issue]
\n-
\n-

all_path_hashes()

\n-
\n-void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n-
\n-

this will add the CRC32 hash of all directory entries to the table. No\n-filename will be included, just directories. Every depth of directories\n-are added separately to allow test for collisions with files at all\n-levels. i.e. if one path in the torrent is foo/bar/baz, the CRC32\n-hashes for foo, foo/bar and foo/bar/baz will be added to\n-the set.

\n-[report issue]
\n-
\n-

file_flags()

\n-
\n-file_flags_t file_flags (file_index_t index) const;\n-
\n-

returns a bitmask of flags from file_flags_t that apply\n-to file at index.

\n-[report issue]
\n-
\n-

file_absolute_path()

\n-
\n-bool file_absolute_path (file_index_t index) const;\n-
\n-

returns true if the file at the specified index has been renamed to\n-have an absolute path, i.e. is not anchored in the save path of the\n-torrent.

\n-\n-[report issue]
\n-
\n-

file_index_at_piece() file_index_at_offset()

\n-
\n-file_index_t file_index_at_piece (piece_index_t piece) const;\n-file_index_t file_index_at_offset (std::int64_t offset) const;\n-
\n-

returns the index of the file at the given offset in the torrent

\n-[report issue]
\n-
\n-

file_index_for_root()

\n-
\n-file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n-
\n-

finds the file with the given root hash and returns its index\n-if there is no file with the root hash, file_index_t{-1} is returned

\n-[report issue]
\n-
\n-

piece_index_at_file()

\n-
\n-piece_index_t piece_index_at_file (file_index_t f) const;\n-
\n-

returns the piece index the given file starts at

\n-[report issue]
\n-
\n-

sanitize_symlinks()

\n-
\n-void sanitize_symlinks ();\n-
\n-

validate any symlinks, to ensure they all point to\n-other files or directories inside this storage. Any invalid symlinks\n-are updated to point to themselves.

\n-[report issue]
\n-
\n-

v2()

\n-
\n-bool v2 () const;\n-
\n-

returns true if this torrent contains v2 metadata.

\n-[report issue]
\n-
flag_pad_file
\n-
the file is a pad file. It's required to contain zeros\n-at it will not be saved to disk. Its purpose is to make\n-the following file start on a piece boundary.
\n-
\n-[report issue]
\n-
flag_hidden
\n-
this file has the hidden attribute set. This is primarily\n-a windows attribute
\n-
\n-[report issue]
\n-
flag_executable
\n-
this file has the executable attribute set.
\n-
\n-[report issue]
\n-
flag_symlink
\n-
this file is a symbolic link. It should have a link\n-target string associated with it.
\n-
\n-[report issue]
\n-
\n-
\n-

mmap_disk_io_constructor()

\n-

Declared in "libtorrent/mmap_disk_io.hpp"

\n-
\n-std::unique_ptr<disk_interface> mmap_disk_io_constructor (\n-   io_context& ios, settings_interface const&, counters& cnt);\n-
\n-

constructs a memory mapped file disk I/O object.

\n-[report issue]
\n-
\n-

default_disk_io_constructor()

\n-

Declared in "libtorrent/session.hpp"

\n-
\n-std::unique_ptr<disk_interface> default_disk_io_constructor (\n-   io_context& ios, settings_interface const&, counters& cnt);\n-
\n-

the constructor function for the default storage. On systems that support\n-memory mapped files (and a 64 bit address space) the memory mapped storage\n-will be constructed, otherwise the portable posix storage.

\n-[report issue]
\n-
\n-

disabled_disk_io_constructor()

\n-

Declared in "libtorrent/disabled_disk_io.hpp"

\n-
\n-std::unique_ptr<disk_interface> disabled_disk_io_constructor (\n-   io_context& ios, settings_interface const&, counters& cnt);\n-
\n-

creates a disk io object that discards all data written to it, and only\n-returns zero-buffers when read from. May be useful for testing and\n-benchmarking.

\n-[report issue]
\n-
\n-

posix_disk_io_constructor()

\n-

Declared in "libtorrent/posix_disk_io.hpp"

\n-
\n-std::unique_ptr<disk_interface> posix_disk_io_constructor (\n-   io_context& ios, settings_interface const&, counters& cnt);\n-
\n-

this is a simple posix disk I/O back-end, used for systems that don't\n-have a 64 bit virtual address space or don't support memory mapped files.\n-It's implemented using portable C file functions and is single-threaded.

\n-[report issue]
\n-
\n-

enum storage_mode_t

\n-

Declared in "libtorrent/storage_defs.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
storage_mode_allocate0All pieces will be written to their final position, all files will be\n-allocated in full when the torrent is first started. This mode minimizes\n-fragmentation but could be a costly operation.
storage_mode_sparse1All pieces will be written to the place where they belong and sparse files\n-will be used. This is the recommended, and default mode.
\n-[report issue]
\n-
\n-

enum status_t

\n-

Declared in "libtorrent/storage_defs.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
no_error0 
fatal_disk_error1 
need_full_check2 
file_exist3 
oversized_file16this is not an enum value, but a flag that can be set in the return\n-from async_check_files, in case an existing file was found larger than\n-specified in the torrent. i.e. it has garbage at the end\n-the status_t field is used for this to preserve ABI.
\n-[report issue]
\n-
\n-

enum move_flags_t

\n-

Declared in "libtorrent/storage_defs.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
always_replace_files0replace any files in the destination when copying\n-or moving the storage
fail_if_exist1if any files that we want to copy exist in the destination\n-exist, fail the whole operation and don't perform\n-any copy or move. There is an inherent race condition\n-in this mode. The files are checked for existence before\n-the operation starts. In between the check and performing\n-the copy, the destination files may be created, in which\n-case they are replaced.
dont_replace2if any file exist in the target, take those files instead\n-of the ones we may have in the source.
\n

This section describes the functions and classes that are used\n to create torrent files. It is a layered API with low level classes\n and higher level convenience functions. A torrent is created in 4\n steps:

\n
    \n
  1. first the files that will be part of the torrent are determined.
  2. \n
  3. the torrent properties are set, such as tracker url, web seeds,\n@@ -14572,34 +12408,34 @@\n

    This class holds state for creating a torrent. After having added\n all information to it, call create_torrent::generate() to generate\n the torrent. The entry that's returned can then be bencoded into a\n .torrent file using bencode().

    \n
    \n struct create_torrent\n {\n-   explicit create_torrent (torrent_info const& ti);\n    explicit create_torrent (file_storage& fs, int piece_size = 0\n       , create_flags_t flags = {});\n+   explicit create_torrent (torrent_info const& ti);\n    std::vector<char> generate_buf () const;\n    entry generate () const;\n    file_storage const& files () const;\n    void set_comment (char const* str);\n    void set_creator (char const* str);\n    void set_creation_date (std::time_t timestamp);\n    void set_hash (piece_index_t index, sha1_hash const& h);\n    void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n-   void add_url_seed (string_view url);\n    void add_http_seed (string_view url);\n+   void add_url_seed (string_view url);\n    void add_node (std::pair<std::string, int> node);\n    void add_tracker (string_view url, int tier = 0);\n    void set_root_cert (string_view cert);\n    bool priv () const;\n    void set_priv (bool p);\n-   bool is_v1_only () const;\n    bool is_v2_only () const;\n+   bool is_v1_only () const;\n    int num_pieces () const;\n    piece_index_t end_piece () const;\n    index_range<piece_index_t> piece_range () const noexcept;\n    file_index_t end_file () const;\n    index_range<file_index_t> file_range () const noexcept;\n    index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\n    std::int64_t total_size () const;\n@@ -14616,17 +12452,17 @@\n    static constexpr create_flags_t no_attributes  = 8_bit;\n    static constexpr create_flags_t canonical_files_no_tail_padding  = 9_bit;\n };\n 
    \n [report issue]
    \n

    create_torrent()

    \n
    \n-explicit create_torrent (torrent_info const& ti);\n explicit create_torrent (file_storage& fs, int piece_size = 0\n       , create_flags_t flags = {});\n+explicit create_torrent (torrent_info const& ti);\n 
    \n

    The piece_size is the size of each piece in bytes. It must be a\n power of 2 and a minimum of 16 kiB. If a piece size of 0 is\n specified, a piece_size will be set automatically.

    \n

    The flags arguments specifies options for the torrent creation. It can\n be any combination of the flags defined by create_flags_t.

    \n

    The file_storage (fs) parameter defines the files, sizes and\n@@ -14640,18 +12476,18 @@\n have any affect. Instead of using this overload, consider using\n write_torrent_file() instead.

    \n
    \n

    Warning

    \n

    The file_storage and torrent_info objects must stay alive for the\n entire duration of the create_torrent object.

    \n
    \n-\n-[report issue]
    \n-
    \n-

    generate() generate_buf()

    \n+\n+[report issue]
    \n+
    \n+

    generate_buf() generate()

    \n
    \n std::vector<char> generate_buf () const;\n entry generate () const;\n 
    \n

    This function will generate the .torrent file as a bencode tree, or a\n bencoded into a buffer.\n In order to encode the entry into a flat file, use the bencode() function.

    \n@@ -14742,25 +12578,25 @@\n This function will throw std::system_error if it is called on an\n object constructed with the v1_only flag.

    \n \n [report issue]
    \n
    \n

    add_url_seed() add_http_seed()

    \n
    \n-void add_url_seed (string_view url);\n void add_http_seed (string_view url);\n+void add_url_seed (string_view url);\n 
    \n

    This adds a url seed to the torrent. You can have any number of url seeds. For a\n single file torrent, this should be an HTTP url, pointing to a file with identical\n content as the file of the torrent. For a multi-file torrent, it should point to\n a directory containing a directory with the same name as this torrent, and all the\n files of the torrent in it.

    \n

    The second function, add_http_seed() adds an HTTP seed instead.

    \n [report issue]
    \n-
    \n+
    \n

    add_node()

    \n
    \n void add_node (std::pair<std::string, int> node);\n 
    \n

    This adds a DHT node to the torrent. This especially useful if you're creating a\n tracker less torrent. It can be used by clients to bootstrap their DHT node from.\n The node is a hostname and a port number where there is a DHT node running.\n@@ -14828,24 +12664,24 @@\n

    \n index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\n 
    \n

    for v2 and hybrid torrents only, the pieces in the\n specified file, specified as delta from the first piece in the file.\n i.e. the first index is 0.

    \n [report issue]
    \n-
    \n+
    \n

    total_size()

    \n
    \n std::int64_t total_size () const;\n 
    \n

    the total number of bytes of all files and pad files

    \n-\n-[report issue]
    \n-
    \n-

    piece_length() piece_size()

    \n+\n+[report issue]
    \n+
    \n+

    piece_size() piece_length()

    \n
    \n int piece_length () const;\n int piece_size (piece_index_t i) const;\n 
    \n

    piece_length() returns the piece size of all pieces but the\n last one. piece_size() returns the size of the specified piece.\n these functions are just forwarding to the associated file_storage.

    \n@@ -14947,41 +12783,3093 @@\n

    The flags argument should be the same as the flags passed to the create_torrent\n constructor.

    \n [report issue]
    \n
    \n

    set_piece_hashes()

    \n

    Declared in "libtorrent/create_torrent.hpp"

    \n
    \n+inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p\n+   , settings_interface const& settings\n+   , std::function<void(piece_index_t)> const& f);\n void set_piece_hashes (create_torrent& t, std::string const& p\n    , settings_interface const& settings, disk_io_constructor_type disk_io\n    , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p);\n inline void set_piece_hashes (create_torrent& t, std::string const& p\n    , std::function<void(piece_index_t)> const& f);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p);\n void set_piece_hashes (create_torrent& t, std::string const& p\n    , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p\n-   , settings_interface const& settings\n-   , std::function<void(piece_index_t)> const& f);\n void set_piece_hashes (create_torrent& t, std::string const& p\n    , settings_interface const& settings\n    , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);\n 
    \n

    This function will assume that the files added to the torrent file exists at path\n p, read those files and hash the content and set the hashes in the create_torrent\n object. The optional function f is called in between every hash that is set. f\n must have the following signature:

    \n
    \n void Fun(piece_index_t);\n 
    \n

    The overloads taking a settings_pack may be used to configure the\n underlying disk access. Such as settings_pack::aio_threads.

    \n

    The overloads that don't take an error_code& may throw an exception in case of a\n file error, the other overloads sets the error code to reflect the error, if any.

    \n+[report issue]
    \n+
    \n+

    client_data_t

    \n+

    Declared in "libtorrent/client_data.hpp"

    \n+

    A thin wrapper around a void pointer used as "user data". i.e. an opaque\n+cookie passed in to libtorrent and returned on demand. It adds type-safety by\n+requiring the same type be requested out of it as was assigned to it.

    \n+
    \n+struct client_data_t\n+{\n+   client_data_t () = default;\n+   explicit client_data_t (T* v);\n+   client_data_t& operator= (T* v);\n+   T* get () const;\n+   explicit operator T () const;\n+   client_data_t& operator= (void const*) = delete;\n+   operator void const* () const = delete;\n+   operator void* () const = delete;\n+   client_data_t& operator= (void*) = delete;\n+\n+   template <typename T, typename U  = typename std::enable_if<std::is_pointer<T>::value>::type>\n+};\n+
    \n+[report issue]
    \n+

    client_data_t()

    \n+
    \n+client_data_t () = default;\n+
    \n+

    construct a nullptr client data

    \n+\n+\n+[report issue]
    \n+
    \n+

    const*() operator=() void*()

    \n+
    \n+client_data_t& operator= (void const*) = delete;\n+operator void const* () const = delete;\n+operator void* () const = delete;\n+client_data_t& operator= (void*) = delete;\n+
    \n+

    we don't allow type-unsafe operations

    \n+[report issue]
    \n+
    \n+
    \n+

    add_torrent_params

    \n+

    Declared in "libtorrent/add_torrent_params.hpp"

    \n+

    The add_torrent_params contains all the information in a .torrent file\n+along with all information necessary to add that torrent to a session.\n+The key fields when adding a torrent are:

    \n+
      \n+
    • ti - the immutable info-dict part of the torrent
    • \n+
    • info_hash - when you don't have the metadata (.torrent file). This\n+uniquely identifies the torrent and can validate the info-dict when\n+received from the swarm.
    • \n+
    \n+

    In order to add a torrent to a session, one of those fields must be set\n+in addition to save_path. The add_torrent_params object can then be\n+passed into one of the session::add_torrent() overloads or\n+session::async_add_torrent().

    \n+

    If you only specify the info-hash, the torrent file will be downloaded\n+from peers, which requires them to support the metadata extension. For\n+the metadata extension to work, libtorrent must be built with extensions\n+enabled (TORRENT_DISABLE_EXTENSIONS must not be defined). It also\n+takes an optional name argument. This may be left empty in case no\n+name should be assigned to the torrent. In case it's not, the name is\n+used for the torrent as long as it doesn't have metadata. See\n+torrent_handle::name.

    \n+

    The add_torrent_params is also used when requesting resume data for a\n+torrent. It can be saved to and restored from a file and added back to a\n+new session. For serialization and de-serialization of\n+add_torrent_params objects, see read_resume_data() and\n+write_resume_data().

    \n+

    The add_torrent_params is also used to represent a parsed .torrent\n+file. It can be loaded via load_torrent_file(), load_torrent_buffer() and\n+load_torrent_parsed(). It can be saved via write_torrent_file().

    \n+
    \n+struct add_torrent_params\n+{\n+   int version  = LIBTORRENT_VERSION_NUM;\n+   std::shared_ptr<torrent_info> ti;\n+   aux::noexcept_movable<std::vector<std::string>> trackers;\n+   aux::noexcept_movable<std::vector<int>> tracker_tiers;\n+   aux::noexcept_movable<std::vector<std::pair<std::string, int>>> dht_nodes;\n+   std::string name;\n+   std::string save_path;\n+   storage_mode_t storage_mode  = storage_mode_sparse;\n+   client_data_t userdata;\n+   aux::noexcept_movable<std::vector<download_priority_t>> file_priorities;\n+   std::string trackerid;\n+   torrent_flags_t flags  = torrent_flags::default_flags;\n+   info_hash_t info_hashes;\n+   int max_uploads  = -1;\n+   int max_connections  = -1;\n+   int upload_limit  = -1;\n+   int download_limit  = -1;\n+   std::int64_t total_uploaded  = 0;\n+   std::int64_t total_downloaded  = 0;\n+   int active_time  = 0;\n+   int finished_time  = 0;\n+   int seeding_time  = 0;\n+   std::time_t added_time  = 0;\n+   std::time_t completed_time  = 0;\n+   std::time_t last_seen_complete  = 0;\n+   int num_complete  = -1;\n+   int num_incomplete  = -1;\n+   int num_downloaded  = -1;\n+   aux::noexcept_movable<std::vector<std::string>> http_seeds;\n+   aux::noexcept_movable<std::vector<std::string>> url_seeds;\n+   aux::noexcept_movable<std::vector<tcp::endpoint>> peers;\n+   aux::noexcept_movable<std::vector<tcp::endpoint>> banned_peers;\n+   aux::noexcept_movable<std::map<piece_index_t, bitfield>> unfinished_pieces;\n+   typed_bitfield<piece_index_t> have_pieces;\n+   typed_bitfield<piece_index_t> verified_pieces;\n+   aux::noexcept_movable<std::vector<download_priority_t>> piece_priorities;\n+   aux::vector<std::vector<sha256_hash>, file_index_t> merkle_trees;\n+   aux::vector<std::vector<bool>, file_index_t> merkle_tree_mask;\n+   aux::vector<std::vector<bool>, file_index_t> verified_leaf_hashes;\n+   aux::noexcept_movable<std::map<file_index_t, std::string>> renamed_files;\n+   std::time_t last_download  = 0;\n+   std::time_t last_upload  = 0;\n+};\n+
    \n+[report issue]
    \n+
    version
    \n+
    filled in by the constructor and should be left untouched. It is used\n+for forward binary compatibility.
    \n+
    \n+[report issue]
    \n+
    ti
    \n+
    torrent_info object with the torrent to add. Unless the\n+info_hash is set, this is required to be initialized.
    \n+
    \n+[report issue]
    \n+
    trackers
    \n+
    If the torrent doesn't have a tracker, but relies on the DHT to find\n+peers, the trackers can specify tracker URLs for the torrent.
    \n+
    \n+[report issue]
    \n+
    tracker_tiers
    \n+
    the tiers the URLs in trackers belong to. Trackers belonging to\n+different tiers may be treated differently, as defined by the multi\n+tracker extension. This is optional, if not specified trackers are\n+assumed to be part of tier 0, or whichever the last tier was as\n+iterating over the trackers.
    \n+
    \n+[report issue]
    \n+
    dht_nodes
    \n+
    a list of hostname and port pairs, representing DHT nodes to be added\n+to the session (if DHT is enabled). The hostname may be an IP address.
    \n+
    \n+[report issue]
    \n+
    name
    \n+
    in case there's no other name in this torrent, this name will be used.\n+The name out of the torrent_info object takes precedence if available.
    \n+
    \n+[report issue]
    \n+
    save_path
    \n+

    the path where the torrent is or will be stored.

    \n+
    \n+

    Note

    \n+

    On windows this path (and other paths) are interpreted as UNC\n+paths. This means they must use backslashes as directory separators\n+and may not contain the special directories "." or "..".

    \n+
    \n+

    Setting this to an absolute path performs slightly better than a\n+relative path.

    \n+
    \n+
    \n+[report issue]
    \n+
    storage_mode
    \n+
    One of the values from storage_mode_t. For more information, see\n+storage allocation.
    \n+
    \n+[report issue]
    \n+
    userdata
    \n+
    The userdata parameter is optional and will be passed on to the\n+extension constructor functions, if any\n+(see torrent_handle::add_extension()). It will also be stored in the\n+torrent object and can be retrieved by calling userdata().
    \n+
    \n+[report issue]
    \n+
    file_priorities
    \n+
    can be set to control the initial file priorities when adding a\n+torrent. The semantics are the same as for\n+torrent_handle::prioritize_files(). The file priorities specified\n+in here take precedence over those specified in the resume data, if\n+any.\n+If this vector of file priorities is shorter than the number of files\n+in the torrent, the remaining files (not covered by this) will still\n+have the default download priority. This default can be changed by\n+setting the default_dont_download torrent_flag.
    \n+
    \n+[report issue]
    \n+
    trackerid
    \n+
    the default tracker id to be used when announcing to trackers. By\n+default this is empty, and no tracker ID is used, since this is an\n+optional argument. If a tracker returns a tracker ID, that ID is used\n+instead of this.
    \n+
    \n+[report issue]
    \n+
    flags
    \n+

    flags controlling aspects of this torrent and how it's added. See\n+torrent_flags_t for details.

    \n+
    \n+

    Note

    \n+

    The flags field is initialized with default flags by the\n+constructor. In order to preserve default behavior when clearing or\n+setting other flags, make sure to bitwise OR or in a flag or bitwise\n+AND the inverse of a flag to clear it.

    \n+
    \n+
    \n+
    \n+[report issue]
    \n+
    info_hashes
    \n+
    set this to the info hash of the torrent to add in case the info-hash\n+is the only known property of the torrent. i.e. you don't have a\n+.torrent file nor a magnet link.\n+To add a magnet link, use parse_magnet_uri() to populate fields in the\n+add_torrent_params object.
    \n+
    \n+\n+[report issue]
    \n+
    max_uploads max_connections
    \n+

    max_uploads, max_connections, upload_limit,\n+download_limit correspond to the set_max_uploads(),\n+set_max_connections(), set_upload_limit() and\n+set_download_limit() functions on torrent_handle. These values let\n+you initialize these settings when the torrent is added, instead of\n+calling these functions immediately following adding it.

    \n+

    -1 means unlimited on these settings just like their counterpart\n+functions on torrent_handle

    \n+

    For fine grained control over rate limits, including making them apply\n+to local peers, see peer classes.

    \n+
    \n+
    \n+\n+[report issue]
    \n+
    upload_limit download_limit
    \n+
    the upload and download rate limits for this torrent, specified in\n+bytes per second. -1 means unlimited.
    \n+
    \n+\n+[report issue]
    \n+
    total_uploaded total_downloaded
    \n+
    the total number of bytes uploaded and downloaded by this torrent so\n+far.
    \n+
    \n+\n+\n+[report issue]
    \n+
    active_time finished_time seeding_time
    \n+
    the number of seconds this torrent has spent in started, finished and\n+seeding state so far, respectively.
    \n+
    \n+\n+[report issue]
    \n+
    added_time completed_time
    \n+
    if set to a non-zero value, this is the posix time of when this torrent\n+was first added, including previous runs/sessions. If set to zero, the\n+internal added_time will be set to the time of when add_torrent() is\n+called.
    \n+
    \n+[report issue]
    \n+
    last_seen_complete
    \n+
    if set to non-zero, initializes the time (expressed in posix time) when\n+we last saw a seed or peers that together formed a complete copy of the\n+torrent. If left set to zero, the internal counterpart to this field\n+will be updated when we see a seed or a distributed copies >= 1.0.
    \n+
    \n+\n+\n+[report issue]
    \n+
    num_complete num_incomplete num_downloaded
    \n+

    these field can be used to initialize the torrent's cached scrape data.\n+The scrape data is high level metadata about the current state of the\n+swarm, as returned by the tracker (either when announcing to it or by\n+sending a specific scrape request). num_complete is the number of\n+peers in the swarm that are seeds, or have every piece in the torrent.\n+num_incomplete is the number of peers in the swarm that do not have\n+every piece. num_downloaded is the number of times the torrent has\n+been downloaded (not initiated, but the number of times a download has\n+completed).

    \n+

    Leaving any of these values set to -1 indicates we don't know, or we\n+have not received any scrape data.

    \n+
    \n+
    \n+\n+[report issue]
    \n+
    http_seeds url_seeds
    \n+

    URLs can be added to these two lists to specify additional web\n+seeds to be used by the torrent. If the flag_override_web_seeds\n+is set, these will be the _only_ ones to be used. i.e. any web seeds\n+found in the .torrent file will be overridden.

    \n+

    http_seeds expects URLs to web servers implementing the original HTTP\n+seed specification BEP 17.

    \n+

    url_seeds expects URLs to regular web servers, aka "get right" style,\n+specified in BEP 19.

    \n+
    \n+
    \n+[report issue]
    \n+
    peers
    \n+
    peers to add to the torrent, to be tried to be connected to as\n+bittorrent peers.
    \n+
    \n+[report issue]
    \n+
    banned_peers
    \n+
    peers banned from this torrent. The will not be connected to
    \n+
    \n+[report issue]
    \n+
    unfinished_pieces
    \n+
    this is a map of partially downloaded piece. The key is the piece index\n+and the value is a bitfield where each bit represents a 16 kiB block.\n+A set bit means we have that block.
    \n+
    \n+[report issue]
    \n+
    have_pieces
    \n+
    this is a bitfield indicating which pieces we already have of this\n+torrent.
    \n+
    \n+[report issue]
    \n+
    verified_pieces
    \n+
    when in seed_mode, pieces with a set bit in this bitfield have been\n+verified to be valid. Other pieces will be verified the first time a\n+peer requests it.
    \n+
    \n+[report issue]
    \n+
    piece_priorities
    \n+
    this sets the priorities for each individual piece in the torrent. Each\n+element in the vector represent the piece with the same index. If you\n+set both file- and piece priorities, file priorities will take\n+precedence.
    \n+
    \n+[report issue]
    \n+
    merkle_trees
    \n+
    v2 hashes, if known
    \n+
    \n+[report issue]
    \n+
    merkle_tree_mask
    \n+
    if set, indicates which hashes are included in the corresponding\n+vector of merkle_trees. These bitmasks always cover the full\n+tree, a cleared bit means the hash is all zeros (i.e. not set) and\n+set bit means the next hash in the corresponding vector in\n+merkle_trees is the hash for that node. This is an optimization\n+to avoid storing a lot of zeros.
    \n+
    \n+[report issue]
    \n+
    verified_leaf_hashes
    \n+
    bit-fields indicating which v2 leaf hashes have been verified\n+against the root hash. If this vector is empty and merkle_trees is\n+non-empty it implies that all hashes in merkle_trees are verified.
    \n+
    \n+[report issue]
    \n+
    renamed_files
    \n+
    this is a map of file indices in the torrent and new filenames to be\n+applied before the torrent is added.
    \n+
    \n+\n+[report issue]
    \n+
    last_download last_upload
    \n+
    the posix time of the last time payload was received or sent for this\n+torrent, respectively.
    \n+
    \n+[report issue]
    \n+
    \n+

    storage_error

    \n+

    Declared in "libtorrent/error_code.hpp"

    \n+

    used by storage to return errors\n+also includes which underlying file the\n+error happened on

    \n+
    \n+struct storage_error\n+{\n+   explicit operator bool () const;\n+   file_index_t file () const;\n+   void file (file_index_t f);\n+\n+   error_code ec;\n+   operation_t operation;\n+};\n+
    \n+[report issue]
    \n+

    bool()

    \n+
    \n+explicit operator bool () const;\n+
    \n+

    explicitly converts to true if this object represents an error, and\n+false if it does not.

    \n+[report issue]
    \n+
    \n+

    file()

    \n+
    \n+file_index_t file () const;\n+void file (file_index_t f);\n+
    \n+

    set and query the index (in the torrent) of the file this error\n+occurred on. This may also have special values defined in\n+torrent_status.

    \n+[report issue]
    \n+
    ec
    \n+
    the error that occurred
    \n+
    \n+[report issue]
    \n+
    operation
    \n+
    A code from operation_t enum, indicating what\n+kind of operation failed.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    i2p_category()

    \n+

    Declared in "libtorrent/i2p_stream.hpp"

    \n+
    \n+boost::system::error_category& i2p_category ();\n+
    \n+

    returns the error category for I2P errors

    \n+[report issue]
    \n+
    \n+

    libtorrent_category()

    \n+

    Declared in "libtorrent/error_code.hpp"

    \n+
    \n+boost::system::error_category& libtorrent_category ();\n+
    \n+

    return the instance of the libtorrent_error_category which\n+maps libtorrent error codes to human readable error messages.

    \n+[report issue]
    \n+
    \n+

    http_category()

    \n+

    Declared in "libtorrent/error_code.hpp"

    \n+
    \n+boost::system::error_category& http_category ();\n+
    \n+

    returns the error_category for HTTP errors

    \n+[report issue]
    \n+
    \n+

    bdecode_category()

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+
    \n+boost::system::error_category& bdecode_category ();\n+
    \n+[report issue]
    \n+
    \n+

    gzip_category()

    \n+

    Declared in "libtorrent/gzip.hpp"

    \n+
    \n+boost::system::error_category& gzip_category ();\n+
    \n+

    get the error_category for zip errors

    \n+[report issue]
    \n+
    \n+

    pcp_category()

    \n+

    Declared in "libtorrent/natpmp.hpp"

    \n+
    \n+boost::system::error_category& pcp_category ();\n+
    \n+[report issue]
    \n+
    \n+

    socks_category()

    \n+

    Declared in "libtorrent/socks5_stream.hpp"

    \n+
    \n+boost::system::error_category& socks_category ();\n+
    \n+

    returns the error_category for SOCKS5 errors

    \n+[report issue]
    \n+
    \n+

    upnp_category()

    \n+

    Declared in "libtorrent/upnp.hpp"

    \n+
    \n+boost::system::error_category& upnp_category ();\n+
    \n+

    the boost.system error category for UPnP errors

    \n+[report issue]
    \n+
    \n+

    enum i2p_error_code

    \n+

    Declared in "libtorrent/i2p_stream.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    no_error0 
    parse_failed1 
    cant_reach_peer2 
    i2p_error3 
    invalid_key4 
    invalid_id5 
    timeout6 
    key_not_found7 
    duplicated_id8 
    num_errors9 
    \n+[report issue]
    \n+
    \n+

    enum error_code_enum

    \n+

    Declared in "libtorrent/error_code.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    no_error0Not an error
    file_collision1Two torrents has files which end up overwriting each other
    failed_hash_check2A piece did not match its piece hash
    torrent_is_no_dict3The .torrent file does not contain a bencoded dictionary at\n+its top level
    torrent_missing_info4The .torrent file does not have an info dictionary
    torrent_info_no_dict5The .torrent file's info entry is not a dictionary
    torrent_missing_piece_length6The .torrent file does not have a piece length entry
    torrent_missing_name7The .torrent file does not have a name entry
    torrent_invalid_name8The .torrent file's name entry is invalid
    torrent_invalid_length9The length of a file, or of the whole .torrent file is invalid.\n+Either negative or not an integer
    torrent_file_parse_failed10Failed to parse a file entry in the .torrent
    torrent_missing_pieces11The pieces field is missing or invalid in the .torrent file
    torrent_invalid_hashes12The pieces string has incorrect length
    too_many_pieces_in_torrent13The .torrent file has more pieces than is supported by libtorrent
    invalid_swarm_metadata14The metadata (.torrent file) that was received from the swarm\n+matched the info-hash, but failed to be parsed
    invalid_bencoding15The file or buffer is not correctly bencoded
    no_files_in_torrent16The .torrent file does not contain any files
    invalid_escaped_string17The string was not properly url-encoded as expected
    session_is_closing18Operation is not permitted since the session is shutting down
    duplicate_torrent19There's already a torrent with that info-hash added to the\n+session
    invalid_torrent_handle20The supplied torrent_handle is not referring to a valid torrent
    invalid_entry_type21The type requested from the entry did not match its type
    missing_info_hash_in_uri22The specified URI does not contain a valid info-hash
    file_too_short23One of the files in the torrent was unexpectedly small. This\n+might be caused by files being changed by an external process
    unsupported_url_protocol24The URL used an unknown protocol. Currently http and\n+https (if built with openssl support) are recognized. For\n+trackers udp is recognized as well.
    url_parse_error25The URL did not conform to URL syntax and failed to be parsed
    peer_sent_empty_piece26The peer sent a piece message of length 0
    parse_failed27A bencoded structure was corrupt and failed to be parsed
    invalid_file_tag28The fast resume file was missing or had an invalid file version\n+tag
    missing_info_hash29The fast resume file was missing or had an invalid info-hash
    mismatching_info_hash30The info-hash did not match the torrent
    invalid_hostname31The URL contained an invalid hostname
    invalid_port32The URL had an invalid port
    port_blocked33The port is blocked by the port-filter, and prevented the\n+connection
    expected_close_bracket_in_address34The IPv6 address was expected to end with "]"
    destructing_torrent35The torrent is being destructed, preventing the operation to\n+succeed
    timed_out36The connection timed out
    upload_upload_connection37The peer is upload only, and we are upload only. There's no point\n+in keeping the connection
    uninteresting_upload_peer38The peer is upload only, and we're not interested in it. There's\n+no point in keeping the connection
    invalid_info_hash39The peer sent an unknown info-hash
    torrent_paused40The torrent is paused, preventing the operation from succeeding
    invalid_have41The peer sent an invalid have message, either wrong size or\n+referring to a piece that doesn't exist in the torrent
    invalid_bitfield_size42The bitfield message had the incorrect size
    too_many_requests_when_choked43The peer kept requesting pieces after it was choked, possible\n+abuse attempt.
    invalid_piece44The peer sent a piece message that does not correspond to a\n+piece request sent by the client
    no_memory45memory allocation failed
    torrent_aborted46The torrent is aborted, preventing the operation to succeed
    self_connection47The peer is a connection to ourself, no point in keeping it
    invalid_piece_size48The peer sent a piece message with invalid size, either negative\n+or greater than one block
    timed_out_no_interest49The peer has not been interesting or interested in us for too\n+long, no point in keeping it around
    timed_out_inactivity50The peer has not said anything in a long time, possibly dead
    timed_out_no_handshake51The peer did not send a handshake within a reasonable amount of\n+time, it might not be a bittorrent peer
    timed_out_no_request52The peer has been unchoked for too long without requesting any\n+data. It might be lying about its interest in us
    invalid_choke53The peer sent an invalid choke message
    invalid_unchoke54The peer send an invalid unchoke message
    invalid_interested55The peer sent an invalid interested message
    invalid_not_interested56The peer sent an invalid not-interested message
    invalid_request57The peer sent an invalid piece request message
    invalid_hash_list58The peer sent an invalid hash-list message (this is part of the\n+merkle-torrent extension)
    invalid_hash_piece59The peer sent an invalid hash-piece message (this is part of the\n+merkle-torrent extension)
    invalid_cancel60The peer sent an invalid cancel message
    invalid_dht_port61The peer sent an invalid DHT port-message
    invalid_suggest62The peer sent an invalid suggest piece-message
    invalid_have_all63The peer sent an invalid have all-message
    invalid_have_none64The peer sent an invalid have none-message
    invalid_reject65The peer sent an invalid reject message
    invalid_allow_fast66The peer sent an invalid allow fast-message
    invalid_extended67The peer sent an invalid extension message ID
    invalid_message68The peer sent an invalid message ID
    sync_hash_not_found69The synchronization hash was not found in the encrypted handshake
    invalid_encryption_constant70The encryption constant in the handshake is invalid
    no_plaintext_mode71The peer does not support plain text, which is the selected mode
    no_rc4_mode72The peer does not support RC4, which is the selected mode
    unsupported_encryption_mode73The peer does not support any of the encryption modes that the\n+client supports
    unsupported_encryption_mode_selected74The peer selected an encryption mode that the client did not\n+advertise and does not support
    invalid_pad_size75The pad size used in the encryption handshake is of invalid size
    invalid_encrypt_handshake76The encryption handshake is invalid
    no_incoming_encrypted77The client is set to not support incoming encrypted connections\n+and this is an encrypted connection
    no_incoming_regular78The client is set to not support incoming regular bittorrent\n+connections, and this is a regular connection
    duplicate_peer_id79The client is already connected to this peer-ID
    torrent_removed80Torrent was removed
    packet_too_large81The packet size exceeded the upper sanity check-limit
    reserved82 
    http_error83The web server responded with an error
    missing_location84The web server response is missing a location header
    invalid_redirection85The web seed redirected to a path that no longer matches the\n+.torrent directory structure
    redirecting86The connection was closed because it redirected to a different\n+URL
    invalid_range87The HTTP range header is invalid
    no_content_length88The HTTP response did not have a content length
    banned_by_ip_filter89The IP is blocked by the IP filter
    too_many_connections90At the connection limit
    peer_banned91The peer is marked as banned
    stopping_torrent92The torrent is stopping, causing the operation to fail
    too_many_corrupt_pieces93The peer has sent too many corrupt pieces and is banned
    torrent_not_ready94The torrent is not ready to receive peers
    peer_not_constructed95The peer is not completely constructed yet
    session_closing96The session is closing, causing the operation to fail
    optimistic_disconnect97The peer was disconnected in order to leave room for a\n+potentially better peer
    torrent_finished98The torrent is finished
    no_router99No UPnP router found
    metadata_too_large100The metadata message says the metadata exceeds the limit
    invalid_metadata_request101The peer sent an invalid metadata request message
    invalid_metadata_size102The peer advertised an invalid metadata size
    invalid_metadata_offset103The peer sent a message with an invalid metadata offset
    invalid_metadata_message104The peer sent an invalid metadata message
    pex_message_too_large105The peer sent a peer exchange message that was too large
    invalid_pex_message106The peer sent an invalid peer exchange message
    invalid_lt_tracker_message107The peer sent an invalid tracker exchange message
    too_frequent_pex108The peer sent an pex messages too often. This is a possible\n+attempt of and attack
    no_metadata109The operation failed because it requires the torrent to have\n+the metadata (.torrent file) and it doesn't have it yet.\n+This happens for magnet links before they have downloaded the\n+metadata, and also torrents added by URL.
    invalid_dont_have110The peer sent an invalid dont_have message. The don't have\n+message is an extension to allow peers to advertise that the\n+no longer has a piece they previously had.
    requires_ssl_connection111The peer tried to connect to an SSL torrent without connecting\n+over SSL.
    invalid_ssl_cert112The peer tried to connect to a torrent with a certificate\n+for a different torrent.
    not_an_ssl_torrent113the torrent is not an SSL torrent, and the operation requires\n+an SSL torrent
    banned_by_port_filter114peer was banned because its listen port is within a banned port\n+range, as specified by the port_filter.
    invalid_session_handle115The session_handle is not referring to a valid session_impl
    invalid_listen_socket116the listen socket associated with this request was closed
    invalid_hash_request117 
    invalid_hashes118 
    invalid_hash_reject119 
    deprecated_120120 
    deprecated_121121 
    deprecated_122122 
    deprecated_123123 
    deprecated_124124 
    missing_file_sizes130The resume data file is missing the file sizes entry
    no_files_in_resume_data131The resume data file file sizes entry is empty
    missing_pieces132The resume data file is missing the pieces and slots entry
    mismatching_number_of_files133The number of files in the resume data does not match the number\n+of files in the torrent
    mismatching_file_size134One of the files on disk has a different size than in the fast\n+resume file
    mismatching_file_timestamp135One of the files on disk has a different timestamp than in the\n+fast resume file
    not_a_dictionary136The resume data file is not a dictionary
    invalid_blocks_per_piece137The blocks per piece entry is invalid in the resume data file
    missing_slots138The resume file is missing the slots entry, which is required\n+for torrents with compact allocation. DEPRECATED
    too_many_slots139The resume file contains more slots than the torrent
    invalid_slot_list140The slot entry is invalid in the resume data
    invalid_piece_index141One index in the slot list is invalid
    pieces_need_reorder142The pieces on disk needs to be re-ordered for the specified\n+allocation mode. This happens if you specify sparse allocation\n+and the files on disk are using compact storage. The pieces needs\n+to be moved to their right position. DEPRECATED
    resume_data_not_modified143this error is returned when asking to save resume data and\n+specifying the flag to only save when there's anything new to save\n+(torrent_handle::only_if_modified) and there wasn't anything changed.
    http_parse_error150The HTTP header was not correctly formatted
    http_missing_location151The HTTP response was in the 300-399 range but lacked a location\n+header
    http_failed_decompress152The HTTP response was encoded with gzip or deflate but\n+decompressing it failed
    no_i2p_router160The URL specified an i2p address, but no i2p router is configured
    no_i2p_endpoint161i2p acceptor is not available yet, can't announce without endpoint
    scrape_not_available170The tracker URL doesn't support transforming it into a scrape\n+URL. i.e. it doesn't contain "announce.
    invalid_tracker_response171invalid tracker response
    invalid_peer_dict172invalid peer dictionary entry. Not a dictionary
    tracker_failure173tracker sent a failure message
    invalid_files_entry174missing or invalid files entry
    invalid_hash_entry175missing or invalid hash entry
    invalid_peers_entry176missing or invalid peers and peers6 entry
    invalid_tracker_response_length177UDP tracker response packet has invalid size
    invalid_tracker_transaction_id178invalid transaction id in UDP tracker response
    invalid_tracker_action179invalid action field in UDP tracker response
    announce_skipped180skipped announce (because it's assumed to be unreachable over the\n+given source network interface)
    no_entropy200random number generation failed
    ssrf_mitigation201blocked by SSRF mitigation
    blocked_by_idna202blocked because IDNA host names are banned
    torrent_unknown_version210the torrent file has an unknown meta version
    torrent_missing_file_tree211the v2 torrent file has no file tree
    torrent_missing_meta_version212the torrent contains v2 keys but does not specify meta version 2
    torrent_inconsistent_files213the v1 and v2 file metadata does not match
    torrent_missing_piece_layer214one or more files are missing piece layer hashes
    torrent_invalid_piece_layer215a piece layer has the wrong size or failed hash check
    torrent_missing_pieces_root216a v2 file entry has no root hash
    torrent_inconsistent_hashes217the v1 and v2 hashes do not describe the same data
    torrent_invalid_pad_file218a file in the v2 metadata has the pad attribute set
    error_code_max219the number of error codes
    \n+[report issue]
    \n+
    \n+

    enum http_errors

    \n+

    Declared in "libtorrent/error_code.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    cont100 
    ok200 
    created201 
    accepted202 
    no_content204 
    multiple_choices300 
    moved_permanently301 
    moved_temporarily302 
    not_modified304 
    bad_request400 
    unauthorized401 
    forbidden403 
    not_found404 
    internal_server_error500 
    not_implemented501 
    bad_gateway502 
    service_unavailable503 
    \n+[report issue]
    \n+
    \n+

    enum error_code_enum

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    no_error0Not an error
    expected_digit1expected digit in bencoded string
    expected_colon2expected colon in bencoded string
    unexpected_eof3unexpected end of file in bencoded string
    expected_value4expected value (list, dict, int or string) in bencoded string
    depth_exceeded5bencoded recursion depth limit exceeded
    limit_exceeded6bencoded item count limit exceeded
    overflow7integer overflow
    error_code_max8the number of error codes
    \n+[report issue]
    \n+
    \n+

    enum error_code_enum

    \n+

    Declared in "libtorrent/gzip.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    no_error0Not an error
    invalid_gzip_header1the supplied gzip buffer has invalid header
    inflated_data_too_large2the gzip buffer would inflate to more bytes than the specified\n+maximum size, and was rejected.
    data_did_not_terminate3available inflate data did not terminate
    space_exhausted4output space exhausted before completing inflate
    invalid_block_type5invalid block type (type == 3)
    invalid_stored_block_length6stored block length did not match one's complement
    too_many_length_or_distance_codes7dynamic block code description: too many length or distance codes
    code_lengths_codes_incomplete8dynamic block code description: code lengths codes incomplete
    repeat_lengths_with_no_first_length9dynamic block code description: repeat lengths with no first length
    repeat_more_than_specified_lengths10dynamic block code description: repeat more than specified lengths
    invalid_literal_length_code_lengths11dynamic block code description: invalid literal/length code lengths
    invalid_distance_code_lengths12dynamic block code description: invalid distance code lengths
    invalid_literal_code_in_block13invalid literal/length or distance code in fixed or dynamic block
    distance_too_far_back_in_block14distance is too far back in fixed or dynamic block
    unknown_gzip_error15an unknown error occurred during gzip inflation
    error_code_max16the number of error codes
    \n+[report issue]
    \n+
    \n+

    enum pcp_errors

    \n+

    Declared in "libtorrent/natpmp.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    pcp_success0 
    pcp_unsupp_version1 
    pcp_not_authorized2 
    pcp_malformed_request3 
    pcp_unsupp_opcode4 
    pcp_unsupp_option5 
    pcp_malformed_option6 
    pcp_network_failure7 
    pcp_no_resources8 
    pcp_unsupp_protocol9 
    pcp_user_ex_quota10 
    pcp_cannot_provide_external11 
    pcp_address_mismatch12 
    pcp_excessive_remote_peers13 
    \n+[report issue]
    \n+
    \n+

    enum socks_error_code

    \n+

    Declared in "libtorrent/socks5_stream.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    no_error0 
    unsupported_version1 
    unsupported_authentication_method2 
    unsupported_authentication_version3 
    authentication_error4 
    username_required5 
    general_failure6 
    command_not_supported7 
    no_identd8 
    identd_error9 
    num_errors10 
    \n+[report issue]
    \n+
    \n+

    enum error_code_enum

    \n+

    Declared in "libtorrent/upnp.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    no_error0No error
    invalid_argument402One of the arguments in the request is invalid
    action_failed501The request failed
    value_not_in_array714The specified value does not exist in the array
    source_ip_cannot_be_wildcarded715The source IP address cannot be wild-carded, but\n+must be fully specified
    external_port_cannot_be_wildcarded716The external port cannot be a wildcard, but must\n+be specified
    port_mapping_conflict718The port mapping entry specified conflicts with a\n+mapping assigned previously to another client
    internal_port_must_match_external724Internal and external port value must be the same
    only_permanent_leases_supported725The NAT implementation only supports permanent\n+lease times on port mappings
    remote_host_must_be_wildcard726RemoteHost must be a wildcard and cannot be a\n+specific IP address or DNS name
    external_port_must_be_wildcard727ExternalPort must be a wildcard and cannot be a\n+specific port
    \n+[report issue]
    \n+
    \n+

    web_seed_entry

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

    the web_seed_entry holds information about a web seed (also known\n+as URL seed or HTTP seed). It is essentially a URL with some state\n+associated with it. For more information, see BEP 17 and BEP 19.

    \n+
    \n+struct web_seed_entry\n+{\n+   bool operator== (web_seed_entry const& e) const;\n+   bool operator< (web_seed_entry const& e) const;\n+\n+   enum type_t\n+   {\n+      url_seed,\n+      http_seed,\n+   };\n+\n+   std::string url;\n+   std::string auth;\n+   headers_t extra_headers;\n+   std::uint8_t type;\n+};\n+
    \n+[report issue]
    \n+

    operator==()

    \n+
    \n+bool operator== (web_seed_entry const& e) const;\n+
    \n+

    URL and type comparison

    \n+[report issue]
    \n+
    \n+

    operator<()

    \n+
    \n+bool operator< (web_seed_entry const& e) const;\n+
    \n+

    URL and type less-than comparison

    \n+[report issue]
    \n+
    \n+

    enum type_t

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    url_seed0 
    http_seed1 
    \n+[report issue]
    \n+
    url
    \n+
    The URL of the web seed
    \n+
    \n+[report issue]
    \n+
    auth
    \n+
    Optional authentication. If this is set, it's passed\n+in as HTTP basic auth to the web seed. The format is:\n+username:password.
    \n+
    \n+[report issue]
    \n+
    extra_headers
    \n+
    Any extra HTTP headers that need to be passed to the web seed
    \n+
    \n+[report issue]
    \n+
    type
    \n+
    The type of web seed (see type_t)
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    load_torrent_limits

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

    this object holds configuration options for limits to use when loading\n+torrents. They are meant to prevent loading potentially malicious torrents\n+that cause excessive memory allocations.

    \n+
    \n+struct load_torrent_limits\n+{\n+   int max_buffer_size  = 10000000;\n+   int max_pieces  = 0x200000;\n+   int max_decode_depth  = 100;\n+   int max_decode_tokens  = 3000000;\n+};\n+
    \n+[report issue]
    \n+
    max_buffer_size
    \n+
    the max size of a .torrent file to load into RAM
    \n+
    \n+[report issue]
    \n+
    max_pieces
    \n+
    the max number of pieces allowed in the torrent
    \n+
    \n+[report issue]
    \n+
    max_decode_depth
    \n+
    the max recursion depth in the bdecoded structure
    \n+
    \n+[report issue]
    \n+
    max_decode_tokens
    \n+
    the max number of bdecode tokens
    \n+
    \n+[report issue]
    \n+
    \n+

    torrent_info

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

    the torrent_info class holds the information found in a .torrent file.

    \n+
    \n+class torrent_info\n+{\n+   torrent_info (char const* buffer, int size, error_code& ec);\n+   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n+   torrent_info (torrent_info const& t);\n+   torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+   torrent_info (std::string const& filename, error_code& ec);\n+   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n+   torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+   explicit torrent_info (bdecode_node const& torrent_file);\n+   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+   explicit torrent_info (info_hash_t const& info_hash);\n+   explicit torrent_info (span<char const> buffer, from_span_t);\n+   torrent_info (char const* buffer, int size);\n+   explicit torrent_info (std::string const& filename);\n+   ~torrent_info ();\n+   file_storage const& orig_files () const;\n+   file_storage const& files () const;\n+   void rename_file (file_index_t index, std::string const& new_filename);\n+   void remap_files (file_storage const& f);\n+   void clear_trackers ();\n+   void add_tracker (std::string const& url, int tier\n+      , announce_entry::tracker_source source);\n+   void add_tracker (std::string const& url, int tier = 0);\n+   std::vector<announce_entry> const& trackers () const;\n+   std::vector<std::string> collections () const;\n+   std::vector<sha1_hash> similar_torrents () const;\n+   std::vector<web_seed_entry> const& web_seeds () const;\n+   void add_url_seed (std::string const& url\n+      , std::string const& ext_auth = std::string()\n+      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+   void add_http_seed (std::string const& url\n+      , std::string const& extern_auth = std::string()\n+      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+   void set_web_seeds (std::vector<web_seed_entry> seeds);\n+   std::int64_t total_size () const;\n+   int piece_length () const;\n+   int num_pieces () const;\n+   piece_index_t end_piece () const;\n+   piece_index_t last_piece () const;\n+   index_range<piece_index_t> piece_range () const;\n+   info_hash_t const& info_hashes () const;\n+   sha1_hash info_hash () const noexcept;\n+   bool v2 () const;\n+   bool v1 () const;\n+   int num_files () const;\n+   std::vector<file_slice> map_block (piece_index_t const piece\n+      , std::int64_t offset, int size) const;\n+   peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n+   string_view ssl_cert () const;\n+   bool is_valid () const;\n+   bool priv () const;\n+   bool is_i2p () const;\n+   int piece_size (piece_index_t index) const;\n+   sha1_hash hash_for_piece (piece_index_t index) const;\n+   char const* hash_for_piece_ptr (piece_index_t const index) const;\n+   bool is_loaded () const;\n+   const std::string& name () const;\n+   std::time_t creation_date () const;\n+   const std::string& creator () const;\n+   const std::string& comment () const;\n+   std::vector<std::pair<std::string, int>> const& nodes () const;\n+   void add_node (std::pair<std::string, int> const& node);\n+   bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n+   bdecode_node info (char const* key) const;\n+   span<char const> info_section () const;\n+   span<char const> piece_layer (file_index_t) const;\n+   void free_piece_layers ();\n+};\n+
    \n+[report issue]
    \n+

    torrent_info()

    \n+
    \n+torrent_info (char const* buffer, int size, error_code& ec);\n+torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n+torrent_info (torrent_info const& t);\n+torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+torrent_info (std::string const& filename, error_code& ec);\n+torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n+torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+explicit torrent_info (bdecode_node const& torrent_file);\n+torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+explicit torrent_info (info_hash_t const& info_hash);\n+explicit torrent_info (span<char const> buffer, from_span_t);\n+torrent_info (char const* buffer, int size);\n+explicit torrent_info (std::string const& filename);\n+
    \n+

    The constructor that takes an info-hash will initialize the info-hash\n+to the given value, but leave all other fields empty. This is used\n+internally when downloading torrents without the metadata. The\n+metadata will be created by libtorrent as soon as it has been\n+downloaded from the swarm.

    \n+

    The constructor that takes a bdecode_node will create a torrent_info\n+object from the information found in the given torrent_file. The\n+bdecode_node represents a tree node in an bencoded file. To load an\n+ordinary .torrent file into a bdecode_node, use bdecode().

    \n+

    The version that takes a buffer pointer and a size will decode it as a\n+.torrent file and initialize the torrent_info object for you.

    \n+

    The version that takes a filename will simply load the torrent file\n+and decode it inside the constructor, for convenience. This might not\n+be the most suitable for applications that want to be able to report\n+detailed errors on what might go wrong.

    \n+

    There is an upper limit on the size of the torrent file that will be\n+loaded by the overload taking a filename. If it's important that even\n+very large torrent files are loaded, use one of the other overloads.

    \n+

    The overloads that takes an error_code const& never throws if an\n+error occur, they will simply set the error code to describe what went\n+wrong and not fully initialize the torrent_info object. The overloads\n+that do not take the extra error_code parameter will always throw if\n+an error occurs. These overloads are not available when building\n+without exception support.

    \n+

    The overload that takes a span also needs an extra parameter of\n+type from_span_t to disambiguate the std::string overload for\n+string literals. There is an object in the libtorrent namespace of this\n+type called from_span.

    \n+[report issue]
    \n+
    \n+

    ~torrent_info()

    \n+
    \n+~torrent_info ();\n+
    \n+

    frees all storage associated with this torrent_info object

    \n+\n+[report issue]
    \n+
    \n+

    files() orig_files()

    \n+
    \n+file_storage const& orig_files () const;\n+file_storage const& files () const;\n+
    \n+

    The file_storage object contains the information on how to map the\n+pieces to files. It is separated from the torrent_info object because\n+when creating torrents a storage object needs to be created without\n+having a torrent file. When renaming files in a storage, the storage\n+needs to make its own copy of the file_storage in order to make its\n+mapping differ from the one in the torrent file.

    \n+

    orig_files() returns the original (unmodified) file storage for\n+this torrent. This is used by the web server connection, which needs\n+to request files with the original names. Filename may be changed using\n+torrent_info::rename_file().

    \n+

    For more information on the file_storage object, see the separate\n+document on how to create torrents.

    \n+[report issue]
    \n+
    \n+

    rename_file()

    \n+
    \n+void rename_file (file_index_t index, std::string const& new_filename);\n+
    \n+

    Renames the file with the specified index to the new name. The new\n+filename is reflected by the file_storage returned by files()\n+but not by the one returned by orig_files().

    \n+

    If you want to rename the base name of the torrent (for a multi file\n+torrent), you can copy the file_storage (see files() and\n+orig_files() ), change the name, and then use remap_files().

    \n+

    The new_filename can both be a relative path, in which case the\n+file name is relative to the save_path of the torrent. If the\n+new_filename is an absolute path (i.e. is_complete(new_filename)\n+== true), then the file is detached from the save_path of the\n+torrent. In this case the file is not moved when move_storage() is\n+invoked.

    \n+[report issue]
    \n+
    \n+

    remap_files()

    \n+
    \n+void remap_files (file_storage const& f);\n+
    \n+
    \n+

    Warning

    \n+

    Using remap_files() is discouraged as it's incompatible with v2\n+torrents. This is because the piece boundaries and piece hashes in\n+v2 torrents are intimately tied to the file boundaries. Instead,\n+just rename individual files, or implement a custom disk_interface\n+to customize how to store files.

    \n+
    \n+

    Remaps the file storage to a new file layout. This can be used to, for\n+instance, download all data in a torrent to a single file, or to a\n+number of fixed size sector aligned files, regardless of the number\n+and sizes of the files in the torrent.

    \n+

    The new specified file_storage must have the exact same size as\n+the current one.

    \n+\n+\n+[report issue]
    \n+
    \n+

    add_tracker() clear_trackers() trackers()

    \n+
    \n+void clear_trackers ();\n+void add_tracker (std::string const& url, int tier\n+      , announce_entry::tracker_source source);\n+void add_tracker (std::string const& url, int tier = 0);\n+std::vector<announce_entry> const& trackers () const;\n+
    \n+

    add_tracker() adds a tracker to the announce-list. The tier\n+determines the order in which the trackers are to be tried.\n+The trackers() function will return a sorted vector of\n+announce_entry. Each announce entry contains a string, which is\n+the tracker url, and a tier index. The tier index is the high-level\n+priority. No matter which trackers that works or not, the ones with\n+lower tier will always be tried before the one with higher tier\n+number. For more information, see announce_entry.

    \n+

    trackers() returns all entries from announce-list.

    \n+

    clear_trackers() removes all trackers from announce-list.

    \n+\n+[report issue]
    \n+
    \n+

    similar_torrents() collections()

    \n+
    \n+std::vector<std::string> collections () const;\n+std::vector<sha1_hash> similar_torrents () const;\n+
    \n+

    These two functions are related to BEP 38 (mutable torrents). The\n+vectors returned from these correspond to the "similar" and\n+"collections" keys in the .torrent file. Both info-hashes and\n+collections from within the info-dict and from outside of it are\n+included.

    \n+\n+\n+\n+[report issue]
    \n+
    \n+

    add_url_seed() set_web_seeds() add_http_seed() web_seeds()

    \n+
    \n+std::vector<web_seed_entry> const& web_seeds () const;\n+void add_url_seed (std::string const& url\n+      , std::string const& ext_auth = std::string()\n+      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+void add_http_seed (std::string const& url\n+      , std::string const& extern_auth = std::string()\n+      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+void set_web_seeds (std::vector<web_seed_entry> seeds);\n+
    \n+

    web_seeds() returns all url seeds and http seeds in the torrent.\n+Each entry is a web_seed_entry and may refer to either a url seed\n+or http seed.

    \n+

    add_url_seed() and add_http_seed() adds one url to the list of\n+url/http seeds.

    \n+

    set_web_seeds() replaces all web seeds with the ones specified in\n+the seeds vector.

    \n+

    The extern_auth argument can be used for other authorization\n+schemes than basic HTTP authorization. If set, it will override any\n+username and password found in the URL itself. The string will be sent\n+as the HTTP authorization header's value (without specifying "Basic").

    \n+

    The extra_headers argument defaults to an empty list, but can be\n+used to insert custom HTTP headers in the requests to a specific web\n+seed.

    \n+

    See http seeding for more information.

    \n+[report issue]
    \n+
    \n+

    total_size()

    \n+
    \n+std::int64_t total_size () const;\n+
    \n+

    total_size() returns the total number of bytes the torrent-file\n+represents. Note that this is the number of pieces times the piece\n+size (modulo the last piece possibly being smaller). With pad files,\n+the total size will be larger than the sum of all (regular) file\n+sizes.

    \n+\n+[report issue]
    \n+
    \n+

    num_pieces() piece_length()

    \n+
    \n+int piece_length () const;\n+int num_pieces () const;\n+
    \n+

    piece_length() and num_pieces() returns the number of byte\n+for each piece and the total number of pieces, respectively. The\n+difference between piece_size() and piece_length() is that\n+piece_size() takes the piece index as argument and gives you the\n+exact size of that piece. It will always be the same as\n+piece_length() except in the case of the last piece, which may be\n+smaller.

    \n+\n+\n+[report issue]
    \n+
    \n+

    piece_range() end_piece() last_piece()

    \n+
    \n+piece_index_t end_piece () const;\n+piece_index_t last_piece () const;\n+index_range<piece_index_t> piece_range () const;\n+
    \n+

    last_piece() returns the index to the last piece in the torrent and\n+end_piece() returns the index to the one-past-end piece in the\n+torrent\n+piece_range() returns an implementation-defined type that can be\n+used as the container in a range-for loop. Where the values are the\n+indices of all pieces in the file_storage.

    \n+\n+[report issue]
    \n+
    \n+

    info_hash() info_hashes()

    \n+
    \n+info_hash_t const& info_hashes () const;\n+sha1_hash info_hash () const noexcept;\n+
    \n+

    returns the info-hash of the torrent. For BitTorrent v2 support, use\n+info_hashes() to get an object that may hold both a v1 and v2\n+info-hash

    \n+\n+[report issue]
    \n+
    \n+

    v2() v1()

    \n+
    \n+bool v2 () const;\n+bool v1 () const;\n+
    \n+

    returns whether this torrent has v1 and/or v2 metadata, respectively.\n+Hybrid torrents have both. These are shortcuts for\n+info_hashes().has_v1() and info_hashes().has_v2() calls.

    \n+[report issue]
    \n+
    \n+

    num_files()

    \n+
    \n+int num_files () const;\n+
    \n+

    If you need index-access to files you can use the num_files() along\n+with the file_path(), file_size()-family of functions to access\n+files using indices.

    \n+[report issue]
    \n+
    \n+

    map_block()

    \n+
    \n+std::vector<file_slice> map_block (piece_index_t const piece\n+      , std::int64_t offset, int size) const;\n+
    \n+

    This function will map a piece index, a byte offset within that piece\n+and a size (in bytes) into the corresponding files with offsets where\n+that data for that piece is supposed to be stored. See file_slice.

    \n+[report issue]
    \n+
    \n+

    map_file()

    \n+
    \n+peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n+
    \n+

    This function will map a range in a specific file into a range in the\n+torrent. The file_offset parameter is the offset in the file,\n+given in bytes, where 0 is the start of the file. See peer_request.

    \n+

    The input range is assumed to be valid within the torrent.\n+file_offset + size is not allowed to be greater than the file\n+size. file_index must refer to a valid file, i.e. it cannot be >=\n+num_files().

    \n+[report issue]
    \n+
    \n+

    ssl_cert()

    \n+
    \n+string_view ssl_cert () const;\n+
    \n+

    Returns the SSL root certificate for the torrent, if it is an SSL\n+torrent. Otherwise returns an empty string. The certificate is\n+the public certificate in x509 format.

    \n+[report issue]
    \n+
    \n+

    is_valid()

    \n+
    \n+bool is_valid () const;\n+
    \n+

    returns true if this torrent_info object has a torrent loaded.\n+This is primarily used to determine if a magnet link has had its\n+metadata resolved yet or not.

    \n+[report issue]
    \n+
    \n+

    priv()

    \n+
    \n+bool priv () const;\n+
    \n+

    returns true if this torrent is private. i.e., the client should not\n+advertise itself on the trackerless network (the Kademlia DHT) for this torrent.

    \n+[report issue]
    \n+
    \n+

    is_i2p()

    \n+
    \n+bool is_i2p () const;\n+
    \n+

    returns true if this is an i2p torrent. This is determined by whether\n+or not it has a tracker whose URL domain name ends with ".i2p". i2p\n+torrents disable the DHT and local peer discovery as well as talking\n+to peers over anything other than the i2p network.

    \n+[report issue]
    \n+
    \n+

    piece_size()

    \n+
    \n+int piece_size (piece_index_t index) const;\n+
    \n+

    returns the piece size of file with index. This will be the same as piece_length(),\n+except for the last piece, which may be shorter.

    \n+\n+[report issue]
    \n+
    \n+

    hash_for_piece() hash_for_piece_ptr()

    \n+
    \n+sha1_hash hash_for_piece (piece_index_t index) const;\n+char const* hash_for_piece_ptr (piece_index_t const index) const;\n+
    \n+

    hash_for_piece() takes a piece-index and returns the 20-bytes\n+sha1-hash for that piece and info_hash() returns the 20-bytes\n+sha1-hash for the info-section of the torrent file.\n+hash_for_piece_ptr() returns a pointer to the 20 byte sha1 digest\n+for the piece. Note that the string is not 0-terminated.

    \n+[report issue]
    \n+
    \n+

    name()

    \n+
    \n+const std::string& name () const;\n+
    \n+

    name() returns the name of the torrent.\n+name contains UTF-8 encoded string.

    \n+[report issue]
    \n+
    \n+

    creation_date()

    \n+
    \n+std::time_t creation_date () const;\n+
    \n+

    creation_date() returns the creation date of the torrent as time_t\n+(posix time). If there's no time stamp in the torrent file, 0 is\n+returned.\n+.. posix time: http://www.opengroup.org/onlinepubs/009695399/functions/time.html

    \n+[report issue]
    \n+
    \n+

    creator()

    \n+
    \n+const std::string& creator () const;\n+
    \n+

    creator() returns the creator string in the torrent. If there is\n+no creator string it will return an empty string.

    \n+[report issue]
    \n+
    \n+

    comment()

    \n+
    \n+const std::string& comment () const;\n+
    \n+

    comment() returns the comment associated with the torrent. If\n+there's no comment, it will return an empty string.\n+comment contains UTF-8 encoded string.

    \n+[report issue]
    \n+
    \n+

    nodes()

    \n+
    \n+std::vector<std::pair<std::string, int>> const& nodes () const;\n+
    \n+

    If this torrent contains any DHT nodes, they are put in this vector in\n+their original form (host name and port number).

    \n+[report issue]
    \n+
    \n+

    add_node()

    \n+
    \n+void add_node (std::pair<std::string, int> const& node);\n+
    \n+

    This is used when creating torrent. Use this to add a known DHT node.\n+It may be used, by the client, to bootstrap into the DHT network.

    \n+[report issue]
    \n+
    \n+

    parse_info_section()

    \n+
    \n+bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n+
    \n+

    populates the torrent_info by providing just the info-dict buffer.\n+This is used when loading a torrent from a magnet link for instance,\n+where we only have the info-dict. The bdecode_node e points to a\n+parsed info-dictionary. ec returns an error code if something\n+fails (typically if the info dictionary is malformed).\n+The max_pieces parameter allows limiting the amount of memory\n+dedicated to loading the torrent, and fails for torrents that exceed\n+the limit. To load large torrents, this limit may also need to be\n+raised in settings_pack::max_piece_count and in calls to\n+read_resume_data().

    \n+[report issue]
    \n+
    \n+

    info()

    \n+
    \n+bdecode_node info (char const* key) const;\n+
    \n+

    This function looks up keys from the info-dictionary of the loaded\n+torrent file. It can be used to access extension values put in the\n+.torrent file. If the specified key cannot be found, it returns nullptr.

    \n+[report issue]
    \n+
    \n+

    info_section()

    \n+
    \n+span<char const> info_section () const;\n+
    \n+

    returns a the raw info section of the torrent file.\n+The underlying buffer is still owned by the torrent_info object

    \n+[report issue]
    \n+
    \n+

    piece_layer()

    \n+
    \n+span<char const> piece_layer (file_index_t) const;\n+
    \n+

    return the bytes of the piece layer hashes for the specified file. If\n+the file doesn't have a piece layer, an empty span is returned.\n+The span size is divisible by 32, the size of a SHA-256 hash.\n+If the size of the file is smaller than or equal to the piece size,\n+the files "root hash" is the hash of the file and is not saved\n+separately in the "piece layers" field, but this function still\n+returns the root hash of the file in that case.

    \n+[report issue]
    \n+
    \n+

    free_piece_layers()

    \n+
    \n+void free_piece_layers ();\n+
    \n+

    clears the piece layers from the torrent_info. This is done by the\n+session when a torrent is added, to avoid storing it twice. The piece\n+layer (or other hashes part of the merkle tree) are stored in the\n+internal torrent object.

    \n+

    Bencoding is a common representation in bittorrent used for dictionary,\n+list, int and string hierarchies. It's used to encode .torrent files and\n+some messages in the network protocol. libtorrent also uses it to store\n+settings, resume data and other session state.

    \n+

    Strings in bencoded structures do not necessarily represent text.\n+Strings are raw byte buffers of a certain length. If a string is meant to be\n+interpreted as text, it is required to be UTF-8 encoded. See BEP 3.

    \n+

    The function for decoding bencoded data bdecode(), returning a bdecode_node.\n+This function builds a tree that points back into the original buffer. The\n+returned bdecode_node will not be valid once the buffer it was parsed out of\n+is discarded.

    \n+

    It's possible to construct an entry from a bdecode_node, if a structure needs\n+to be altered and re-encoded.

    \n+[report issue]
    \n+
    \n+
    \n+

    entry

    \n+

    Declared in "libtorrent/entry.hpp"

    \n+

    The entry class represents one node in a bencoded hierarchy. It works as a\n+variant type, it can be either a list, a dictionary (std::map), an integer\n+or a string.

    \n+
    \n+class entry\n+{\n+   data_type type () const;\n+   entry (preformatted_type);\n+   entry (dictionary_type);\n+   entry (list_type);\n+   entry (span<char const>);\n+   entry (integer_type);\n+   entry (U v);\n+   entry (data_type t);\n+   entry (bdecode_node const& n);\n+   entry& operator= (bdecode_node const&) &;\n+   entry& operator= (dictionary_type) &;\n+   entry& operator= (entry&&) & noexcept;\n+   entry& operator= (span<char const>) &;\n+   entry& operator= (list_type) &;\n+   entry& operator= (entry const&) &;\n+   entry& operator= (integer_type) &;\n+   entry& operator= (preformatted_type) &;\n+   entry& operator= (U v) &;\n+   list_type const& list () const;\n+   list_type& list ();\n+   preformatted_type const& preformatted () const;\n+   integer_type& integer ();\n+   integer_type const& integer () const;\n+   dictionary_type const& dict () const;\n+   preformatted_type& preformatted ();\n+   dictionary_type& dict ();\n+   string_type& string ();\n+   string_type const& string () const;\n+   void swap (entry& e);\n+   entry& operator[] (string_view key);\n+   entry const& operator[] (string_view key) const;\n+   entry* find_key (string_view key);\n+   entry const* find_key (string_view key) const;\n+   std::string to_string (bool single_line = false) const;\n+\n+   enum data_type\n+   {\n+      int_t,\n+      string_t,\n+      list_t,\n+      dictionary_t,\n+      undefined_t,\n+      preformatted_t,\n+   };\n+};\n+
    \n+[report issue]
    \n+

    type()

    \n+
    \n+data_type type () const;\n+
    \n+

    returns the concrete type of the entry

    \n+[report issue]
    \n+
    \n+

    entry()

    \n+
    \n+entry (preformatted_type);\n+entry (dictionary_type);\n+entry (list_type);\n+entry (span<char const>);\n+entry (integer_type);\n+
    \n+

    constructors directly from a specific type.\n+The content of the argument is copied into the\n+newly constructed entry

    \n+[report issue]
    \n+
    \n+

    entry()

    \n+
    \n+entry (data_type t);\n+
    \n+

    construct an empty entry of the specified type.\n+see data_type enum.

    \n+[report issue]
    \n+
    \n+

    entry()

    \n+
    \n+entry (bdecode_node const& n);\n+
    \n+

    construct from bdecode_node parsed form (see bdecode())

    \n+[report issue]
    \n+
    \n+

    operator=()

    \n+
    \n+entry& operator= (bdecode_node const&) &;\n+entry& operator= (dictionary_type) &;\n+entry& operator= (entry&&) & noexcept;\n+entry& operator= (span<char const>) &;\n+entry& operator= (list_type) &;\n+entry& operator= (entry const&) &;\n+entry& operator= (integer_type) &;\n+entry& operator= (preformatted_type) &;\n+
    \n+

    copies the structure of the right hand side into this\n+entry.

    \n+\n+\n+\n+\n+[report issue]
    \n+
    \n+

    string() dict() preformatted() list() integer()

    \n+
    \n+list_type const& list () const;\n+list_type& list ();\n+preformatted_type const& preformatted () const;\n+integer_type& integer ();\n+integer_type const& integer () const;\n+dictionary_type const& dict () const;\n+preformatted_type& preformatted ();\n+dictionary_type& dict ();\n+string_type& string ();\n+string_type const& string () const;\n+
    \n+

    The integer(), string(), list() and dict() functions\n+are accessors that return the respective type. If the entry object\n+isn't of the type you request, the accessor will throw\n+system_error. You can ask an entry for its type through the\n+type() function.

    \n+

    If you want to create an entry you give it the type you want it to\n+have in its constructor, and then use one of the non-const accessors\n+to get a reference which you then can assign the value you want it to\n+have.

    \n+

    The typical code to get info from a torrent file will then look like\n+this:

    \n+
    \n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+entry::dictionary_type const& dict = torrent_file.dict();\n+entry::dictionary_type::const_iterator i;\n+i = dict.find("announce");\n+if (i != dict.end())\n+{\n+        std::string tracker_url = i->second.string();\n+        std::cout << tracker_url << "\\n";\n+}\n+
    \n+

    The following code is equivalent, but a little bit shorter:

    \n+
    \n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+if (entry* i = torrent_file.find_key("announce"))\n+{\n+        std::string tracker_url = i->string();\n+        std::cout << tracker_url << "\\n";\n+}\n+
    \n+

    To make it easier to extract information from a torrent file, the\n+class torrent_info exists.

    \n+[report issue]
    \n+
    \n+

    swap()

    \n+
    \n+void swap (entry& e);\n+
    \n+

    swaps the content of this with e.

    \n+[report issue]
    \n+
    \n+

    operator[]()

    \n+
    \n+entry& operator[] (string_view key);\n+entry const& operator[] (string_view key) const;\n+
    \n+

    All of these functions requires the entry to be a dictionary, if it\n+isn't they will throw system_error.

    \n+

    The non-const versions of the operator[] will return a reference\n+to either the existing element at the given key or, if there is no\n+element with the given key, a reference to a newly inserted element at\n+that key.

    \n+

    The const version of operator[] will only return a reference to an\n+existing element at the given key. If the key is not found, it will\n+throw system_error.

    \n+[report issue]
    \n+
    \n+

    find_key()

    \n+
    \n+entry* find_key (string_view key);\n+entry const* find_key (string_view key) const;\n+
    \n+

    These functions requires the entry to be a dictionary, if it isn't\n+they will throw system_error.

    \n+

    They will look for an element at the given key in the dictionary, if\n+the element cannot be found, they will return nullptr. If an element\n+with the given key is found, the return a pointer to it.

    \n+[report issue]
    \n+
    \n+

    to_string()

    \n+
    \n+std::string to_string (bool single_line = false) const;\n+
    \n+

    returns a pretty-printed string representation\n+of the bencoded structure, with JSON-style syntax

    \n+[report issue]
    \n+
    \n+

    enum data_type

    \n+

    Declared in "libtorrent/entry.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    int_t0 
    string_t1 
    list_t2 
    dictionary_t3 
    undefined_t4 
    preformatted_t5 
    \n+[report issue]
    \n+
    \n+
    \n+

    bencode()

    \n+

    Declared in "libtorrent/bencode.hpp"

    \n+
    \n+template<class OutIt> int bencode (OutIt out, const entry& e);\n+
    \n+

    This function will encode data to bencoded form.

    \n+

    The entry class is the internal representation of the bencoded data\n+and it can be used to retrieve information, an entry can also be build by\n+the program and given to bencode() to encode it into the OutIt\n+iterator.

    \n+

    OutIt is an OutputIterator. It's a template and usually\n+instantiated as ostream_iterator or back_insert_iterator. This\n+function assumes the value_type of the iterator is a char.\n+In order to encode entry e into a buffer, do:

    \n+
    \n+std::vector<char> buffer;\n+bencode(std::back_inserter(buf), e);\n+
    \n+[report issue]
    \n+
    \n+

    operator<<()

    \n+

    Declared in "libtorrent/entry.hpp"

    \n+
    \n+inline std::ostream& operator<< (std::ostream& os, const entry& e);\n+
    \n+

    prints the bencoded structure to the ostream as a JSON-style structure.

    \n+[report issue]
    \n+
    \n+

    bdecode_node

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+

    Sometimes it's important to get a non-owning reference to the root node (\n+to be able to copy it as a reference for instance). For that, use the\n+non_owning() member function.

    \n+

    There are 5 different types of nodes, see type_t.

    \n+
    \n+struct bdecode_node\n+{\n+   bdecode_node () = default;\n+   bdecode_node& operator= (bdecode_node const&) &;\n+   bdecode_node (bdecode_node const&);\n+   bdecode_node& operator= (bdecode_node&&) & = default;\n+   bdecode_node (bdecode_node&&) noexcept;\n+   type_t type () const noexcept;\n+   explicit operator bool () const noexcept;\n+   bdecode_node non_owning () const;\n+   span<char const> data_section () const noexcept;\n+   std::ptrdiff_t data_offset () const noexcept;\n+   int list_size () const;\n+   string_view list_string_value_at (int i\n+      , string_view default_val = string_view()) const;\n+   std::int64_t list_int_value_at (int i\n+      , std::int64_t default_val = 0) const;\n+   bdecode_node list_at (int i) const;\n+   bdecode_node dict_find_string (string_view key) const;\n+   std::int64_t dict_find_int_value (string_view key\n+      , std::int64_t default_val = 0) const;\n+   std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n+   bdecode_node dict_find (string_view key) const;\n+   bdecode_node dict_find_int (string_view key) const;\n+   bdecode_node dict_find_dict (string_view key) const;\n+   bdecode_node dict_find_list (string_view key) const;\n+   string_view dict_find_string_value (string_view key\n+      , string_view default_value = string_view()) const;\n+   int dict_size () const;\n+   std::pair<string_view, bdecode_node> dict_at (int i) const;\n+   std::int64_t int_value () const;\n+   int string_length () const;\n+   string_view string_value () const;\n+   char const* string_ptr () const;\n+   std::ptrdiff_t string_offset () const;\n+   void clear ();\n+   void swap (bdecode_node& n);\n+   void reserve (int tokens);\n+   void switch_underlying_buffer (char const* buf) noexcept;\n+   bool has_soft_error (span<char> error) const;\n+\n+   enum type_t\n+   {\n+      none_t,\n+      dict_t,\n+      list_t,\n+      string_t,\n+      int_t,\n+   };\n+};\n+
    \n+[report issue]
    \n+

    bdecode_node()

    \n+
    \n+bdecode_node () = default;\n+
    \n+

    creates a default constructed node, it will have the type none_t.

    \n+\n+[report issue]
    \n+
    \n+

    bdecode_node() operator=()

    \n+
    \n+bdecode_node& operator= (bdecode_node const&) &;\n+bdecode_node (bdecode_node const&);\n+bdecode_node& operator= (bdecode_node&&) & = default;\n+bdecode_node (bdecode_node&&) noexcept;\n+
    \n+

    For owning nodes, the copy will create a copy of the tree, but the\n+underlying buffer remains the same.

    \n+[report issue]
    \n+
    \n+

    type()

    \n+
    \n+type_t type () const noexcept;\n+
    \n+

    the type of this node. See type_t.

    \n+[report issue]
    \n+
    \n+

    bool()

    \n+
    \n+explicit operator bool () const noexcept;\n+
    \n+

    returns true if type() != none_t.

    \n+[report issue]
    \n+
    \n+

    non_owning()

    \n+
    \n+bdecode_node non_owning () const;\n+
    \n+

    return a non-owning reference to this node. This is useful to refer to\n+the root node without copying it in assignments.

    \n+\n+[report issue]
    \n+
    \n+

    data_section() data_offset()

    \n+
    \n+span<char const> data_section () const noexcept;\n+std::ptrdiff_t data_offset () const noexcept;\n+
    \n+

    returns the buffer and length of the section in the original bencoded\n+buffer where this node is defined. For a dictionary for instance, this\n+starts with d and ends with e, and has all the content of the\n+dictionary in between.\n+the data_offset() function returns the byte-offset to this node in,\n+starting from the beginning of the buffer that was parsed.

    \n+\n+\n+\n+[report issue]
    \n+
    \n+

    list_size() list_at() list_int_value_at() list_string_value_at()

    \n+
    \n+int list_size () const;\n+string_view list_string_value_at (int i\n+      , string_view default_val = string_view()) const;\n+std::int64_t list_int_value_at (int i\n+      , std::int64_t default_val = 0) const;\n+bdecode_node list_at (int i) const;\n+
    \n+

    functions with the list_ prefix operate on lists. These functions are\n+only valid if type() == list_t. list_at() returns the item\n+in the list at index i. i may not be greater than or equal to the\n+size of the list. size() returns the size of the list.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+[report issue]
    \n+
    \n+

    dict_find() dict_find_int_value() dict_find_string() dict_find_string_value() dict_at() dict_find_dict() dict_at_node() dict_find_list() dict_find_int() dict_size()

    \n+
    \n+bdecode_node dict_find_string (string_view key) const;\n+std::int64_t dict_find_int_value (string_view key\n+      , std::int64_t default_val = 0) const;\n+std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n+bdecode_node dict_find (string_view key) const;\n+bdecode_node dict_find_int (string_view key) const;\n+bdecode_node dict_find_dict (string_view key) const;\n+bdecode_node dict_find_list (string_view key) const;\n+string_view dict_find_string_value (string_view key\n+      , string_view default_value = string_view()) const;\n+int dict_size () const;\n+std::pair<string_view, bdecode_node> dict_at (int i) const;\n+
    \n+

    Functions with the dict_ prefix operates on dictionaries. They are\n+only valid if type() == dict_t. In case a key you're looking up\n+contains a 0 byte, you cannot use the 0-terminated string overloads,\n+but have to use string_view instead. dict_find_list will return a\n+valid bdecode_node if the key is found _and_ it is a list. Otherwise\n+it will return a default-constructed bdecode_node.

    \n+

    Functions with the _value suffix return the value of the node\n+directly, rather than the nodes. In case the node is not found, or it has\n+a different type, a default value is returned (which can be specified).

    \n+

    dict_at() returns the (key, value)-pair at the specified index in a\n+dictionary. Keys are only allowed to be strings. dict_at_node() also\n+returns the (key, value)-pair, but the key is returned as a\n+bdecode_node (and it will always be a string).

    \n+[report issue]
    \n+
    \n+

    int_value()

    \n+
    \n+std::int64_t int_value () const;\n+
    \n+

    this function is only valid if type() == int_t. It returns the\n+value of the integer.

    \n+\n+\n+\n+[report issue]
    \n+
    \n+

    string_value() string_length() string_ptr() string_offset()

    \n+
    \n+int string_length () const;\n+string_view string_value () const;\n+char const* string_ptr () const;\n+std::ptrdiff_t string_offset () const;\n+
    \n+

    these functions are only valid if type() == string_t. They return\n+the string values. Note that string_ptr() is not 0-terminated.\n+string_length() returns the number of bytes in the string.\n+string_offset() returns the byte offset from the start of the parsed\n+bencoded buffer this string can be found.

    \n+[report issue]
    \n+
    \n+

    clear()

    \n+
    \n+void clear ();\n+
    \n+

    resets the bdecoded_node to a default constructed state. If this is\n+an owning node, the tree is freed and all child nodes are invalidated.

    \n+[report issue]
    \n+
    \n+

    swap()

    \n+
    \n+void swap (bdecode_node& n);\n+
    \n+

    Swap contents.

    \n+[report issue]
    \n+
    \n+

    reserve()

    \n+
    \n+void reserve (int tokens);\n+
    \n+

    preallocate memory for the specified numbers of tokens. This is\n+useful if you know approximately how many tokens are in the file\n+you are about to parse. Doing so will save realloc operations\n+while parsing. You should only call this on the root node, before\n+passing it in to bdecode().

    \n+[report issue]
    \n+
    \n+

    switch_underlying_buffer()

    \n+
    \n+void switch_underlying_buffer (char const* buf) noexcept;\n+
    \n+

    this buffer MUST be identical to the one originally parsed. This\n+operation is only defined on owning root nodes, i.e. the one passed in to\n+decode().

    \n+[report issue]
    \n+
    \n+

    has_soft_error()

    \n+
    \n+bool has_soft_error (span<char> error) const;\n+
    \n+

    returns true if there is a non-fatal error in the bencoding of this node\n+or its children

    \n+[report issue]
    \n+
    \n+

    enum type_t

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    none_t0uninitialized or default constructed. This is also used\n+to indicate that a node was not found in some cases.
    dict_t1a dictionary node. The dict_find_ functions are valid.
    list_t2a list node. The list_ functions are valid.
    string_t3a string node, the string_ functions are valid.
    int_t4an integer node. The int_ functions are valid.
    \n+[report issue]
    \n+
    \n+
    \n+

    print_entry()

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+
    \n+std::string print_entry (bdecode_node const& e\n+   , bool single_line = false, int indent = 0);\n+
    \n+

    print the bencoded structure in a human-readable format to a string\n+that's returned.

    \n+[report issue]
    \n+
    \n+

    bdecode()

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+
    \n+bdecode_node bdecode (span<char const> buffer\n+   , int depth_limit = 100, int token_limit = 2000000);\n+bdecode_node bdecode (span<char const> buffer\n+   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+   , int token_limit = 2000000);\n+int bdecode (char const* start, char const* end, bdecode_node& ret\n+   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+   , int token_limit = 2000000);\n+
    \n+

    This function decodes/parses bdecoded data (for example a .torrent file).\n+The data structure is returned in the ret argument. the buffer to parse\n+is specified by the start of the buffer as well as the end, i.e. one\n+byte past the end. If the buffer fails to parse, the function returns a\n+non-zero value and fills in ec with the error code. The optional\n+argument error_pos, if set to non-nullptr, will be set to the byte offset\n+into the buffer where the parse failure occurred.

    \n+

    depth_limit specifies the max number of nested lists or dictionaries are\n+allowed in the data structure. (This affects the stack usage of the\n+function, be careful not to set it too high).

    \n+

    token_limit is the max number of tokens allowed to be parsed from the\n+buffer. This is simply a sanity check to not have unbounded memory usage.

    \n+

    The resulting bdecode_node is an owning node. That means it will\n+be holding the whole parsed tree. When iterating lists and dictionaries,\n+those bdecode_node objects will simply have references to the root or\n+owning bdecode_node. If the root node is destructed, all other nodes\n+that refer to anything in that tree become invalid.

    \n+

    However, the underlying buffer passed in to this function (start, end)\n+must also remain valid while the bdecoded tree is used. The parsed tree\n+produced by this function does not copy any data out of the buffer, but\n+simply produces references back into it.

    \n+[report issue]
    \n+
    \n+

    stats_metric

    \n+

    Declared in "libtorrent/session_stats.hpp"

    \n+

    describes one statistics metric from the session. For more information,\n+see the session statistics section.

    \n+
    \n+struct stats_metric\n+{\n+   char const* name;\n+   int value_index;\n+   metric_type_t type;\n+};\n+
    \n+[report issue]
    \n+
    name
    \n+
    the name of the counter or gauge
    \n+
    \n+\n+[report issue]
    \n+
    value_index type
    \n+
    the index into the session stats array, where the underlying value of\n+this counter or gauge is found. The session stats array is part of the\n+session_stats_alert object.
    \n+
    \n+[report issue]
    \n+
    \n+

    counters

    \n+

    Declared in "libtorrent/performance_counters.hpp"

    \n+
    \n+struct counters\n+{\n+   counters () ;\n+   counters& operator= (counters const&) & ;\n+   counters (counters const&) ;\n+   std::int64_t operator[] (int i) const ;\n+   std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+   void blend_stats_counter (int c, std::int64_t value, int ratio) ;\n+   void set_value (int c, std::int64_t value) ;\n+};\n+
    \n+\n+[report issue]
    \n+

    operator[]() inc_stats_counter()

    \n+
    \n+std::int64_t operator[] (int i) const ;\n+std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+
    \n+

    returns the new value

    \n+[report issue]
    \n+
    \n+
    \n+

    session_stats_metrics()

    \n+

    Declared in "libtorrent/session_stats.hpp"

    \n+
    \n+std::vector<stats_metric> session_stats_metrics ();\n+
    \n+

    This free function returns the list of available metrics exposed by\n+libtorrent's statistics API. Each metric has a name and a value index.\n+The value index is the index into the array in session_stats_alert where\n+this metric's value can be found when the session stats is sampled (by\n+calling post_session_stats()).

    \n+[report issue]
    \n+
    \n+

    find_metric_idx()

    \n+

    Declared in "libtorrent/session_stats.hpp"

    \n+
    \n+int find_metric_idx (string_view name);\n+
    \n+

    given a name of a metric, this function returns the counter index of it,\n+or -1 if it could not be found. The counter index is the index into the\n+values array returned by session_stats_alert.

    \n+[report issue]
    \n+
    \n+

    enum metric_type_t

    \n+

    Declared in "libtorrent/session_stats.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    counter0 
    gauge1 
    \n

    The pop_alerts() function on session is the main interface for retrieving\n alerts (warnings, messages and errors from libtorrent). If no alerts have\n been posted by libtorrent pop_alerts() will return an empty list.

    \n

    By default, only errors are reported. settings_pack::alert_mask can be\n used to specify which kinds of events should be reported. The alert mask is\n a combination of the alert_category_t flags in the alert class.

    \n

    Every alert belongs to one or more category. There is a cost associated with\n@@ -15042,15 +15930,15 @@\n [report issue]

    \n

    timestamp()

    \n
    \n time_point timestamp () const;\n 
    \n

    a timestamp is automatically created in the constructor

    \n [report issue]
    \n-
    \n+
    \n

    type()

    \n
    \n virtual int type () const noexcept = 0;\n 
    \n

    returns an integer that is unique to this alert type. It can be\n compared against a specific alert by querying a static constant called alert_type\n in the alert. It can be used to determine the run-time type of an alert* in\n@@ -15292,27 +16180,27 @@\n

    Declared in "libtorrent/alert_types.hpp"

    \n

    This is posted as a response to a torrent_handle::rename_file() call, if the rename\n operation succeeds.

    \n
    \n struct file_renamed_alert final : torrent_alert\n {\n    std::string message () const override;\n-   char const* old_name () const;\n    char const* new_name () const;\n+   char const* old_name () const;\n \n    static constexpr alert_category_t static_category  = alert_category::storage;\n    file_index_t const index;\n };\n 
    \n \n [report issue]
    \n

    new_name() old_name()

    \n
    \n-char const* old_name () const;\n char const* new_name () const;\n+char const* old_name () const;\n 
    \n

    returns the new and previous file name, respectively.

    \n [report issue]
    \n
    index
    \n
    refers to the index of the file that was renamed,
    \n
    \n [report issue]
    \n@@ -16035,26 +16923,26 @@\n torrent_handle::move_storage. This is useful to synchronize with the\n actual disk. The storage_path() member return the new path of the\n storage.

    \n
    \n struct storage_moved_alert final : torrent_alert\n {\n    std::string message () const override;\n-   char const* old_path () const;\n    char const* storage_path () const;\n+   char const* old_path () const;\n \n    static constexpr alert_category_t static_category  = alert_category::storage;\n };\n 
    \n \n [report issue]
    \n

    storage_path() old_path()

    \n
    \n-char const* old_path () const;\n char const* storage_path () const;\n+char const* old_path () const;\n 
    \n

    the path the torrent was moved to and from, respectively.

    \n [report issue]
    \n
    \n
    \n

    storage_moved_failed_alert

    \n

    Declared in "libtorrent/alert_types.hpp"

    \n@@ -17692,27 +18580,27 @@\n

    posted in response to a call to session::dht_live_nodes(). It contains the\n live nodes from the DHT routing table of one of the DHT nodes running\n locally.

    \n
    \n struct dht_live_nodes_alert final : alert\n {\n    std::string message () const override;\n-   std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n    int num_nodes () const;\n+   std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n \n    static constexpr alert_category_t static_category  = alert_category::dht;\n    sha1_hash node_id;\n };\n 
    \n \n [report issue]
    \n

    nodes() num_nodes()

    \n
    \n-std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n int num_nodes () const;\n+std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n 
    \n

    the number of nodes in the routing table and the actual nodes.

    \n [report issue]
    \n
    node_id
    \n
    the local DHT node's node-ID this routing table belongs to
    \n
    \n [report issue]
    \n@@ -17753,17 +18641,17 @@\n static constexpr alert_category_t static_category = alert_category::dht_operation;\n sha1_hash node_id;\n aux::noexcept_movable<udp::endpoint> endpoint;\n time_duration const interval;\n int const num_infohashes;\n };\n
\n-\n-[report issue]
\n-

samples() num_samples()

\n+\n+[report issue]
\n+

num_samples() samples()

\n
\n std::vector<sha1_hash> samples () const;\n int num_samples () const;\n 
\n

returns the number of info-hashes returned by the node, as well as the\n actual info-hashes. num_samples() is more efficient than\n samples().size().

\n@@ -17947,14 +18835,23 @@\n \n [report issue]
\n
metadata
\n
the metadata that was received by one of the torrents in conflict.\n One way to resolve the conflict is to remove both failing torrents\n and re-add it using this metadata
\n
\n+[report issue]
\n+
\n+

operation_name()

\n+

Declared in "libtorrent/operations.hpp"

\n+
\n+char const* operation_name (operation_t op);\n+
\n+

maps an operation id (from peer_error_alert and peer_disconnected_alert)\n+to its name. See operation_t for the constants

\n [report issue]
\n
\n

alert_cast()

\n

Declared in "libtorrent/alert.hpp"

\n
\n template <typename T> T const* alert_cast (alert const* a);\n template <typename T> T* alert_cast (alert* a);\n@@ -17962,23 +18859,14 @@\n 

When you get an alert, you can use alert_cast<> to attempt to cast the\n pointer to a specific alert type, in order to query it for more\n information.

\n
\n

Note

\n

alert_cast<> can only cast to an exact alert type, not a base class

\n
\n-[report issue]
\n-
\n-

operation_name()

\n-

Declared in "libtorrent/operations.hpp"

\n-
\n-char const* operation_name (operation_t op);\n-
\n-

maps an operation id (from peer_error_alert and peer_disconnected_alert)\n-to its name. See operation_t for the constants

\n [report issue]
\n
\n

enum operation_t

\n

Declared in "libtorrent/operations.hpp"

\n \n \n \n@@ -18330,1069 +19218,14 @@\n

The full bitmask, representing all available categories.

\n

since the enum is signed, make sure this isn't\n interpreted as -1. For instance, boost.python\n does that and fails when assigning it to an\n unsigned parameter.

\n
\n \n-

Bencoding is a common representation in bittorrent used for dictionary,\n-list, int and string hierarchies. It's used to encode .torrent files and\n-some messages in the network protocol. libtorrent also uses it to store\n-settings, resume data and other session state.

\n-

Strings in bencoded structures do not necessarily represent text.\n-Strings are raw byte buffers of a certain length. If a string is meant to be\n-interpreted as text, it is required to be UTF-8 encoded. See BEP 3.

\n-

The function for decoding bencoded data bdecode(), returning a bdecode_node.\n-This function builds a tree that points back into the original buffer. The\n-returned bdecode_node will not be valid once the buffer it was parsed out of\n-is discarded.

\n-

It's possible to construct an entry from a bdecode_node, if a structure needs\n-to be altered and re-encoded.

\n-[report issue]\n-
\n-

entry

\n-

Declared in "libtorrent/entry.hpp"

\n-

The entry class represents one node in a bencoded hierarchy. It works as a\n-variant type, it can be either a list, a dictionary (std::map), an integer\n-or a string.

\n-
\n-class entry\n-{\n-   data_type type () const;\n-   entry (dictionary_type);\n-   entry (list_type);\n-   entry (span<char const>);\n-   entry (preformatted_type);\n-   entry (integer_type);\n-   entry (U v);\n-   entry (data_type t);\n-   entry (bdecode_node const& n);\n-   entry& operator= (preformatted_type) &;\n-   entry& operator= (dictionary_type) &;\n-   entry& operator= (entry const&) &;\n-   entry& operator= (span<char const>) &;\n-   entry& operator= (entry&&) & noexcept;\n-   entry& operator= (integer_type) &;\n-   entry& operator= (list_type) &;\n-   entry& operator= (bdecode_node const&) &;\n-   entry& operator= (U v) &;\n-   string_type const& string () const;\n-   string_type& string ();\n-   list_type const& list () const;\n-   dictionary_type const& dict () const;\n-   preformatted_type& preformatted ();\n-   preformatted_type const& preformatted () const;\n-   integer_type const& integer () const;\n-   integer_type& integer ();\n-   list_type& list ();\n-   dictionary_type& dict ();\n-   void swap (entry& e);\n-   entry const& operator[] (string_view key) const;\n-   entry& operator[] (string_view key);\n-   entry* find_key (string_view key);\n-   entry const* find_key (string_view key) const;\n-   std::string to_string (bool single_line = false) const;\n-\n-   enum data_type\n-   {\n-      int_t,\n-      string_t,\n-      list_t,\n-      dictionary_t,\n-      undefined_t,\n-      preformatted_t,\n-   };\n-};\n-
\n-[report issue]
\n-

type()

\n-
\n-data_type type () const;\n-
\n-

returns the concrete type of the entry

\n-[report issue]
\n-
\n-

entry()

\n-
\n-entry (dictionary_type);\n-entry (list_type);\n-entry (span<char const>);\n-entry (preformatted_type);\n-entry (integer_type);\n-
\n-

constructors directly from a specific type.\n-The content of the argument is copied into the\n-newly constructed entry

\n-[report issue]
\n-
\n-

entry()

\n-
\n-entry (data_type t);\n-
\n-

construct an empty entry of the specified type.\n-see data_type enum.

\n-[report issue]
\n-
\n-

entry()

\n-
\n-entry (bdecode_node const& n);\n-
\n-

construct from bdecode_node parsed form (see bdecode())

\n-[report issue]
\n-
\n-

operator=()

\n-
\n-entry& operator= (preformatted_type) &;\n-entry& operator= (dictionary_type) &;\n-entry& operator= (entry const&) &;\n-entry& operator= (span<char const>) &;\n-entry& operator= (entry&&) & noexcept;\n-entry& operator= (integer_type) &;\n-entry& operator= (list_type) &;\n-entry& operator= (bdecode_node const&) &;\n-
\n-

copies the structure of the right hand side into this\n-entry.

\n-\n-\n-\n-\n-[report issue]
\n-
\n-

string() list() integer() dict() preformatted()

\n-
\n-string_type const& string () const;\n-string_type& string ();\n-list_type const& list () const;\n-dictionary_type const& dict () const;\n-preformatted_type& preformatted ();\n-preformatted_type const& preformatted () const;\n-integer_type const& integer () const;\n-integer_type& integer ();\n-list_type& list ();\n-dictionary_type& dict ();\n-
\n-

The integer(), string(), list() and dict() functions\n-are accessors that return the respective type. If the entry object\n-isn't of the type you request, the accessor will throw\n-system_error. You can ask an entry for its type through the\n-type() function.

\n-

If you want to create an entry you give it the type you want it to\n-have in its constructor, and then use one of the non-const accessors\n-to get a reference which you then can assign the value you want it to\n-have.

\n-

The typical code to get info from a torrent file will then look like\n-this:

\n-
\n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-entry::dictionary_type const& dict = torrent_file.dict();\n-entry::dictionary_type::const_iterator i;\n-i = dict.find("announce");\n-if (i != dict.end())\n-{\n-        std::string tracker_url = i->second.string();\n-        std::cout << tracker_url << "\\n";\n-}\n-
\n-

The following code is equivalent, but a little bit shorter:

\n-
\n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-if (entry* i = torrent_file.find_key("announce"))\n-{\n-        std::string tracker_url = i->string();\n-        std::cout << tracker_url << "\\n";\n-}\n-
\n-

To make it easier to extract information from a torrent file, the\n-class torrent_info exists.

\n-[report issue]
\n-
\n-

swap()

\n-
\n-void swap (entry& e);\n-
\n-

swaps the content of this with e.

\n-[report issue]
\n-
\n-

operator[]()

\n-
\n-entry const& operator[] (string_view key) const;\n-entry& operator[] (string_view key);\n-
\n-

All of these functions requires the entry to be a dictionary, if it\n-isn't they will throw system_error.

\n-

The non-const versions of the operator[] will return a reference\n-to either the existing element at the given key or, if there is no\n-element with the given key, a reference to a newly inserted element at\n-that key.

\n-

The const version of operator[] will only return a reference to an\n-existing element at the given key. If the key is not found, it will\n-throw system_error.

\n-[report issue]
\n-
\n-

find_key()

\n-
\n-entry* find_key (string_view key);\n-entry const* find_key (string_view key) const;\n-
\n-

These functions requires the entry to be a dictionary, if it isn't\n-they will throw system_error.

\n-

They will look for an element at the given key in the dictionary, if\n-the element cannot be found, they will return nullptr. If an element\n-with the given key is found, the return a pointer to it.

\n-[report issue]
\n-
\n-

to_string()

\n-
\n-std::string to_string (bool single_line = false) const;\n-
\n-

returns a pretty-printed string representation\n-of the bencoded structure, with JSON-style syntax

\n-[report issue]
\n-
\n-

enum data_type

\n-

Declared in "libtorrent/entry.hpp"

\n-
\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
int_t0 
string_t1 
list_t2 
dictionary_t3 
undefined_t4 
preformatted_t5 
\n-[report issue]
\n-
\n-
\n-

bencode()

\n-

Declared in "libtorrent/bencode.hpp"

\n-
\n-template<class OutIt> int bencode (OutIt out, const entry& e);\n-
\n-

This function will encode data to bencoded form.

\n-

The entry class is the internal representation of the bencoded data\n-and it can be used to retrieve information, an entry can also be build by\n-the program and given to bencode() to encode it into the OutIt\n-iterator.

\n-

OutIt is an OutputIterator. It's a template and usually\n-instantiated as ostream_iterator or back_insert_iterator. This\n-function assumes the value_type of the iterator is a char.\n-In order to encode entry e into a buffer, do:

\n-
\n-std::vector<char> buffer;\n-bencode(std::back_inserter(buf), e);\n-
\n-[report issue]
\n-
\n-

operator<<()

\n-

Declared in "libtorrent/entry.hpp"

\n-
\n-inline std::ostream& operator<< (std::ostream& os, const entry& e);\n-
\n-

prints the bencoded structure to the ostream as a JSON-style structure.

\n-[report issue]
\n-
\n-

ip_filter

\n-

Declared in "libtorrent/ip_filter.hpp"

\n-

The ip_filter class is a set of rules that uniquely categorizes all\n-ip addresses as allowed or disallowed. The default constructor creates\n-a single rule that allows all addresses (0.0.0.0 - 255.255.255.255 for\n-the IPv4 range, and the equivalent range covering all addresses for the\n-IPv6 range).

\n-

A default constructed ip_filter does not filter any address.

\n-
\n-struct ip_filter\n-{\n-   ip_filter& operator= (ip_filter&&);\n-   ip_filter& operator= (ip_filter const&);\n-   ~ip_filter ();\n-   ip_filter (ip_filter&&);\n-   ip_filter ();\n-   ip_filter (ip_filter const&);\n-   bool empty () const;\n-   void add_rule (address const& first, address const& last, std::uint32_t flags);\n-   std::uint32_t access (address const& addr) const;\n-   filter_tuple_t export_filter () const;\n-\n-   enum access_flags\n-   {\n-      blocked,\n-   };\n-};\n-
\n-[report issue]
\n-

empty()

\n-
\n-bool empty () const;\n-
\n-

returns true if the filter does not contain any rules

\n-[report issue]
\n-
\n-

add_rule()

\n-
\n-void add_rule (address const& first, address const& last, std::uint32_t flags);\n-
\n-

Adds a rule to the filter. first and last defines a range of\n-ip addresses that will be marked with the given flags. The flags\n-can currently be 0, which means allowed, or ip_filter::blocked, which\n-means disallowed.

\n-

precondition:\n-first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()

\n-

postcondition:\n-access(x) == flags for every x in the range [first, last]

\n-

This means that in a case of overlapping ranges, the last one applied takes\n-precedence.

\n-[report issue]
\n-
\n-

access()

\n-
\n-std::uint32_t access (address const& addr) const;\n-
\n-

Returns the access permissions for the given address (addr). The permission\n-can currently be 0 or ip_filter::blocked. The complexity of this operation\n-is O(log n), where n is the minimum number of non-overlapping ranges to describe\n-the current filter.

\n-[report issue]
\n-
\n-

export_filter()

\n-
\n-filter_tuple_t export_filter () const;\n-
\n-

This function will return the current state of the filter in the minimum number of\n-ranges possible. They are sorted from ranges in low addresses to high addresses. Each\n-entry in the returned vector is a range with the access control specified in its\n-flags field.

\n-

The return value is a tuple containing two range-lists. One for IPv4 addresses\n-and one for IPv6 addresses.

\n-[report issue]
\n-
\n-

enum access_flags

\n-

Declared in "libtorrent/ip_filter.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
blocked1indicates that IPs in this range should not be connected\n-to nor accepted as incoming connections
\n-[report issue]
\n-
\n-
\n-

port_filter

\n-

Declared in "libtorrent/ip_filter.hpp"

\n-

the port filter maps non-overlapping port ranges to flags. This\n-is primarily used to indicate whether a range of ports should\n-be connected to or not. The default is to have the full port\n-range (0-65535) set to flag 0.

\n-
\n-class port_filter\n-{\n-   port_filter& operator= (port_filter&&);\n-   port_filter& operator= (port_filter const&);\n-   port_filter ();\n-   port_filter (port_filter&&);\n-   ~port_filter ();\n-   port_filter (port_filter const&);\n-   void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n-   std::uint32_t access (std::uint16_t port) const;\n-\n-   enum access_flags\n-   {\n-      blocked,\n-   };\n-};\n-
\n-[report issue]
\n-

add_rule()

\n-
\n-void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n-
\n-

set the flags for the specified port range (first, last) to\n-flags overwriting any existing rule for those ports. The range\n-is inclusive, i.e. the port last also has the flag set on it.

\n-[report issue]
\n-
\n-

access()

\n-
\n-std::uint32_t access (std::uint16_t port) const;\n-
\n-

test the specified port (port) for whether it is blocked\n-or not. The returned value is the flags set for this port.\n-see access_flags.

\n-[report issue]
\n-
\n-

enum access_flags

\n-

Declared in "libtorrent/ip_filter.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
blocked1this flag indicates that destination ports in the\n-range should not be connected to
\n-[report issue]
\n-
\n-
\n-

hasher

\n-

Declared in "libtorrent/hasher.hpp"

\n-

this is a SHA-1 hash class.

\n-

You use it by first instantiating it, then call update() to feed it\n-with data. i.e. you don't have to keep the entire buffer of which you want to\n-create the hash in memory. You can feed the hasher parts of it at a time. When\n-You have fed the hasher with all the data, you call final() and it\n-will return the sha1-hash of the data.

\n-

The constructor that takes a char const* and an integer will construct the\n-sha1 context and feed it the data passed in.

\n-

If you want to reuse the hasher object once you have created a hash, you have to\n-call reset() to reinitialize it.

\n-

The built-in software version of sha1-algorithm was implemented\n-by Steve Reid and released as public domain.\n-For more info, see src/sha1.cpp.

\n-
\n-class hasher\n-{\n-   hasher ();\n-   hasher& operator= (hasher const&) &;\n-   explicit hasher (span<char const> data);\n-   hasher (char const* data, int len);\n-   hasher (hasher const&);\n-   hasher& update (char const* data, int len);\n-   hasher& update (span<char const> data);\n-   sha1_hash final ();\n-   void reset ();\n-};\n-
\n-\n-[report issue]
\n-

operator=() hasher()

\n-
\n-hasher& operator= (hasher const&) &;\n-explicit hasher (span<char const> data);\n-hasher (char const* data, int len);\n-hasher (hasher const&);\n-
\n-

this is the same as default constructing followed by a call to\n-update(data, len).

\n-[report issue]
\n-
\n-

update()

\n-
\n-hasher& update (char const* data, int len);\n-hasher& update (span<char const> data);\n-
\n-

append the following bytes to what is being hashed

\n-[report issue]
\n-
\n-

final()

\n-
\n-sha1_hash final ();\n-
\n-

returns the SHA-1 digest of the buffers previously passed to\n-update() and the hasher constructor.

\n-[report issue]
\n-
\n-

reset()

\n-
\n-void reset ();\n-
\n-

restore the hasher state to be as if the hasher has just been\n-default constructed.

\n-[report issue]
\n-
\n-
\n-

hasher256

\n-

Declared in "libtorrent/hasher.hpp"

\n-
\n-class hasher256\n-{\n-   hasher256 ();\n-   explicit hasher256 (span<char const> data);\n-   hasher256 (hasher256 const&);\n-   hasher256& operator= (hasher256 const&) &;\n-   hasher256 (char const* data, int len);\n-   hasher256& update (char const* data, int len);\n-   hasher256& update (span<char const> data);\n-   sha256_hash final ();\n-   void reset ();\n-   ~hasher256 ();\n-};\n-
\n-\n-[report issue]
\n-

hasher256() operator=()

\n-
\n-explicit hasher256 (span<char const> data);\n-hasher256 (hasher256 const&);\n-hasher256& operator= (hasher256 const&) &;\n-hasher256 (char const* data, int len);\n-
\n-

this is the same as default constructing followed by a call to\n-update(data, len).

\n-[report issue]
\n-
\n-

update()

\n-
\n-hasher256& update (char const* data, int len);\n-hasher256& update (span<char const> data);\n-
\n-

append the following bytes to what is being hashed

\n-[report issue]
\n-
\n-

final()

\n-
\n-sha256_hash final ();\n-
\n-

returns the SHA-1 digest of the buffers previously passed to\n-update() and the hasher constructor.

\n-[report issue]
\n-
\n-

reset()

\n-
\n-void reset ();\n-
\n-

restore the hasher state to be as if the hasher has just been\n-default constructed.

\n-[report issue]
\n-
\n-
\n-

bitfield

\n-

Declared in "libtorrent/bitfield.hpp"

\n-

The bitfield type stores any number of bits as a bitfield\n-in a heap allocated array.

\n-
\n-struct bitfield\n-{\n-   bitfield (int bits, bool val);\n-   bitfield (char const* b, int bits);\n-   explicit bitfield (int bits);\n-   bitfield (bitfield&& rhs) noexcept = default;\n-   bitfield (bitfield const& rhs);\n-   bitfield () noexcept = default;\n-   void assign (char const* b, int const bits);\n-   bool get_bit (int index) const noexcept;\n-   bool operator[] (int index) const noexcept;\n-   void set_bit (int index) noexcept;\n-   void clear_bit (int index) noexcept;\n-   bool all_set () const noexcept;\n-   bool none_set () const noexcept;\n-   int size () const noexcept;\n-   int num_words () const noexcept;\n-   bool empty () const noexcept;\n-   char const* data () const noexcept;\n-   char* data () noexcept;\n-   void swap (bitfield& rhs) noexcept;\n-   int count () const noexcept;\n-   int find_first_set () const noexcept;\n-   int find_last_clear () const noexcept;\n-};\n-
\n-[report issue]
\n-

bitfield()

\n-
\n-bitfield (int bits, bool val);\n-bitfield (char const* b, int bits);\n-explicit bitfield (int bits);\n-bitfield (bitfield&& rhs) noexcept = default;\n-bitfield (bitfield const& rhs);\n-bitfield () noexcept = default;\n-
\n-

constructs a new bitfield. The default constructor creates an empty\n-bitfield. bits is the size of the bitfield (specified in bits).\n-val is the value to initialize the bits to. If not specified\n-all bits are initialized to 0.

\n-

The constructor taking a pointer b and bits copies a bitfield\n-from the specified buffer, and bits number of bits (rounded up to\n-the nearest byte boundary).

\n-[report issue]
\n-
\n-

assign()

\n-
\n-void assign (char const* b, int const bits);\n-
\n-

copy bitfield from buffer b of bits number of bits, rounded up to\n-the nearest byte boundary.

\n-\n-[report issue]
\n-
\n-

get_bit() operator[]()

\n-
\n-bool get_bit (int index) const noexcept;\n-bool operator[] (int index) const noexcept;\n-
\n-

query bit at index. Returns true if bit is 1, otherwise false.

\n-\n-[report issue]
\n-
\n-

set_bit() clear_bit()

\n-
\n-void set_bit (int index) noexcept;\n-void clear_bit (int index) noexcept;\n-
\n-

set bit at index to 0 (clear_bit) or 1 (set_bit).

\n-[report issue]
\n-
\n-

all_set()

\n-
\n-bool all_set () const noexcept;\n-
\n-

returns true if all bits in the bitfield are set

\n-[report issue]
\n-
\n-

none_set()

\n-
\n-bool none_set () const noexcept;\n-
\n-

returns true if no bit in the bitfield is set

\n-[report issue]
\n-
\n-

size()

\n-
\n-int size () const noexcept;\n-
\n-

returns the size of the bitfield in bits.

\n-[report issue]
\n-
\n-

num_words()

\n-
\n-int num_words () const noexcept;\n-
\n-

returns the number of 32 bit words are needed to represent all bits in\n-this bitfield.

\n-[report issue]
\n-
\n-

empty()

\n-
\n-bool empty () const noexcept;\n-
\n-

returns true if the bitfield has zero size.

\n-[report issue]
\n-
\n-

data()

\n-
\n-char const* data () const noexcept;\n-char* data () noexcept;\n-
\n-

returns a pointer to the internal buffer of the bitfield, or\n-nullptr if it's empty.

\n-[report issue]
\n-
\n-

swap()

\n-
\n-void swap (bitfield& rhs) noexcept;\n-
\n-

swaps the bit-fields two variables refer to

\n-[report issue]
\n-
\n-

count()

\n-
\n-int count () const noexcept;\n-
\n-

count the number of bits in the bitfield that are set to 1.

\n-[report issue]
\n-
\n-

find_first_set()

\n-
\n-int find_first_set () const noexcept;\n-
\n-

returns the index of the first set bit in the bitfield, i.e. 1 bit.

\n-[report issue]
\n-
\n-

find_last_clear()

\n-
\n-int find_last_clear () const noexcept;\n-
\n-

returns the index to the last cleared bit in the bitfield, i.e. 0 bit.

\n-[report issue]
\n-
\n-
\n-

bdecode_node

\n-

Declared in "libtorrent/bdecode.hpp"

\n-

Sometimes it's important to get a non-owning reference to the root node (\n-to be able to copy it as a reference for instance). For that, use the\n-non_owning() member function.

\n-

There are 5 different types of nodes, see type_t.

\n-
\n-struct bdecode_node\n-{\n-   bdecode_node () = default;\n-   bdecode_node& operator= (bdecode_node const&) &;\n-   bdecode_node (bdecode_node&&) noexcept;\n-   bdecode_node& operator= (bdecode_node&&) & = default;\n-   bdecode_node (bdecode_node const&);\n-   type_t type () const noexcept;\n-   explicit operator bool () const noexcept;\n-   bdecode_node non_owning () const;\n-   span<char const> data_section () const noexcept;\n-   std::ptrdiff_t data_offset () const noexcept;\n-   bdecode_node list_at (int i) const;\n-   string_view list_string_value_at (int i\n-      , string_view default_val = string_view()) const;\n-   int list_size () const;\n-   std::int64_t list_int_value_at (int i\n-      , std::int64_t default_val = 0) const;\n-   std::pair<string_view, bdecode_node> dict_at (int i) const;\n-   bdecode_node dict_find_dict (string_view key) const;\n-   bdecode_node dict_find (string_view key) const;\n-   std::int64_t dict_find_int_value (string_view key\n-      , std::int64_t default_val = 0) const;\n-   bdecode_node dict_find_list (string_view key) const;\n-   bdecode_node dict_find_int (string_view key) const;\n-   string_view dict_find_string_value (string_view key\n-      , string_view default_value = string_view()) const;\n-   int dict_size () const;\n-   std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n-   bdecode_node dict_find_string (string_view key) const;\n-   std::int64_t int_value () const;\n-   string_view string_value () const;\n-   int string_length () const;\n-   char const* string_ptr () const;\n-   std::ptrdiff_t string_offset () const;\n-   void clear ();\n-   void swap (bdecode_node& n);\n-   void reserve (int tokens);\n-   void switch_underlying_buffer (char const* buf) noexcept;\n-   bool has_soft_error (span<char> error) const;\n-\n-   enum type_t\n-   {\n-      none_t,\n-      dict_t,\n-      list_t,\n-      string_t,\n-      int_t,\n-   };\n-};\n-
\n-[report issue]
\n-

bdecode_node()

\n-
\n-bdecode_node () = default;\n-
\n-

creates a default constructed node, it will have the type none_t.

\n-\n-[report issue]
\n-
\n-

operator=() bdecode_node()

\n-
\n-bdecode_node& operator= (bdecode_node const&) &;\n-bdecode_node (bdecode_node&&) noexcept;\n-bdecode_node& operator= (bdecode_node&&) & = default;\n-bdecode_node (bdecode_node const&);\n-
\n-

For owning nodes, the copy will create a copy of the tree, but the\n-underlying buffer remains the same.

\n-[report issue]
\n-
\n-

type()

\n-
\n-type_t type () const noexcept;\n-
\n-

the type of this node. See type_t.

\n-[report issue]
\n-
\n-

bool()

\n-
\n-explicit operator bool () const noexcept;\n-
\n-

returns true if type() != none_t.

\n-[report issue]
\n-
\n-

non_owning()

\n-
\n-bdecode_node non_owning () const;\n-
\n-

return a non-owning reference to this node. This is useful to refer to\n-the root node without copying it in assignments.

\n-\n-[report issue]
\n-
\n-

data_offset() data_section()

\n-
\n-span<char const> data_section () const noexcept;\n-std::ptrdiff_t data_offset () const noexcept;\n-
\n-

returns the buffer and length of the section in the original bencoded\n-buffer where this node is defined. For a dictionary for instance, this\n-starts with d and ends with e, and has all the content of the\n-dictionary in between.\n-the data_offset() function returns the byte-offset to this node in,\n-starting from the beginning of the buffer that was parsed.

\n-\n-\n-\n-[report issue]
\n-
\n-

list_string_value_at() list_size() list_int_value_at() list_at()

\n-
\n-bdecode_node list_at (int i) const;\n-string_view list_string_value_at (int i\n-      , string_view default_val = string_view()) const;\n-int list_size () const;\n-std::int64_t list_int_value_at (int i\n-      , std::int64_t default_val = 0) const;\n-
\n-

functions with the list_ prefix operate on lists. These functions are\n-only valid if type() == list_t. list_at() returns the item\n-in the list at index i. i may not be greater than or equal to the\n-size of the list. size() returns the size of the list.

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-[report issue]
\n-
\n-

dict_find() dict_find_list() dict_find_string() dict_size() dict_find_dict() dict_find_int_value() dict_at() dict_find_int() dict_find_string_value() dict_at_node()

\n-
\n-std::pair<string_view, bdecode_node> dict_at (int i) const;\n-bdecode_node dict_find_dict (string_view key) const;\n-bdecode_node dict_find (string_view key) const;\n-std::int64_t dict_find_int_value (string_view key\n-      , std::int64_t default_val = 0) const;\n-bdecode_node dict_find_list (string_view key) const;\n-bdecode_node dict_find_int (string_view key) const;\n-string_view dict_find_string_value (string_view key\n-      , string_view default_value = string_view()) const;\n-int dict_size () const;\n-std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n-bdecode_node dict_find_string (string_view key) const;\n-
\n-

Functions with the dict_ prefix operates on dictionaries. They are\n-only valid if type() == dict_t. In case a key you're looking up\n-contains a 0 byte, you cannot use the 0-terminated string overloads,\n-but have to use string_view instead. dict_find_list will return a\n-valid bdecode_node if the key is found _and_ it is a list. Otherwise\n-it will return a default-constructed bdecode_node.

\n-

Functions with the _value suffix return the value of the node\n-directly, rather than the nodes. In case the node is not found, or it has\n-a different type, a default value is returned (which can be specified).

\n-

dict_at() returns the (key, value)-pair at the specified index in a\n-dictionary. Keys are only allowed to be strings. dict_at_node() also\n-returns the (key, value)-pair, but the key is returned as a\n-bdecode_node (and it will always be a string).

\n-[report issue]
\n-
\n-

int_value()

\n-
\n-std::int64_t int_value () const;\n-
\n-

this function is only valid if type() == int_t. It returns the\n-value of the integer.

\n-\n-\n-\n-[report issue]
\n-
\n-

string_length() string_ptr() string_offset() string_value()

\n-
\n-string_view string_value () const;\n-int string_length () const;\n-char const* string_ptr () const;\n-std::ptrdiff_t string_offset () const;\n-
\n-

these functions are only valid if type() == string_t. They return\n-the string values. Note that string_ptr() is not 0-terminated.\n-string_length() returns the number of bytes in the string.\n-string_offset() returns the byte offset from the start of the parsed\n-bencoded buffer this string can be found.

\n-[report issue]
\n-
\n-

clear()

\n-
\n-void clear ();\n-
\n-

resets the bdecoded_node to a default constructed state. If this is\n-an owning node, the tree is freed and all child nodes are invalidated.

\n-[report issue]
\n-
\n-

swap()

\n-
\n-void swap (bdecode_node& n);\n-
\n-

Swap contents.

\n-[report issue]
\n-
\n-

reserve()

\n-
\n-void reserve (int tokens);\n-
\n-

preallocate memory for the specified numbers of tokens. This is\n-useful if you know approximately how many tokens are in the file\n-you are about to parse. Doing so will save realloc operations\n-while parsing. You should only call this on the root node, before\n-passing it in to bdecode().

\n-[report issue]
\n-
\n-

switch_underlying_buffer()

\n-
\n-void switch_underlying_buffer (char const* buf) noexcept;\n-
\n-

this buffer MUST be identical to the one originally parsed. This\n-operation is only defined on owning root nodes, i.e. the one passed in to\n-decode().

\n-[report issue]
\n-
\n-

has_soft_error()

\n-
\n-bool has_soft_error (span<char> error) const;\n-
\n-

returns true if there is a non-fatal error in the bencoding of this node\n-or its children

\n-[report issue]
\n-
\n-

enum type_t

\n-

Declared in "libtorrent/bdecode.hpp"

\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
namevaluedescription
none_t0uninitialized or default constructed. This is also used\n-to indicate that a node was not found in some cases.
dict_t1a dictionary node. The dict_find_ functions are valid.
list_t2a list node. The list_ functions are valid.
string_t3a string node, the string_ functions are valid.
int_t4an integer node. The int_ functions are valid.
\n-[report issue]
\n-
\n-
\n-

print_entry()

\n-

Declared in "libtorrent/bdecode.hpp"

\n-
\n-std::string print_entry (bdecode_node const& e\n-   , bool single_line = false, int indent = 0);\n-
\n-

print the bencoded structure in a human-readable format to a string\n-that's returned.

\n-[report issue]
\n-
\n-

bdecode()

\n-

Declared in "libtorrent/bdecode.hpp"

\n-
\n-bdecode_node bdecode (span<char const> buffer\n-   , int depth_limit = 100, int token_limit = 2000000);\n-bdecode_node bdecode (span<char const> buffer\n-   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n-   , int token_limit = 2000000);\n-int bdecode (char const* start, char const* end, bdecode_node& ret\n-   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n-   , int token_limit = 2000000);\n-
\n-

This function decodes/parses bdecoded data (for example a .torrent file).\n-The data structure is returned in the ret argument. the buffer to parse\n-is specified by the start of the buffer as well as the end, i.e. one\n-byte past the end. If the buffer fails to parse, the function returns a\n-non-zero value and fills in ec with the error code. The optional\n-argument error_pos, if set to non-nullptr, will be set to the byte offset\n-into the buffer where the parse failure occurred.

\n-

depth_limit specifies the max number of nested lists or dictionaries are\n-allowed in the data structure. (This affects the stack usage of the\n-function, be careful not to set it too high).

\n-

token_limit is the max number of tokens allowed to be parsed from the\n-buffer. This is simply a sanity check to not have unbounded memory usage.

\n-

The resulting bdecode_node is an owning node. That means it will\n-be holding the whole parsed tree. When iterating lists and dictionaries,\n-those bdecode_node objects will simply have references to the root or\n-owning bdecode_node. If the root node is destructed, all other nodes\n-that refer to anything in that tree become invalid.

\n-

However, the underlying buffer passed in to this function (start, end)\n-must also remain valid while the bdecoded tree is used. The parsed tree\n-produced by this function does not copy any data out of the buffer, but\n-simply produces references back into it.

\n [report issue]
\n
\n

torrent_status

\n

Declared in "libtorrent/torrent_status.hpp"

\n

holds a snapshot of the status of a torrent, as queried by\n torrent_handle::status().

\n
\n@@ -19777,15 +19610,15 @@\n currently connected to.\n \n [report issue]
\n
num_peers
\n
the number of peers this torrent currently is connected to. Peer\n connections that are in the half-open state (is attempting to connect)\n or are queued for later connection attempt do not count. Although they\n-are visible in the peer list when you call get_peer_info().
\n+are visible in the peer list when you call get_peer_info().\n
\n \n [report issue]
\n
num_complete num_incomplete
\n
if the tracker sends scrape info in its announce reply, these fields\n will be set to the total number of peers that have the whole file and\n the total number of peers that are still downloading. set to -1 if the\n@@ -19961,14 +19794,181 @@\n asking for the payload.
\n
\n [report issue]
\n
flags
\n
reflects several of the torrent's flags. For more\n information, see torrent_handle::flags().
\n
\n+[report issue]
\n+
\n+
\n+

ip_filter

\n+

Declared in "libtorrent/ip_filter.hpp"

\n+

The ip_filter class is a set of rules that uniquely categorizes all\n+ip addresses as allowed or disallowed. The default constructor creates\n+a single rule that allows all addresses (0.0.0.0 - 255.255.255.255 for\n+the IPv4 range, and the equivalent range covering all addresses for the\n+IPv6 range).

\n+

A default constructed ip_filter does not filter any address.

\n+
\n+struct ip_filter\n+{\n+   ip_filter& operator= (ip_filter&&);\n+   ip_filter (ip_filter&&);\n+   ip_filter& operator= (ip_filter const&);\n+   ip_filter (ip_filter const&);\n+   ip_filter ();\n+   ~ip_filter ();\n+   bool empty () const;\n+   void add_rule (address const& first, address const& last, std::uint32_t flags);\n+   std::uint32_t access (address const& addr) const;\n+   filter_tuple_t export_filter () const;\n+\n+   enum access_flags\n+   {\n+      blocked,\n+   };\n+};\n+
\n+[report issue]
\n+

empty()

\n+
\n+bool empty () const;\n+
\n+

returns true if the filter does not contain any rules

\n+[report issue]
\n+
\n+

add_rule()

\n+
\n+void add_rule (address const& first, address const& last, std::uint32_t flags);\n+
\n+

Adds a rule to the filter. first and last defines a range of\n+ip addresses that will be marked with the given flags. The flags\n+can currently be 0, which means allowed, or ip_filter::blocked, which\n+means disallowed.

\n+

precondition:\n+first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()

\n+

postcondition:\n+access(x) == flags for every x in the range [first, last]

\n+

This means that in a case of overlapping ranges, the last one applied takes\n+precedence.

\n+[report issue]
\n+
\n+

access()

\n+
\n+std::uint32_t access (address const& addr) const;\n+
\n+

Returns the access permissions for the given address (addr). The permission\n+can currently be 0 or ip_filter::blocked. The complexity of this operation\n+is O(log n), where n is the minimum number of non-overlapping ranges to describe\n+the current filter.

\n+[report issue]
\n+
\n+

export_filter()

\n+
\n+filter_tuple_t export_filter () const;\n+
\n+

This function will return the current state of the filter in the minimum number of\n+ranges possible. They are sorted from ranges in low addresses to high addresses. Each\n+entry in the returned vector is a range with the access control specified in its\n+flags field.

\n+

The return value is a tuple containing two range-lists. One for IPv4 addresses\n+and one for IPv6 addresses.

\n+[report issue]
\n+
\n+

enum access_flags

\n+

Declared in "libtorrent/ip_filter.hpp"

\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
namevaluedescription
blocked1indicates that IPs in this range should not be connected\n+to nor accepted as incoming connections
\n+[report issue]
\n+
\n+
\n+

port_filter

\n+

Declared in "libtorrent/ip_filter.hpp"

\n+

the port filter maps non-overlapping port ranges to flags. This\n+is primarily used to indicate whether a range of ports should\n+be connected to or not. The default is to have the full port\n+range (0-65535) set to flag 0.

\n+
\n+class port_filter\n+{\n+   port_filter (port_filter&&);\n+   ~port_filter ();\n+   port_filter& operator= (port_filter const&);\n+   port_filter ();\n+   port_filter& operator= (port_filter&&);\n+   port_filter (port_filter const&);\n+   void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n+   std::uint32_t access (std::uint16_t port) const;\n+\n+   enum access_flags\n+   {\n+      blocked,\n+   };\n+};\n+
\n+[report issue]
\n+

add_rule()

\n+
\n+void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n+
\n+

set the flags for the specified port range (first, last) to\n+flags overwriting any existing rule for those ports. The range\n+is inclusive, i.e. the port last also has the flag set on it.

\n+[report issue]
\n+
\n+

access()

\n+
\n+std::uint32_t access (std::uint16_t port) const;\n+
\n+

test the specified port (port) for whether it is blocked\n+or not. The returned value is the flags set for this port.\n+see access_flags.

\n+[report issue]
\n+
\n+

enum access_flags

\n+

Declared in "libtorrent/ip_filter.hpp"

\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
namevaluedescription
blocked1this flag indicates that destination ports in the\n+range should not be connected to
\n [report issue]
\n
\n
\n

dht_storage_counters

\n

Declared in "libtorrent/kademlia/dht_storage.hpp"

\n

This structure hold the relevant counters for the storage

\n
\n@@ -20220,25 +20220,14 @@\n 
nodes
\n
the bootstrap nodes saved from the buckets node
\n \n [report issue]
\n
nodes6
\n
the bootstrap nodes saved from the IPv6 buckets node
\n
\n-[report issue]
\n-
\n-

dht_default_storage_constructor()

\n-

Declared in "libtorrent/kademlia/dht_storage.hpp"

\n-
\n-std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (\n-   settings_interface const& settings);\n-
\n-

constructor for the default DHT storage. The DHT storage is responsible\n-for maintaining peers and mutable and immutable items announced and\n-stored/put to the DHT node.

\n [report issue]
\n
\n

sign_mutable_item()

\n

Declared in "libtorrent/kademlia/item.hpp"

\n
\n signature sign_mutable_item (\n    span<char const> v\n@@ -20249,14 +20238,25 @@\n 
\n

given a byte range v and an optional byte range salt, a\n sequence number, public key pk (must be 32 bytes) and a secret key\n sk (must be 64 bytes), this function produces a signature which\n is written into a 64 byte buffer pointed to by sig. The caller\n is responsible for allocating the destination buffer that's passed in\n as the sig argument. Typically it would be allocated on the stack.

\n+[report issue]
\n+
\n+

dht_default_storage_constructor()

\n+

Declared in "libtorrent/kademlia/dht_storage.hpp"

\n+
\n+std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (\n+   settings_interface const& settings);\n+
\n+

constructor for the default DHT storage. The DHT storage is responsible\n+for maintaining peers and mutable and immutable items announced and\n+stored/put to the DHT node.

\n [report issue]
\n
\n

announce_flags_t

\n

Declared in "libtorrent/kademlia/announce_flags.hpp"

\n
\n
seed
\n
announce to DHT as a seed
\n@@ -20273,23 +20273,23 @@\n
\n \n [report issue]
\n
\n

write_resume_data() write_resume_data_buf()

\n

Declared in "libtorrent/write_resume_data.hpp"

\n
\n-std::vector<char> write_resume_data_buf (add_torrent_params const& atp);\n entry write_resume_data (add_torrent_params const& atp);\n+std::vector<char> write_resume_data_buf (add_torrent_params const& atp);\n 
\n

this function turns the resume data in an add_torrent_params object\n into a bencoded structure

\n-\n-[report issue]
\n-
\n-

write_torrent_file() write_torrent_file_buf()

\n+\n+[report issue]
\n+
\n+

write_torrent_file_buf() write_torrent_file()

\n

Declared in "libtorrent/write_resume_data.hpp"

\n
\n entry write_torrent_file (add_torrent_params const& atp, write_torrent_flags_t flags);\n std::vector<char> write_torrent_file_buf (add_torrent_params const& atp\n    , write_torrent_flags_t flags);\n entry write_torrent_file (add_torrent_params const& atp);\n 
\n@@ -20309,17 +20309,17 @@\n

Declared in "libtorrent/read_resume_data.hpp"

\n
\n add_torrent_params read_resume_data (span<char const> buffer\n    , error_code& ec, load_torrent_limits const& cfg = {});\n add_torrent_params read_resume_data (span<char const> buffer\n    , load_torrent_limits const& cfg = {});\n add_torrent_params read_resume_data (bdecode_node const& rd\n-   , int piece_limit = 0x200000);\n-add_torrent_params read_resume_data (bdecode_node const& rd\n    , error_code& ec, int piece_limit = 0x200000);\n+add_torrent_params read_resume_data (bdecode_node const& rd\n+   , int piece_limit = 0x200000);\n 
\n

these functions are used to parse resume data and populate the appropriate\n fields in an add_torrent_params object. This object can then be used to add\n the actual torrent_info object to and pass to session::add_torrent() or\n session::async_add_torrent().

\n

If the client wants to override any field that was loaded from the resume\n data, e.g. save_path, those fields must be changed after loading resume\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,52 +4,91 @@\n \n \n \n [libtorrent_logo]\n Version: 2.0.8\n home\n Table of contents\n- * add_torrent_params\n- * client_data_t\n- o client_data_t()\n- o operator=()_void*()_const*()\n- * storage_error\n- o bool()\n- o file()\n- * libtorrent_category()\n- * http_category()\n- * socks_category()\n- * upnp_category()\n- * pcp_category()\n- * bdecode_category()\n- * i2p_category()\n- * gzip_category()\n- * enum_error_code_enum\n- * enum_http_errors\n- * enum_socks_error_code\n- * enum_error_code_enum\n- * enum_pcp_errors\n- * enum_error_code_enum\n- * enum_i2p_error_code\n- * enum_error_code_enum\n- * stats_metric\n- * counters\n- o inc_stats_counter()_operator[]()\n- * session_stats_metrics()\n- * find_metric_idx()\n- * enum_metric_type_t\n- * peer_class_info\n- * peer_class_type_filter\n- o add()_remove()\n- o disallow()_allow()\n- o apply()\n- o enum_socket_type_t\n+ * announce_infohash\n+ * announce_endpoint\n+ * announce_entry\n+ o ~announce_entry()_announce_entry()_operator=()\n+ o enum_tracker_source\n+ * peer_info\n+ * peer_request\n+ o operator==()\n+ * piece_block\n+ * info_hash_t\n+ o info_hash_t()\n+ o has()_has_v1()_has_v2()\n+ o get()\n+ o get_best()\n+ o for_each()\n+ * version()\n+ * make_magnet_uri()\n+ * parse_magnet_uri()\n+ * load_torrent_buffer()_load_torrent_file()_load_torrent_parsed()\n+ * truncate_files()\n+ * enum_socket_type_t\n+ * enum_connection_type\n+ * enum_portmap_transport\n+ * enum_portmap_protocol\n+ * enum_protocol_version\n+ * enum_event_t\n+ * int\n+ * char_const*\n+ * std::uint64_t\n+ * pex_flags_t\n+ * download_priority_t\n+ * torrent_flags_t\n+ * file_slice\n+ * file_storage\n+ o is_valid()\n+ o reserve()\n+ o add_file()_add_file_borrow()\n+ o rename_file()\n+ o map_block()\n+ o map_file()\n+ o num_files()\n+ o end_file()\n+ o file_range()\n+ o total_size()\n+ o set_num_pieces()_num_pieces()\n+ o end_piece()\n+ o last_piece()\n+ o piece_range()\n+ o piece_length()_set_piece_length()\n+ o piece_size()\n+ o piece_size2()\n+ o blocks_in_piece2()\n+ o name()_set_name()\n+ o swap()\n+ o canonicalize()\n+ o file_path()_mtime()_pad_file_at()_symlink()_file_offset()_root_ptr\n+ ()_hash()_file_name()_root()_file_size()\n+ o file_num_pieces()_file_num_blocks()_file_piece_range()\n+ o file_first_block_node()_file_first_piece_node()\n+ o file_path_hash()\n+ o all_path_hashes()\n+ o file_flags()\n+ o file_absolute_path()\n+ o file_index_at_piece()_file_index_at_offset()\n+ o file_index_for_root()\n+ o piece_index_at_file()\n+ o sanitize_symlinks()\n+ o v2()\n+ * storage_params\n+ * mmap_disk_io_constructor()\n+ * posix_disk_io_constructor()\n+ * disabled_disk_io_constructor()\n+ * default_disk_io_constructor()\n+ * enum_storage_mode_t\n+ * enum_status_t\n+ * enum_move_flags_t\n * settings_interface\n- * disk_observer\n- o on_disk()\n * open_file_state\n * disk_interface\n o new_torrent()\n o remove_torrent()\n o async_read()_async_write()\n o async_hash()\n o async_hash2()\n@@ -73,40 +112,71 @@\n o disk_buffer_holder()\n o ~disk_buffer_holder()\n o data()\n o reset()\n o swap()\n o is_mutable()\n o bool()\n+ * disk_observer\n+ o on_disk()\n * file_open_mode_t\n * settings_pack\n- o set_int()_set_str()_set_bool()\n+ o set_int()_set_bool()_set_str()\n o has_val()\n o clear()\n o clear()\n- o get_str()_get_bool()_get_int()\n+ o get_bool()_get_int()_get_str()\n o enum_type_bases\n o enum_mmap_write_mode_t\n o enum_suggest_mode_t\n o enum_choking_algorithm_t\n o enum_seed_choking_algorithm_t\n o enum_io_buffer_mode_t\n o enum_bandwidth_mixed_algo_t\n o enum_enc_policy\n o enum_enc_level\n o enum_proxy_type_t\n * setting_by_name()_name_for_setting()\n * default_settings()\n- * high_performance_seed()_min_memory_usage()\n * generate_fingerprint()\n+ * min_memory_usage()_high_performance_seed()\n+ * peer_class_info\n+ * peer_class_type_filter\n+ o remove()_add()\n+ o disallow()_allow()\n+ o apply()\n+ o enum_socket_type_t\n+ * bitfield\n+ o bitfield()\n+ o assign()\n+ o operator[]()_get_bit()\n+ o clear_bit()_set_bit()\n+ o all_set()\n+ o none_set()\n+ o size()\n+ o num_words()\n+ o empty()\n+ o data()\n+ o swap()\n+ o count()\n+ o find_first_set()\n+ o find_last_clear()\n+ * hasher\n+ o hasher()_operator=()\n+ o update()\n+ o final()\n+ o reset()\n+ * hasher256\n+ o hasher256()_operator=()\n+ o update()\n+ o final()\n+ o reset()\n * a_word_of_caution\n * plugin-interface\n * custom_alerts\n- * peer_connection_handle\n- * bt_peer_connection_handle\n * plugin\n o implemented_features()\n o new_torrent()\n o added()\n o abort()\n o on_dht_request()\n o on_alert()\n@@ -114,263 +184,150 @@\n o on_tick()\n o get_unchoke_priority()\n o load_state()\n * torrent_plugin\n o new_connection()\n o on_piece_failed()_on_piece_pass()\n o tick()\n- o on_resume()_on_pause()\n+ o on_pause()_on_resume()\n o on_files_checked()\n o on_state()\n o on_add_peer()\n * peer_plugin\n o type()\n o add_handshake()\n o on_disconnect()\n o on_connected()\n o on_handshake()\n o on_extension_handshake()\n- o on_interested()_on_not_interested()_on_have()_on_allowed_fast()\n- on_have_none()_on_unchoke()_on_have_all()_on_dont_have()_on_request\n- ()_on_choke()_on_bitfield()\n+ o on_bitfield()_on_have()_on_dont_have()_on_have_none()_on_request()\n+ on_choke()_on_interested()_on_have_all()_on_allowed_fast()\n+ on_not_interested()_on_unchoke()\n o on_piece()\n- o sent_not_interested()_sent_unchoke()_sent_interested()_sent_have()\n- sent_piece()\n+ o sent_have()_sent_interested()_sent_piece()_sent_not_interested()\n+ sent_unchoke()\n o sent_payload()\n o can_disconnect()\n o on_extended()\n o on_unknown_message()\n o on_piece_failed()_on_piece_pass()\n o tick()\n o write_request()\n * crypto_plugin\n o decrypt()\n+ * peer_connection_handle\n+ * bt_peer_connection_handle\n * create_ut_metadata_plugin()\n- * create_smart_ban_plugin()\n * create_ut_pex_plugin()\n- * session_proxy\n- o session_proxy()_~session_proxy()_operator=()\n- * session\n- o session()\n- o session()\n- o ~session()\n- o abort()\n+ * create_smart_ban_plugin()\n * session_handle\n o is_valid()\n o session_state()\n- o get_torrent_status()_refresh_torrent_status()\n+ o refresh_torrent_status()_get_torrent_status()\n o post_torrent_updates()\n o post_session_stats()\n o post_dht_stats()\n o set_dht_state()\n o find_torrent()_get_torrents()\n- o add_torrent()_async_add_torrent()\n- o resume()_is_paused()_pause()\n+ o async_add_torrent()_add_torrent()\n+ o resume()_pause()_is_paused()\n o is_dht_running()\n o set_dht_storage()\n o add_dht_node()\n o dht_get_item()\n o dht_get_item()\n o dht_put_item()\n o dht_put_item()\n- o dht_announce()_dht_get_peers()\n+ o dht_get_peers()_dht_announce()\n o dht_live_nodes()\n o dht_sample_infohashes()\n o dht_direct_request()\n o add_extension()\n o get_ip_filter()_set_ip_filter()\n o set_port_filter()\n- o is_listening()_listen_port()_ssl_listen_port()\n- o set_peer_class_filter()_get_peer_class_filter()\n+ o listen_port()_ssl_listen_port()_is_listening()\n+ o get_peer_class_filter()_set_peer_class_filter()\n o set_peer_class_type_filter()_get_peer_class_type_filter()\n o create_peer_class()\n o delete_peer_class()\n o set_peer_class()_get_peer_class()\n o remove_torrent()\n- o get_settings()_apply_settings()\n- o pop_alerts()_set_alert_notify()_wait_for_alert()\n- o delete_port_mapping()_add_port_mapping()\n+ o apply_settings()_get_settings()\n+ o pop_alerts()_wait_for_alert()_set_alert_notify()\n+ o add_port_mapping()_delete_port_mapping()\n o reopen_network_sockets()\n o native_handle()\n+ * session_proxy\n+ o session_proxy()_~session_proxy()_operator=()\n+ * session\n+ o session()\n+ o session()\n+ o ~session()\n+ o abort()\n * session_params\n o session_params()\n o session_params()\n- * write_session_params_buf()_read_session_params()_write_session_params()\n- * peer_info\n- * peer_request\n- o operator==()\n- * piece_block\n- * info_hash_t\n- o info_hash_t()\n- o has_v1()_has_v2()_has()\n- o get()\n- o get_best()\n- o for_each()\n- * truncate_files()\n- * version()\n- * make_magnet_uri()\n- * parse_magnet_uri()\n- * load_torrent_buffer()_load_torrent_parsed()_load_torrent_file()\n- * enum_event_t\n- * enum_connection_type\n- * enum_protocol_version\n- * enum_portmap_transport\n- * enum_portmap_protocol\n- * enum_socket_type_t\n- * torrent_flags_t\n- * int\n- * char_const*\n- * std::uint64_t\n- * pex_flags_t\n- * download_priority_t\n- * web_seed_entry\n- o operator==()\n- o operator<()\n- o enum_type_t\n- * load_torrent_limits\n- * torrent_info\n- o torrent_info()\n- o ~torrent_info()\n- o files()_orig_files()\n- o rename_file()\n- o remap_files()\n- o trackers()_clear_trackers()_add_tracker()\n- o similar_torrents()_collections()\n- o add_url_seed()_web_seeds()_add_http_seed()_set_web_seeds()\n- o total_size()\n- o piece_length()_num_pieces()\n- o piece_range()_end_piece()_last_piece()\n- o info_hashes()_info_hash()\n- o v2()_v1()\n- o num_files()\n- o map_block()\n- o map_file()\n- o ssl_cert()\n- o is_valid()\n- o priv()\n- o is_i2p()\n- o piece_size()\n- o hash_for_piece_ptr()_hash_for_piece()\n- o name()\n- o creation_date()\n- o creator()\n- o comment()\n- o nodes()\n- o add_node()\n- o parse_info_section()\n- o info()\n- o info_section()\n- o piece_layer()\n- o free_piece_layers()\n- * announce_infohash\n- * announce_endpoint\n- * announce_entry\n- o announce_entry()_operator=()_~announce_entry()\n- o enum_tracker_source\n+ * write_session_params()_write_session_params_buf()_read_session_params()\n * block_info\n- o set_peer()_peer()\n+ o peer()_set_peer()\n o enum_block_state_t\n * partial_piece_info\n * torrent_handle\n o torrent_handle()\n o add_piece()\n o read_piece()\n o have_piece()\n o get_peer_info()\n o status()\n o get_download_queue()\n o reset_piece_deadline()_set_piece_deadline()_clear_piece_deadlines()\n o file_progress()\n o file_status()\n o clear_error()\n- o trackers()_replace_trackers()_add_tracker()\n- o add_url_seed()_url_seeds()_remove_url_seed()\n- o add_http_seed()_remove_http_seed()_http_seeds()\n+ o trackers()_add_tracker()_replace_trackers()\n+ o add_url_seed()_remove_url_seed()_url_seeds()\n+ o http_seeds()_add_http_seed()_remove_http_seed()\n o add_extension()\n o set_metadata()\n o is_valid()\n o resume()_pause()\n o unset_flags()_set_flags()_flags()\n o flush_cache()\n o force_recheck()\n o save_resume_data()\n o need_save_resume_data()\n- o queue_position_up()_queue_position_down()_queue_position_bottom()\n- queue_position_top()_queue_position()\n+ o queue_position_top()_queue_position_up()_queue_position()\n+ queue_position_bottom()_queue_position_down()\n o queue_position_set()\n o set_ssl_certificate()_set_ssl_certificate_buffer()\n- o torrent_file_with_hashes()_torrent_file()\n+ o torrent_file()_torrent_file_with_hashes()\n o piece_layers()\n o piece_availability()\n- o piece_priority()_get_piece_priorities()_prioritize_pieces()\n- o file_priority()_get_file_priorities()_prioritize_files()\n- o force_dht_announce()_force_reannounce()_force_lsd_announce()\n+ o prioritize_pieces()_piece_priority()_get_piece_priorities()\n+ o prioritize_files()_get_file_priorities()_file_priority()\n+ o force_lsd_announce()_force_reannounce()_force_dht_announce()\n o scrape_tracker()\n- o set_upload_limit()_set_download_limit()_download_limit()\n- upload_limit()\n+ o set_download_limit()_upload_limit()_set_upload_limit()\n+ download_limit()\n o connect_peer()\n o clear_peers()\n o set_max_uploads()_max_uploads()\n- o set_max_connections()_max_connections()\n+ o max_connections()_set_max_connections()\n o move_storage()\n o rename_file()\n- o info_hashes()_info_hash()\n- o operator==()_operator!=()_operator<()\n+ o info_hash()_info_hashes()\n+ o operator<()_operator==()_operator!=()\n o id()\n o native_handle()\n o userdata()\n o in_session()\n * hash_value()\n- * storage_params\n- * file_slice\n- * file_storage\n- o is_valid()\n- o reserve()\n- o add_file_borrow()_add_file()\n- o rename_file()\n- o map_block()\n- o map_file()\n- o num_files()\n- o end_file()\n- o file_range()\n- o total_size()\n- o num_pieces()_set_num_pieces()\n- o end_piece()\n- o last_piece()\n- o piece_range()\n- o piece_length()_set_piece_length()\n- o piece_size()\n- o piece_size2()\n- o blocks_in_piece2()\n- o name()_set_name()\n- o swap()\n- o canonicalize()\n- o pad_file_at()_root()_file_size()_file_offset()_hash()_file_path()\n- symlink()_mtime()_file_name()_root_ptr()\n- o file_num_pieces()_file_num_blocks()_file_piece_range()\n- o file_first_block_node()_file_first_piece_node()\n- o file_path_hash()\n- o all_path_hashes()\n- o file_flags()\n- o file_absolute_path()\n- o file_index_at_piece()_file_index_at_offset()\n- o file_index_for_root()\n- o piece_index_at_file()\n- o sanitize_symlinks()\n- o v2()\n- * mmap_disk_io_constructor()\n- * default_disk_io_constructor()\n- * disabled_disk_io_constructor()\n- * posix_disk_io_constructor()\n- * enum_storage_mode_t\n- * enum_status_t\n- * enum_move_flags_t\n * create_torrent\n o create_torrent()\n- o generate()_generate_buf()\n+ o generate_buf()_generate()\n o files()\n o set_comment()\n o set_creator()\n o set_creation_date()\n o set_hash()\n o set_hash2()\n o add_url_seed()_add_http_seed()\n@@ -379,18 +336,121 @@\n o set_root_cert()\n o priv()_set_priv()\n o num_pieces()\n o piece_range()\n o file_range()\n o file_piece_range()\n o total_size()\n- o piece_length()_piece_size()\n+ o piece_size()_piece_length()\n o add_similar_torrent()_add_collection()\n * add_files()\n * set_piece_hashes()\n+ * client_data_t\n+ o client_data_t()\n+ o const*()_operator=()_void*()\n+ * add_torrent_params\n+ * storage_error\n+ o bool()\n+ o file()\n+ * i2p_category()\n+ * libtorrent_category()\n+ * http_category()\n+ * bdecode_category()\n+ * gzip_category()\n+ * pcp_category()\n+ * socks_category()\n+ * upnp_category()\n+ * enum_i2p_error_code\n+ * enum_error_code_enum\n+ * enum_http_errors\n+ * enum_error_code_enum\n+ * enum_error_code_enum\n+ * enum_pcp_errors\n+ * enum_socks_error_code\n+ * enum_error_code_enum\n+ * web_seed_entry\n+ o operator==()\n+ o operator<()\n+ o enum_type_t\n+ * load_torrent_limits\n+ * torrent_info\n+ o torrent_info()\n+ o ~torrent_info()\n+ o files()_orig_files()\n+ o rename_file()\n+ o remap_files()\n+ o add_tracker()_clear_trackers()_trackers()\n+ o similar_torrents()_collections()\n+ o add_url_seed()_set_web_seeds()_add_http_seed()_web_seeds()\n+ o total_size()\n+ o num_pieces()_piece_length()\n+ o piece_range()_end_piece()_last_piece()\n+ o info_hash()_info_hashes()\n+ o v2()_v1()\n+ o num_files()\n+ o map_block()\n+ o map_file()\n+ o ssl_cert()\n+ o is_valid()\n+ o priv()\n+ o is_i2p()\n+ o piece_size()\n+ o hash_for_piece()_hash_for_piece_ptr()\n+ o name()\n+ o creation_date()\n+ o creator()\n+ o comment()\n+ o nodes()\n+ o add_node()\n+ o parse_info_section()\n+ o info()\n+ o info_section()\n+ o piece_layer()\n+ o free_piece_layers()\n+ * entry\n+ o type()\n+ o entry()\n+ o entry()\n+ o entry()\n+ o operator=()\n+ o string()_dict()_preformatted()_list()_integer()\n+ o swap()\n+ o operator[]()\n+ o find_key()\n+ o to_string()\n+ o enum_data_type\n+ * bencode()\n+ * operator<<()\n+ * bdecode_node\n+ o bdecode_node()\n+ o bdecode_node()_operator=()\n+ o type()\n+ o bool()\n+ o non_owning()\n+ o data_section()_data_offset()\n+ o list_size()_list_at()_list_int_value_at()_list_string_value_at()\n+ o dict_find()_dict_find_int_value()_dict_find_string()\n+ dict_find_string_value()_dict_at()_dict_find_dict()_dict_at_node()\n+ dict_find_list()_dict_find_int()_dict_size()\n+ o int_value()\n+ o string_value()_string_length()_string_ptr()_string_offset()\n+ o clear()\n+ o swap()\n+ o reserve()\n+ o switch_underlying_buffer()\n+ o has_soft_error()\n+ o enum_type_t\n+ * print_entry()\n+ * bdecode()\n+ * stats_metric\n+ * counters\n+ o operator[]()_inc_stats_counter()\n+ * session_stats_metrics()\n+ * find_metric_idx()\n+ * enum_metric_type_t\n * alert\n o timestamp()\n o type()\n o what()\n o message()\n o category()\n * dht_routing_bucket\n@@ -507,101 +567,41 @@\n * dht_direct_response_alert\n * picker_log_alert\n * session_error_alert\n * dht_live_nodes_alert\n o nodes()_num_nodes()\n * session_stats_header_alert\n * dht_sample_infohashes_alert\n- o samples()_num_samples()\n+ o num_samples()_samples()\n o num_nodes()\n o nodes()\n * block_uploaded_alert\n * alerts_dropped_alert\n * socks5_alert\n * file_prio_alert\n * oversized_file_alert\n * torrent_conflict_alert\n- * alert_cast()\n * operation_name()\n+ * alert_cast()\n * enum_operation_t\n * int\n * alert_category_t\n- * entry\n- o type()\n- o entry()\n- o entry()\n- o entry()\n- o operator=()\n- o string()_list()_integer()_dict()_preformatted()\n- o swap()\n- o operator[]()\n- o find_key()\n- o to_string()\n- o enum_data_type\n- * bencode()\n- * operator<<()\n+ * torrent_status\n+ o operator==()\n+ o enum_state_t\n * ip_filter\n o empty()\n o add_rule()\n o access()\n o export_filter()\n o enum_access_flags\n * port_filter\n o add_rule()\n o access()\n o enum_access_flags\n- * hasher\n- o operator=()_hasher()\n- o update()\n- o final()\n- o reset()\n- * hasher256\n- o hasher256()_operator=()\n- o update()\n- o final()\n- o reset()\n- * bitfield\n- o bitfield()\n- o assign()\n- o get_bit()_operator[]()\n- o set_bit()_clear_bit()\n- o all_set()\n- o none_set()\n- o size()\n- o num_words()\n- o empty()\n- o data()\n- o swap()\n- o count()\n- o find_first_set()\n- o find_last_clear()\n- * bdecode_node\n- o bdecode_node()\n- o operator=()_bdecode_node()\n- o type()\n- o bool()\n- o non_owning()\n- o data_offset()_data_section()\n- o list_string_value_at()_list_size()_list_int_value_at()_list_at()\n- o dict_find()_dict_find_list()_dict_find_string()_dict_size()\n- dict_find_dict()_dict_find_int_value()_dict_at()_dict_find_int()\n- dict_find_string_value()_dict_at_node()\n- o int_value()\n- o string_length()_string_ptr()_string_offset()_string_value()\n- o clear()\n- o swap()\n- o reserve()\n- o switch_underlying_buffer()\n- o has_soft_error()\n- o enum_type_t\n- * print_entry()\n- * bdecode()\n- * torrent_status\n- o operator==()\n- o enum_state_t\n * dht_storage_counters\n o reset()\n * dht_storage_interface\n o update_node_ids()\n o get_peers()\n o announce_peer()\n o get_immutable_item()\n@@ -609,1078 +609,1444 @@\n o get_mutable_item_seq()\n o get_mutable_item()\n o put_mutable_item()\n o get_infohashes_sample()\n o tick()\n o counters()\n * dht_state\n- * dht_default_storage_constructor()\n * sign_mutable_item()\n+ * dht_default_storage_constructor()\n * announce_flags_t\n * write_resume_data()_write_resume_data_buf()\n- * write_torrent_file()_write_torrent_file_buf()\n+ * write_torrent_file_buf()_write_torrent_file()\n * read_resume_data()\n * write_torrent_flags_t\n * ed25519_create_seed()\n * ed25519_create_keypair()\n * ed25519_sign()\n * ed25519_verify()\n * ed25519_add_scalar()\n * ed25519_key_exchange()\n [report_issue]\n-****** add_torrent_params ******\n-Declared in \"libtorrent/add_torrent_params.hpp\"\n-The add_torrent_params contains all the information in a .torrent file along\n-with all information necessary to add that torrent to a session. The key fields\n-when adding a torrent are:\n- * ti - the immutable info-dict part of the torrent\n- * info_hash - when you don't have the metadata (.torrent file). This\n- uniquely identifies the torrent and can validate the info-dict when\n- received from the swarm.\n-In order to add a torrent to a session, one of those fields must be set in\n-addition to save_path. The add_torrent_params object can then be passed into\n-one of the session::add_torrent() overloads or session::async_add_torrent().\n-If you only specify the info-hash, the torrent file will be downloaded from\n-peers, which requires them to support the metadata extension. For the metadata\n-extension to work, libtorrent must be built with extensions enabled\n-(TORRENT_DISABLE_EXTENSIONS must not be defined). It also takes an optional\n-name argument. This may be left empty in case no name should be assigned to the\n-torrent. In case it's not, the name is used for the torrent as long as it\n-doesn't have metadata. See torrent_handle::name.\n-The add_torrent_params is also used when requesting resume data for a torrent.\n-It can be saved to and restored from a file and added back to a new session.\n-For serialization and de-serialization of add_torrent_params objects, see\n-read_resume_data() and write_resume_data().\n-The add_torrent_params is also used to represent a parsed .torrent file. It can\n-be loaded via load_torrent_file(), load_torrent_buffer() and\n-load_torrent_parsed(). It can be saved via write_torrent_file().\n-struct add_torrent_params\n+****** announce_infohash ******\n+Declared in \"libtorrent/announce_entry.hpp\"\n+struct announce_infohash\n {\n- int version = LIBTORRENT_VERSION_NUM;\n- std::shared_ptr ti;\n- aux::noexcept_movable> trackers;\n- aux::noexcept_movable> tracker_tiers;\n- aux::noexcept_movable>> dht_nodes;\n- std::string name;\n- std::string save_path;\n- storage_mode_t storage_mode = storage_mode_sparse;\n- client_data_t userdata;\n- aux::noexcept_movable> file_priorities;\n- std::string trackerid;\n- torrent_flags_t flags = torrent_flags::default_flags;\n- info_hash_t info_hashes;\n- int max_uploads = -1;\n- int max_connections = -1;\n- int upload_limit = -1;\n- int download_limit = -1;\n- std::int64_t total_uploaded = 0;\n- std::int64_t total_downloaded = 0;\n- int active_time = 0;\n- int finished_time = 0;\n- int seeding_time = 0;\n- std::time_t added_time = 0;\n- std::time_t completed_time = 0;\n- std::time_t last_seen_complete = 0;\n- int num_complete = -1;\n- int num_incomplete = -1;\n- int num_downloaded = -1;\n- aux::noexcept_movable> http_seeds;\n- aux::noexcept_movable> url_seeds;\n- aux::noexcept_movable> peers;\n- aux::noexcept_movable> banned_peers;\n- aux::noexcept_movable> unfinished_pieces;\n- typed_bitfield have_pieces;\n- typed_bitfield verified_pieces;\n- aux::noexcept_movable> piece_priorities;\n- aux::vector, file_index_t> merkle_trees;\n- aux::vector, file_index_t> merkle_tree_mask;\n- aux::vector, file_index_t> verified_leaf_hashes;\n- aux::noexcept_movable> renamed_files;\n- std::time_t last_download = 0;\n- std::time_t last_upload = 0;\n+ std::string message;\n+ error_code last_error;\n+ int scrape_incomplete = -1;\n+ int scrape_complete = -1;\n+ int scrape_downloaded = -1;\n+ std::uint8_t fails : 7;\n+ bool updating : 1;\n+ bool start_sent : 1;\n+ bool complete_sent : 1;\n };\n [report_issue]\n- version\n- filled in by the constructor and should be left untouched. It is used for\n- forward binary compatibility.\n+ message\n+ if this tracker has returned an error or warning message that message is\n+ stored here\n [report_issue]\n- ti\n- torrent_info object with the torrent to add. Unless the info_hash is set,\n- this is required to be initialized.\n+ last_error\n+ if this tracker failed the last time it was contacted this error code\n+ specifies what error occurred\n+ [report_issue]\n+ scrape_incomplete scrape_complete scrape_downloaded\n+ if this tracker has returned scrape data, these fields are filled in with\n+ valid numbers. Otherwise they are set to -1. incomplete counts the number\n+ of current downloaders. complete counts the number of current peers\n+ completed the download, or \"seeds\". downloaded is the cumulative number\n+ of completed downloads.\n [report_issue]\n- trackers\n- If the torrent doesn't have a tracker, but relies on the DHT to find\n- peers, the trackers can specify tracker URLs for the torrent.\n+ fails\n+ the number of times in a row we have failed to announce to this tracker.\n [report_issue]\n- tracker_tiers\n- the tiers the URLs in trackers belong to. Trackers belonging to different\n- tiers may be treated differently, as defined by the multi tracker\n- extension. This is optional, if not specified trackers are assumed to be\n- part of tier 0, or whichever the last tier was as iterating over the\n- trackers.\n+ updating\n+ true while we're waiting for a response from the tracker.\n [report_issue]\n- dht_nodes\n- a list of hostname and port pairs, representing DHT nodes to be added to\n- the session (if DHT is enabled). The hostname may be an IP address.\n+ start_sent\n+ set to true when we get a valid response from an announce with\n+ event=started. If it is set, we won't send start in the subsequent\n+ announces.\n [report_issue]\n- name\n- in case there's no other name in this torrent, this name will be used.\n- The name out of the torrent_info object takes precedence if available.\n+ complete_sent\n+ set to true when we send a event=completed.\n [report_issue]\n- save_path\n- the path where the torrent is or will be stored.\n- Note\n- On windows this path (and other paths) are interpreted as UNC paths. This\n- means they must use backslashes as directory separators and may not\n- contain the special directories \".\" or \"..\".\n- Setting this to an absolute path performs slightly better than a relative\n- path.\n+****** announce_endpoint ******\n+Declared in \"libtorrent/announce_entry.hpp\"\n+announces are sent to each tracker using every listen socket this class holds\n+information about one listen socket for one tracker\n+struct announce_endpoint\n+{\n+ announce_endpoint ();\n+\n+ tcp::endpoint local_endpoint;\n+ aux::array info_hashes;\n+ bool enabled = true;\n+};\n [report_issue]\n- storage_mode\n- One of the values from storage_mode_t. For more information, see storage\n- allocation.\n+ local_endpoint\n+ the local endpoint of the listen interface associated with this endpoint\n [report_issue]\n- userdata\n- The userdata parameter is optional and will be passed on to the extension\n- constructor functions, if any (see torrent_handle::add_extension()). It\n- will also be stored in the torrent object and can be retrieved by calling\n- userdata().\n+ info_hashes\n+ info_hashes[0] is the v1 info hash (SHA1) info_hashes[1] is the v2 info\n+ hash (truncated SHA-256)\n [report_issue]\n- file_priorities\n- can be set to control the initial file priorities when adding a torrent.\n- The semantics are the same as for torrent_handle::prioritize_files(). The\n- file priorities specified in here take precedence over those specified in\n- the resume data, if any. If this vector of file priorities is shorter\n- than the number of files in the torrent, the remaining files (not covered\n- by this) will still have the default download priority. This default can\n- be changed by setting the default_dont_download torrent_flag.\n+ enabled\n+ set to false to not announce from this endpoint\n+[report_issue]\n+****** announce_entry ******\n+Declared in \"libtorrent/announce_entry.hpp\"\n+this class holds information about one bittorrent tracker, as it relates to a\n+specific torrent.\n+struct announce_entry\n+{\n+ announce_entry& operator= (announce_entry const&) &;\n+ explicit announce_entry (string_view u);\n+ announce_entry (announce_entry const&);\n+ announce_entry ();\n+ ~announce_entry ();\n+\n+ enum tracker_source\n+ {\n+ source_torrent,\n+ source_client,\n+ source_magnet_link,\n+ source_tex,\n+ };\n+\n+ std::string url;\n+ std::string trackerid;\n+ std::vector endpoints;\n+ std::uint8_t tier = 0;\n+ std::uint8_t fail_limit = 0;\n+ std::uint8_t source:4;\n+ bool verified:1;\n+};\n+ [report_issue]\n+***** ~announce_entry() announce_entry() operator=() *****\n+announce_entry& operator= (announce_entry const&) &;\n+explicit announce_entry (string_view u);\n+announce_entry (announce_entry const&);\n+announce_entry ();\n+~announce_entry ();\n+constructs a tracker announce entry with u as the URL.\n+[report_issue]\n+***** enum tracker_source *****\n+Declared in \"libtorrent/announce_entry.hpp\"\n+ ____________________________________________________________________________\n+|name______________|value|description________________________________________|\n+|source_torrent____|1____|the_tracker_was_part_of_the_.torrent_file__________|\n+|source_client |2 |the tracker was added programmatically via the |\n+|__________________|_____|add_tracker()_function_____________________________|\n+|source_magnet_link|4____|the_tracker_was_part_of_a_magnet_link______________|\n+|source_tex |8 |the tracker was received from the swarm via tracker|\n+|__________________|_____|exchange___________________________________________|\n+[report_issue]\n+ url\n+ tracker URL as it appeared in the torrent file\n [report_issue]\n trackerid\n- the default tracker id to be used when announcing to trackers. By default\n- this is empty, and no tracker ID is used, since this is an optional\n- argument. If a tracker returns a tracker ID, that ID is used instead of\n- this.\n+ the current &trackerid= argument passed to the tracker. this is optional\n+ and is normally empty (in which case no trackerid is sent).\n [report_issue]\n- flags\n- flags controlling aspects of this torrent and how it's added. See\n- torrent_flags_t for details.\n- Note\n- The flags field is initialized with default flags by the constructor. In\n- order to preserve default behavior when clearing or setting other flags,\n- make sure to bitwise OR or in a flag or bitwise AND the inverse of a flag\n- to clear it.\n+ endpoints\n+ each local listen socket (endpoint) will announce to the tracker. This\n+ list contains state per endpoint.\n [report_issue]\n- info_hashes\n- set this to the info hash of the torrent to add in case the info-hash is\n- the only known property of the torrent. i.e. you don't have a .torrent\n- file nor a magnet link. To add a magnet link, use parse_magnet_uri() to\n- populate fields in the add_torrent_params object.\n+ tier\n+ the tier this tracker belongs to\n+[report_issue]\n+ fail_limit\n+ the max number of failures to announce to this tracker in a row, before\n+ this tracker is not used anymore. 0 means unlimited\n+[report_issue]\n+ source\n+ a bitmask specifying which sources we got this tracker from.\n+[report_issue]\n+ verified\n+ set to true the first time we receive a valid response from this tracker.\n+[report_issue]\n+****** peer_info ******\n+Declared in \"libtorrent/peer_info.hpp\"\n+holds information and statistics about one peer that libtorrent is connected to\n+struct peer_info\n+{\n+ std::string client;\n+ typed_bitfield pieces;\n+ std::int64_t total_download;\n+ std::int64_t total_upload;\n+ time_duration last_request;\n+ time_duration last_active;\n+ time_duration download_queue_time;\n+ static constexpr peer_flags_t interesting = 0_bit;\n+ static constexpr peer_flags_t choked = 1_bit;\n+ static constexpr peer_flags_t remote_interested = 2_bit;\n+ static constexpr peer_flags_t remote_choked = 3_bit;\n+ static constexpr peer_flags_t supports_extensions = 4_bit;\n+ static constexpr peer_flags_t outgoing_connection = 5_bit;\n+ static constexpr peer_flags_t local_connection = 5_bit;\n+ static constexpr peer_flags_t handshake = 6_bit;\n+ static constexpr peer_flags_t connecting = 7_bit;\n+ static constexpr peer_flags_t on_parole = 9_bit;\n+ static constexpr peer_flags_t seed = 10_bit;\n+ static constexpr peer_flags_t optimistic_unchoke = 11_bit;\n+ static constexpr peer_flags_t snubbed = 12_bit;\n+ static constexpr peer_flags_t upload_only = 13_bit;\n+ static constexpr peer_flags_t endgame_mode = 14_bit;\n+ static constexpr peer_flags_t holepunched = 15_bit;\n+ static constexpr peer_flags_t i2p_socket = 16_bit;\n+ static constexpr peer_flags_t utp_socket = 17_bit;\n+ static constexpr peer_flags_t ssl_socket = 18_bit;\n+ static constexpr peer_flags_t rc4_encrypted = 19_bit;\n+ static constexpr peer_flags_t plaintext_encrypted = 20_bit;\n+ peer_flags_t flags;\n+ static constexpr peer_source_flags_t tracker = 0_bit;\n+ static constexpr peer_source_flags_t dht = 1_bit;\n+ static constexpr peer_source_flags_t pex = 2_bit;\n+ static constexpr peer_source_flags_t lsd = 3_bit;\n+ static constexpr peer_source_flags_t resume_data = 4_bit;\n+ static constexpr peer_source_flags_t incoming = 5_bit;\n+ peer_source_flags_t source;\n+ int up_speed;\n+ int down_speed;\n+ int payload_up_speed;\n+ int payload_down_speed;\n+ peer_id pid;\n+ int queue_bytes;\n+ int request_timeout;\n+ int send_buffer_size;\n+ int used_send_buffer;\n+ int receive_buffer_size;\n+ int used_receive_buffer;\n+ int receive_buffer_watermark;\n+ int num_hashfails;\n+ int download_queue_length;\n+ int timed_out_requests;\n+ int busy_requests;\n+ int requests_in_buffer;\n+ int target_dl_queue_length;\n+ int upload_queue_length;\n+ int failcount;\n+ piece_index_t downloading_piece_index;\n+ int downloading_block_index;\n+ int downloading_progress;\n+ int downloading_total;\n+ static constexpr connection_type_t standard_bittorrent = 0_bit;\n+ static constexpr connection_type_t web_seed = 1_bit;\n+ static constexpr connection_type_t http_seed = 2_bit;\n+ connection_type_t connection_type;\n+ int pending_disk_bytes;\n+ int pending_disk_read_bytes;\n+ int send_quota;\n+ int receive_quota;\n+ int rtt;\n+ int num_pieces;\n+ int download_rate_peak;\n+ int upload_rate_peak;\n+ float progress;\n+ int progress_ppm;\n+ tcp::endpoint ip;\n+ tcp::endpoint local_endpoint;\n+ static constexpr bandwidth_state_flags_t bw_idle = 0_bit;\n+ static constexpr bandwidth_state_flags_t bw_limit = 1_bit;\n+ static constexpr bandwidth_state_flags_t bw_network = 2_bit;\n+ static constexpr bandwidth_state_flags_t bw_disk = 4_bit;\n+ bandwidth_state_flags_t read_state;\n+ bandwidth_state_flags_t write_state;\n+};\n+[report_issue]\n+ client\n+ A human readable string describing the software at the other end of the\n+ connection. In some cases this information is not available, then it will\n+ contain a string that may give away something about which software is\n+ running in the other end. In the case of a web seed, the server type and\n+ version will be a part of this string. This is UTF-8 encoded.\n+[report_issue]\n+ pieces\n+ a bitfield, with one bit per piece in the torrent. Each bit tells you if\n+ the peer has that piece (if it's set to 1) or if the peer miss that piece\n+ (set to 0).\n [report_issue]\n- max_uploads max_connections\n- max_uploads, max_connections, upload_limit, download_limit correspond to\n- the set_max_uploads(), set_max_connections(), set_upload_limit() and\n- set_download_limit() functions on torrent_handle. These values let you\n- initialize these settings when the torrent is added, instead of calling\n- these functions immediately following adding it.\n- -1 means unlimited on these settings just like their counterpart\n- functions on torrent_handle\n- For fine grained control over rate limits, including making them apply to\n- local peers, see peer_classes.\n+ total_download total_upload\n+ the total number of bytes downloaded from and uploaded to this peer.\n+ These numbers do not include the protocol chatter, but only the payload\n+ data.\n [report_issue]\n- upload_limit download_limit\n- the upload and download rate limits for this torrent, specified in bytes\n- per second. -1 means unlimited.\n+ last_request last_active\n+ the time since we last sent a request to this peer and since any transfer\n+ occurred with this peer\n+[report_issue]\n+ download_queue_time\n+ the time until all blocks in the request queue will be downloaded\n+[report_issue]\n+ interesting\n+ we are interested in pieces from this peer.\n+[report_issue]\n+ choked\n+ we have choked this peer.\n+[report_issue]\n+ remote_interested\n+ the peer is interested in us\n+[report_issue]\n+ remote_choked\n+ the peer has choked us.\n+[report_issue]\n+ supports_extensions\n+ means that this peer supports the extension_protocol.\n+[report_issue]\n+ outgoing_connection\n+ The connection was initiated by us, the peer has a listen port open, and\n+ that port is the same as in the address of this peer. If this flag is not\n+ set, this peer connection was opened by this peer connecting to us.\n+[report_issue]\n+ local_connection\n+ deprecated synonym for outgoing_connection\n+[report_issue]\n+ handshake\n+ The connection is opened, and waiting for the handshake. Until the\n+ handshake is done, the peer cannot be identified.\n+[report_issue]\n+ connecting\n+ The connection is in a half-open state (i.e. it is being connected).\n+[report_issue]\n+ on_parole\n+ The peer has participated in a piece that failed the hash check, and is\n+ now \"on parole\", which means we're only requesting whole pieces from this\n+ peer until it either fails that piece or proves that it doesn't send bad\n+ data.\n+[report_issue]\n+ seed\n+ This peer is a seed (it has all the pieces).\n+[report_issue]\n+ optimistic_unchoke\n+ This peer is subject to an optimistic unchoke. It has been unchoked for a\n+ while to see if it might unchoke us in return an earn an upload/unchoke\n+ slot. If it doesn't within some period of time, it will be choked and\n+ another peer will be optimistically unchoked.\n+[report_issue]\n+ snubbed\n+ This peer has recently failed to send a block within the request timeout\n+ from when the request was sent. We're currently picking one block at a\n+ time from this peer.\n+[report_issue]\n+ upload_only\n+ This peer has either explicitly (with an extension) or implicitly (by\n+ becoming a seed) told us that it will not downloading anything more,\n+ regardless of which pieces we have.\n+[report_issue]\n+ endgame_mode\n+ This means the last time this peer picket a piece, it could not pick as\n+ many as it wanted because there were not enough free ones. i.e. all\n+ pieces this peer has were already requested from other peers.\n+[report_issue]\n+ holepunched\n+ This flag is set if the peer was in holepunch mode when the connection\n+ succeeded. This typically only happens if both peers are behind a NAT and\n+ the peers connect via the NAT holepunch mechanism.\n+[report_issue]\n+ i2p_socket\n+ indicates that this socket is running on top of the I2P transport.\n+[report_issue]\n+ utp_socket\n+ indicates that this socket is a uTP socket\n+[report_issue]\n+ ssl_socket\n+ indicates that this socket is running on top of an SSL (TLS) channel\n+[report_issue]\n+ rc4_encrypted\n+ this connection is obfuscated with RC4\n+[report_issue]\n+ plaintext_encrypted\n+ the handshake of this connection was obfuscated with a Diffie-Hellman\n+ exchange\n+[report_issue]\n+ flags\n+ tells you in which state the peer is in. It is set to any combination of\n+ the peer_flags_t flags above.\n+[report_issue]\n+ tracker\n+ The peer was received from the tracker.\n+[report_issue]\n+ dht\n+ The peer was received from the kademlia DHT.\n+[report_issue]\n+ pex\n+ The peer was received from the peer exchange extension.\n+[report_issue]\n+ lsd\n+ The peer was received from the local service discovery (The peer is on\n+ the local network).\n+[report_issue]\n+ resume_data\n+ The peer was added from the fast resume data.\n+[report_issue]\n+ incoming\n+ we received an incoming connection from this peer\n+[report_issue]\n+ source\n+ a combination of flags describing from which sources this peer was\n+ received. A combination of the peer_source_flags_t above.\n [report_issue]\n- total_uploaded total_downloaded\n- the total number of bytes uploaded and downloaded by this torrent so far.\n- [report_issue]\n- active_time finished_time seeding_time\n- the number of seconds this torrent has spent in started, finished and\n- seeding state so far, respectively.\n+ up_speed down_speed\n+ the current upload and download speed we have to and from this peer\n+ (including any protocol messages). updated about once per second\n [report_issue]\n- added_time completed_time\n- if set to a non-zero value, this is the posix time of when this torrent\n- was first added, including previous runs/sessions. If set to zero, the\n- internal added_time will be set to the time of when add_torrent() is\n- called.\n+ payload_up_speed payload_down_speed\n+ The transfer rates of payload data only updated about once per second\n [report_issue]\n- last_seen_complete\n- if set to non-zero, initializes the time (expressed in posix time) when\n- we last saw a seed or peers that together formed a complete copy of the\n- torrent. If left set to zero, the internal counterpart to this field will\n- be updated when we see a seed or a distributed copies >= 1.0.\n+ pid\n+ the peer's id as used in the bit torrent protocol. This id can be used to\n+ extract 'fingerprints' from the peer. Sometimes it can tell you which\n+ client the peer is using. See identify_client()_\n+[report_issue]\n+ queue_bytes\n+ the number of bytes we have requested from this peer, but not yet\n+ received.\n+[report_issue]\n+ request_timeout\n+ the number of seconds until the current front piece request will time\n+ out. This timeout can be adjusted through settings_pack::request_timeout.\n+ -1 means that there is not outstanding request.\n+ [report_issue]\n+ send_buffer_size used_send_buffer\n+ the number of bytes allocated and used for the peer's send buffer,\n+ respectively.\n [report_issue]\n- num_complete num_incomplete num_downloaded\n- these field can be used to initialize the torrent's cached scrape data.\n- The scrape data is high level metadata about the current state of the\n- swarm, as returned by the tracker (either when announcing to it or by\n- sending a specific scrape request). num_complete is the number of peers\n- in the swarm that are seeds, or have every piece in the torrent.\n- num_incomplete is the number of peers in the swarm that do not have every\n- piece. num_downloaded is the number of times the torrent has been\n- downloaded (not initiated, but the number of times a download has\n- completed).\n- Leaving any of these values set to -1 indicates we don't know, or we have\n- not received any scrape data.\n+ receive_buffer_size used_receive_buffer receive_buffer_watermark\n+ the number of bytes allocated and used as receive buffer, respectively.\n+[report_issue]\n+ num_hashfails\n+ the number of pieces this peer has participated in sending us that turned\n+ out to fail the hash check.\n+[report_issue]\n+ download_queue_length\n+ this is the number of requests we have sent to this peer that we haven't\n+ got a response for yet\n+[report_issue]\n+ timed_out_requests\n+ the number of block requests that have timed out, and are still in the\n+ download queue\n+[report_issue]\n+ busy_requests\n+ the number of busy requests in the download queue. A busy request is a\n+ request for a block we've also requested from a different peer\n+[report_issue]\n+ requests_in_buffer\n+ the number of requests messages that are currently in the send buffer\n+ waiting to be sent.\n+[report_issue]\n+ target_dl_queue_length\n+ the number of requests that is tried to be maintained (this is typically\n+ a function of download speed)\n+[report_issue]\n+ upload_queue_length\n+ the number of piece-requests we have received from this peer that we\n+ haven't answered with a piece yet.\n+[report_issue]\n+ failcount\n+ the number of times this peer has \"failed\". i.e. failed to connect or\n+ disconnected us. The failcount is decremented when we see this peer in a\n+ tracker response or peer exchange message.\n+ [report_issue]\n+ downloading_piece_index downloading_block_index downloading_progress\n+ downloading_total\n+ You can know which piece, and which part of that piece, that is currently\n+ being downloaded from a specific peer by looking at these four members.\n+ downloading_piece_index is the index of the piece that is currently being\n+ downloaded. This may be set to -1 if there's currently no piece\n+ downloading from this peer. If it is >= 0, the other three members are\n+ valid. downloading_block_index is the index of the block (or sub-piece)\n+ that is being downloaded. downloading_progress is the number of bytes of\n+ this block we have received from the peer, and downloading_total is the\n+ total number of bytes in this block.\n+[report_issue]\n+ standard_bittorrent\n+ Regular bittorrent connection\n+[report_issue]\n+ web_seed\n+ HTTP connection using the BEP_19 protocol\n+[report_issue]\n+ http_seed\n+ HTTP connection using the BEP_17 protocol\n+[report_issue]\n+ connection_type\n+ the kind of connection this peer uses. See connection_type_t.\n+[report_issue]\n+ pending_disk_bytes\n+ the number of bytes this peer has pending in the disk-io thread.\n+ Downloaded and waiting to be written to disk. This is what is capped by\n+ settings_pack::max_queued_disk_bytes.\n+[report_issue]\n+ pending_disk_read_bytes\n+ number of outstanding bytes to read from disk\n [report_issue]\n- http_seeds url_seeds\n- URLs can be added to these two lists to specify additional web seeds to\n- be used by the torrent. If the flag_override_web_seeds is set, these will\n- be the _only_ ones to be used. i.e. any web seeds found in the .torrent\n- file will be overridden.\n- http_seeds expects URLs to web servers implementing the original HTTP\n- seed specification BEP_17.\n- url_seeds expects URLs to regular web servers, aka \"get right\" style,\n- specified in BEP_19.\n+ send_quota receive_quota\n+ the number of bytes this peer has been assigned to be allowed to send and\n+ receive until it has to request more quota from the bandwidth manager.\n [report_issue]\n- peers\n- peers to add to the torrent, to be tried to be connected to as bittorrent\n- peers.\n+ rtt\n+ an estimated round trip time to this peer, in milliseconds. It is\n+ estimated by timing the TCP connect(). It may be 0 for incoming\n+ connections.\n [report_issue]\n- banned_peers\n- peers banned from this torrent. The will not be connected to\n+ num_pieces\n+ the number of pieces this peer has.\n+ [report_issue]\n+ download_rate_peak upload_rate_peak\n+ the highest download and upload rates seen on this connection. They are\n+ given in bytes per second. This number is reset to 0 on reconnect.\n [report_issue]\n- unfinished_pieces\n- this is a map of partially downloaded piece. The key is the piece index\n- and the value is a bitfield where each bit represents a 16 kiB block. A\n- set bit means we have that block.\n+ progress\n+ the progress of the peer in the range [0, 1]. This is always 0 when\n+ floating point operations are disabled, instead use progress_ppm.\n [report_issue]\n- have_pieces\n- this is a bitfield indicating which pieces we already have of this\n- torrent.\n+ progress_ppm\n+ indicates the download progress of the peer in the range [0, 1000000]\n+ (parts per million).\n [report_issue]\n- verified_pieces\n- when in seed_mode, pieces with a set bit in this bitfield have been\n- verified to be valid. Other pieces will be verified the first time a peer\n- requests it.\n+ ip\n+ the IP-address to this peer. The type is an asio endpoint. For more info,\n+ see the asio documentation.\n [report_issue]\n- piece_priorities\n- this sets the priorities for each individual piece in the torrent. Each\n- element in the vector represent the piece with the same index. If you set\n- both file- and piece priorities, file priorities will take precedence.\n+ local_endpoint\n+ the IP and port pair the socket is bound to locally. i.e. the IP address\n+ of the interface it's going out over. This may be useful for multi-homed\n+ clients with multiple interfaces to the internet.\n [report_issue]\n- merkle_trees\n- v2 hashes, if known\n+ bw_idle\n+ The peer is not waiting for any external events to send or receive data.\n [report_issue]\n- merkle_tree_mask\n- if set, indicates which hashes are included in the corresponding vector\n- of merkle_trees. These bitmasks always cover the full tree, a cleared bit\n- means the hash is all zeros (i.e. not set) and set bit means the next\n- hash in the corresponding vector in merkle_trees is the hash for that\n- node. This is an optimization to avoid storing a lot of zeros.\n+ bw_limit\n+ The peer is waiting for the rate limiter.\n [report_issue]\n- verified_leaf_hashes\n- bit-fields indicating which v2 leaf hashes have been verified against the\n- root hash. If this vector is empty and merkle_trees is non-empty it\n- implies that all hashes in merkle_trees are verified.\n+ bw_network\n+ The peer has quota and is currently waiting for a network read or write\n+ operation to complete. This is the state all peers are in if there are no\n+ bandwidth limits.\n [report_issue]\n- renamed_files\n- this is a map of file indices in the torrent and new filenames to be\n- applied before the torrent is added.\n+ bw_disk\n+ The peer is waiting for the disk I/O thread to catch up writing buffers\n+ to disk before downloading more.\n [report_issue]\n- last_download last_upload\n- the posix time of the last time payload was received or sent for this\n- torrent, respectively.\n+ read_state write_state\n+ bitmasks indicating what state this peer is in with regards to sending\n+ and receiving data. The states are defined as independent flags of type\n+ bandwidth_state_flags_t, in this class.\n [report_issue]\n-****** client_data_t ******\n-Declared in \"libtorrent/client_data.hpp\"\n-A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n-passed in to libtorrent and returned on demand. It adds type-safety by\n-requiring the same type be requested out of it as was assigned to it.\n-struct client_data_t\n+****** peer_request ******\n+Declared in \"libtorrent/peer_request.hpp\"\n+represents a byte range within a piece. Internally this is is used for incoming\n+piece requests.\n+struct peer_request\n {\n- client_data_t () = default;\n- explicit client_data_t (T* v);\n- client_data_t& operator= (T* v);\n- T* get () const;\n- explicit operator T () const;\n- operator void const* () const = delete;\n- operator void* () const = delete;\n- client_data_t& operator= (void*) = delete;\n- client_data_t& operator= (void const*) = delete;\n+ bool operator== (peer_request const& r) const;\n \n- template ::value>::type>\n+ piece_index_t piece;\n+ int start;\n+ int length;\n };\n [report_issue]\n-***** client_data_t() *****\n-client_data_t () = default;\n-construct a nullptr client data\n- [report_issue]\n-***** operator=() void*() const*() *****\n-operator void const* () const = delete;\n-operator void* () const = delete;\n-client_data_t& operator= (void*) = delete;\n-client_data_t& operator= (void const*) = delete;\n-we don't allow type-unsafe operations\n+***** operator==() *****\n+bool operator== (peer_request const& r) const;\n+returns true if the right hand side peer_request refers to the same range as\n+this does.\n [report_issue]\n-****** storage_error ******\n-Declared in \"libtorrent/error_code.hpp\"\n-used by storage to return errors also includes which underlying file the error\n-happened on\n-struct storage_error\n+ piece\n+ The index of the piece in which the range starts.\n+[report_issue]\n+ start\n+ The byte offset within that piece where the range starts.\n+[report_issue]\n+ length\n+ The size of the range, in bytes.\n+[report_issue]\n+****** piece_block ******\n+Declared in \"libtorrent/piece_block.hpp\"\n+struct piece_block\n {\n- explicit operator bool () const;\n- void file (file_index_t f);\n- file_index_t file () const;\n+ piece_block () = default;\n+ piece_block (piece_index_t p_index, int b_index);\n+ bool operator< (piece_block const& b) const;\n+ bool operator== (piece_block const& b) const;\n+ bool operator!= (piece_block const& b) const;\n \n- error_code ec;\n- operation_t operation;\n+ static const piece_block invalid;\n+ piece_index_t piece_index {0};\n+ int block_index = 0;\n };\n [report_issue]\n-***** bool() *****\n-explicit operator bool () const;\n-explicitly converts to true if this object represents an error, and false if it\n-does not.\n+****** info_hash_t ******\n+Declared in \"libtorrent/info_hash.hpp\"\n+class holding the info-hash of a torrent. It can hold a v1 info-hash (SHA-1) or\n+a v2 info-hash (SHA-256) or both.\n+Note\n+If has_v2() is false then the v1 hash might actually be a truncated v2 hash\n+struct info_hash_t\n+{\n+ info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n+ explicit info_hash_t (sha256_hash h2) noexcept;\n+ info_hash_t () noexcept = default;\n+ explicit info_hash_t (sha1_hash h1) noexcept;\n+ bool has_v1 () const;\n+ bool has_v2 () const;\n+ bool has (protocol_version v) const;\n+ sha1_hash get (protocol_version v) const;\n+ sha1_hash get_best () const;\n+ friend bool operator!= (info_hash_t const& lhs, info_hash_t const& rhs);\n+ friend bool operator== (info_hash_t const& lhs, info_hash_t const& rhs)\n+noexcept;\n+ template void for_each (F f) const;\n+ bool operator< (info_hash_t const& o) const;\n+ friend std::ostream& operator<< (std::ostream& os, info_hash_t const& ih);\n+\n+ sha1_hash v1;\n+ sha256_hash v2;\n+};\n [report_issue]\n-***** file() *****\n-void file (file_index_t f);\n-file_index_t file () const;\n-set and query the index (in the torrent) of the file this error occurred on.\n-This may also have special values defined in torrent_status.\n+***** info_hash_t() *****\n+info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n+explicit info_hash_t (sha256_hash h2) noexcept;\n+info_hash_t () noexcept = default;\n+explicit info_hash_t (sha1_hash h1) noexcept;\n+The default constructor creates an object that has neither a v1 or v2 hash.\n+For backwards compatibility, make it possible to construct directly from a v1\n+hash. This constructor allows implicit conversion from a v1 hash, but the\n+implicitness is deprecated.\n+ [report_issue]\n+***** has() has_v1() has_v2() *****\n+bool has_v1 () const;\n+bool has_v2 () const;\n+bool has (protocol_version v) const;\n+returns true if the corresponding info hash is present in this object.\n [report_issue]\n- ec\n- the error that occurred\n+***** get() *****\n+sha1_hash get (protocol_version v) const;\n+returns the has for the specified protocol version\n [report_issue]\n- operation\n- A code from operation_t enum, indicating what kind of operation failed.\n+***** get_best() *****\n+sha1_hash get_best () const;\n+returns the v2 (truncated) info-hash, if there is one, otherwise returns the v1\n+info-hash\n [report_issue]\n-****** libtorrent_category() ******\n-Declared in \"libtorrent/error_code.hpp\"\n-boost::system::error_category& libtorrent_category ();\n-return the instance of the libtorrent_error_category which maps libtorrent\n-error codes to human readable error messages.\n+***** for_each() *****\n+template void for_each (F f) const;\n+calls the function object f for each hash that is available. starting with v1.\n+The signature of F is:\n+void(sha1_hash const&, protocol_version);\n [report_issue]\n-****** http_category() ******\n-Declared in \"libtorrent/error_code.hpp\"\n-boost::system::error_category& http_category ();\n-returns the error_category for HTTP errors\n+****** version() ******\n+Declared in \"libtorrent/version.hpp\"\n+char const* version ();\n+returns the libtorrent version as string form in this format:\n+\"...\"\n [report_issue]\n-****** socks_category() ******\n-Declared in \"libtorrent/socks5_stream.hpp\"\n-boost::system::error_category& socks_category ();\n-returns the error_category for SOCKS5 errors\n+****** make_magnet_uri() ******\n+Declared in \"libtorrent/magnet_uri.hpp\"\n+std::string make_magnet_uri (torrent_handle const& handle);\n+std::string make_magnet_uri (torrent_info const& info);\n+std::string make_magnet_uri (add_torrent_params const& atp);\n+Generates a magnet URI from the specified torrent.\n+Several fields from the add_torrent_params objects are recorded in the magnet\n+link. In order to not include them, they have to be cleared before calling\n+make_magnet_uri(). These fields are used:\n+ ti, info_hashes, url_seeds, dht_nodes, file_priorities, trackers,\n+ name, peers.\n+Depending on what the use case for the resulting magnet link is, clearing peers\n+and dht_nodes is probably a good idea if the add_torrent_params came from a\n+running torrent. Those lists may be long and be ephemeral.\n+If none of the info_hashes or ti fields are set, there is not info-hash\n+available, and a magnet link cannot be created. In this case make_magnet_uri()\n+returns an empty string.\n+The recommended way to generate a magnet link from a torrent_handle is to call\n+save_resume_data(), which will post a save_resume_data_alert containing an\n+add_torrent_params object. This can then be passed to make_magnet_uri().\n+The overload that takes a torrent_handle will make blocking calls to query\n+information about the torrent. If the torrent handle is invalid, an empty\n+string is returned.\n+For more information about magnet links, see magnet_links.\n [report_issue]\n-****** upnp_category() ******\n-Declared in \"libtorrent/upnp.hpp\"\n-boost::system::error_category& upnp_category ();\n-the boost.system error category for UPnP errors\n+****** parse_magnet_uri() ******\n+Declared in \"libtorrent/magnet_uri.hpp\"\n+add_torrent_params parse_magnet_uri (string_view uri);\n+add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\n+void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec);\n+This function parses out information from the magnet link and populates the\n+add_torrent_params object. The overload that does not take an error_code\n+reference will throw a system_error on error The overload taking an\n+add_torrent_params reference will fill in the fields specified in the magnet\n+URI.\n+ [report_issue]\n+****** load_torrent_buffer() load_torrent_file() load_torrent_parsed() ******\n+Declared in \"libtorrent/load_torrent.hpp\"\n+add_torrent_params load_torrent_buffer (\n+ span buffer, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_parsed (\n+ bdecode_node const& torrent_file);\n+add_torrent_params load_torrent_buffer (\n+ span buffer);\n+add_torrent_params load_torrent_file (\n+ std::string const& filename, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_parsed (\n+ bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_file (\n+ std::string const& filename);\n+These functions load the content of a .torrent file into an add_torrent_params\n+object. The immutable part of a torrent file (the info-dictionary) is stored in\n+the ti field in the add_torrent_params object (as a torrent_info object). The\n+returned object is suitable to be:\n+ * added to a session via add_torrent() or async_add_torrent()\n+ * saved as a .torrent_file via write_torrent_file()\n+ * turned into a magnet link via make_magnet_uri()\n [report_issue]\n-****** pcp_category() ******\n-Declared in \"libtorrent/natpmp.hpp\"\n-boost::system::error_category& pcp_category ();\n+****** truncate_files() ******\n+Declared in \"libtorrent/truncate.hpp\"\n+void truncate_files (file_storage const& fs, std::string const& save_path,\n+storage_error& ec);\n+Truncates files larger than specified in the file_storage, saved under the\n+specified save_path.\n [report_issue]\n-****** bdecode_category() ******\n-Declared in \"libtorrent/bdecode.hpp\"\n-boost::system::error_category& bdecode_category ();\n+****** enum socket_type_t ******\n+Declared in \"libtorrent/socket_type.hpp\"\n+ ____________________________\n+|name______|value|description|\n+|tcp_______|0____|\u00a0_________|\n+|socks5____|1____|\u00a0_________|\n+|http______|2____|\u00a0_________|\n+|utp_______|3____|\u00a0_________|\n+|i2p_______|4____|\u00a0_________|\n+|tcp_ssl___|5____|\u00a0_________|\n+|socks5_ssl|6____|\u00a0_________|\n+|http_ssl__|7____|\u00a0_________|\n+|utp_ssl___|8____|\u00a0_________|\n [report_issue]\n-****** i2p_category() ******\n-Declared in \"libtorrent/i2p_stream.hpp\"\n-boost::system::error_category& i2p_category ();\n-returns the error category for I2P errors\n+****** enum connection_type ******\n+Declared in \"libtorrent/peer_connection.hpp\"\n+ ____________________________\n+|name______|value|description|\n+|bittorrent|0____|\u00a0_________|\n+|url_seed__|1____|\u00a0_________|\n+|http_seed_|2____|\u00a0_________|\n [report_issue]\n-****** gzip_category() ******\n-Declared in \"libtorrent/gzip.hpp\"\n-boost::system::error_category& gzip_category ();\n-get the error_category for zip errors\n+****** enum portmap_transport ******\n+Declared in \"libtorrent/portmap.hpp\"\n+ _________________________________________\n+|name__|value|description_________________|\n+|natpmp|0____|natpmp_can_be_NAT-PMP_or_PCP|\n+|upnp__|1____|\u00a0__________________________|\n [report_issue]\n-****** enum error_code_enum ******\n-Declared in \"libtorrent/error_code.hpp\"\n- _____________________________________________________________________________\n-|name________________________________|value|description_______________________|\n-|no_error____________________________|0____|Not_an_error______________________|\n-|file_collision |1 |Two torrents has files which end |\n-|____________________________________|_____|up_overwriting_each_other_________|\n-|failed_hash_check |2 |A piece did not match its piece |\n-|____________________________________|_____|hash______________________________|\n-| | |The .torrent file does not contain|\n-|torrent_is_no_dict |3 |a bencoded dictionary at its top |\n-|____________________________________|_____|level_____________________________|\n-|torrent_missing_info |4 |The .torrent file does not have an|\n-|____________________________________|_____|info_dictionary___________________|\n-|torrent_info_no_dict |5 |The .torrent file's info entry is |\n-|____________________________________|_____|not_a_dictionary__________________|\n-|torrent_missing_piece_length |6 |The .torrent file does not have a |\n-|____________________________________|_____|piece_length_entry________________|\n-|torrent_missing_name |7 |The .torrent file does not have a |\n-|____________________________________|_____|name_entry________________________|\n-|torrent_invalid_name |8 |The .torrent file's name entry is |\n-|____________________________________|_____|invalid___________________________|\n-| | |The length of a file, or of the |\n-|torrent_invalid_length |9 |whole .torrent file is invalid. |\n-|____________________________________|_____|Either_negative_or_not_an_integer_|\n-|torrent_file_parse_failed |10 |Failed to parse a file entry in |\n-|____________________________________|_____|the_.torrent______________________|\n-|torrent_missing_pieces |11 |The pieces field is missing or |\n-|____________________________________|_____|invalid_in_the_.torrent_file______|\n-|torrent_invalid_hashes |12 |The pieces string has incorrect |\n-|____________________________________|_____|length____________________________|\n-|too_many_pieces_in_torrent |13 |The .torrent file has more pieces |\n-|____________________________________|_____|than_is_supported_by_libtorrent___|\n-| | |The metadata (.torrent file) that |\n-|invalid_swarm_metadata |14 |was received from the swarm |\n-| | |matched the info-hash, but failed |\n-|____________________________________|_____|to_be_parsed______________________|\n-|invalid_bencoding |15 |The file or buffer is not |\n-|____________________________________|_____|correctly_bencoded________________|\n-|no_files_in_torrent |16 |The .torrent file does not contain|\n-|____________________________________|_____|any_files_________________________|\n-|invalid_escaped_string |17 |The string was not properly url- |\n-|____________________________________|_____|encoded_as_expected_______________|\n-|session_is_closing |18 |Operation is not permitted since |\n-|____________________________________|_____|the_session_is_shutting_down______|\n-| | |There's already a torrent with |\n-|duplicate_torrent |19 |that info-hash added to the |\n-|____________________________________|_____|session___________________________|\n-|invalid_torrent_handle |20 |The supplied torrent_handle is not|\n-|____________________________________|_____|referring_to_a_valid_torrent______|\n-|invalid_entry_type |21 |The type requested from the entry |\n-|____________________________________|_____|did_not_match_its_type____________|\n-|missing_info_hash_in_uri |22 |The specified URI does not contain|\n-|____________________________________|_____|a_valid_info-hash_________________|\n-| | |One of the files in the torrent |\n-|file_too_short |23 |was unexpectedly small. This might|\n-| | |be caused by files being changed |\n-|____________________________________|_____|by_an_external_process____________|\n-| | |The URL used an unknown protocol. |\n-| | |Currently http and https (if built|\n-|unsupported_url_protocol |24 |with openssl support) are |\n-| | |recognized. For trackers udp is |\n-|____________________________________|_____|recognized_as_well._______________|\n-|url_parse_error |25 |The URL did not conform to URL |\n-|____________________________________|_____|syntax_and_failed_to_be_parsed____|\n-|peer_sent_empty_piece |26 |The peer sent a piece message of |\n-|____________________________________|_____|length_0__________________________|\n-|parse_failed |27 |A bencoded structure was corrupt |\n-|____________________________________|_____|and_failed_to_be_parsed___________|\n-|invalid_file_tag |28 |The fast resume file was missing |\n-|____________________________________|_____|or_had_an_invalid_file_version_tag|\n-|missing_info_hash |29 |The fast resume file was missing |\n-|____________________________________|_____|or_had_an_invalid_info-hash_______|\n-|mismatching_info_hash |30 |The info-hash did not match the |\n-|____________________________________|_____|torrent___________________________|\n-|invalid_hostname |31 |The URL contained an invalid |\n-|____________________________________|_____|hostname__________________________|\n-|invalid_port________________________|32___|The_URL_had_an_invalid_port_______|\n-| | |The port is blocked by the port- |\n-|port_blocked |33 |filter, and prevented the |\n-|____________________________________|_____|connection________________________|\n-|expected_close_bracket_in_address |34 |The IPv6 address was expected to |\n-|____________________________________|_____|end_with_\"]\"______________________|\n-| | |The torrent is being destructed, |\n-|destructing_torrent |35 |preventing the operation to |\n-|____________________________________|_____|succeed___________________________|\n-|timed_out___________________________|36___|The_connection_timed_out__________|\n-| | |The peer is upload only, and we |\n-|upload_upload_connection |37 |are upload only. There's no point |\n-|____________________________________|_____|in_keeping_the_connection_________|\n-| | |The peer is upload only, and we're|\n-|uninteresting_upload_peer |38 |not interested in it. There's no |\n-|____________________________________|_____|point_in_keeping_the_connection___|\n-|invalid_info_hash___________________|39___|The_peer_sent_an_unknown_info-hash|\n-|torrent_paused |40 |The torrent is paused, preventing |\n-|____________________________________|_____|the_operation_from_succeeding_____|\n-| | |The peer sent an invalid have |\n-|invalid_have |41 |message, either wrong size or |\n-| | |referring to a piece that doesn't |\n-|____________________________________|_____|exist_in_the_torrent______________|\n-|invalid_bitfield_size |42 |The bitfield message had the |\n-|____________________________________|_____|incorrect_size____________________|\n-| | |The peer kept requesting pieces |\n-|too_many_requests_when_choked |43 |after it was choked, possible |\n-|____________________________________|_____|abuse_attempt.____________________|\n-| | |The peer sent a piece message that|\n-|invalid_piece |44 |does not correspond to a piece |\n-|____________________________________|_____|request_sent_by_the_client________|\n-|no_memory___________________________|45___|memory_allocation_failed__________|\n-|torrent_aborted |46 |The torrent is aborted, preventing|\n-|____________________________________|_____|the_operation_to_succeed__________|\n-|self_connection |47 |The peer is a connection to |\n-|____________________________________|_____|ourself,_no_point_in_keeping_it___|\n-| | |The peer sent a piece message with|\n-|invalid_piece_size |48 |invalid size, either negative or |\n-|____________________________________|_____|greater_than_one_block____________|\n-| | |The peer has not been interesting |\n-|timed_out_no_interest |49 |or interested in us for too long, |\n-|____________________________________|_____|no_point_in_keeping_it_around_____|\n-|timed_out_inactivity |50 |The peer has not said anything in |\n-|____________________________________|_____|a_long_time,_possibly_dead________|\n-| | |The peer did not send a handshake |\n-|timed_out_no_handshake |51 |within a reasonable amount of |\n-| | |time, it might not be a bittorrent|\n-|____________________________________|_____|peer______________________________|\n-| | |The peer has been unchoked for too|\n-|timed_out_no_request |52 |long without requesting any data. |\n-| | |It might be lying about its |\n-|____________________________________|_____|interest_in_us____________________|\n-|invalid_choke |53 |The peer sent an invalid choke |\n-|____________________________________|_____|message___________________________|\n-|invalid_unchoke |54 |The peer send an invalid unchoke |\n-|____________________________________|_____|message___________________________|\n-|invalid_interested |55 |The peer sent an invalid |\n-|____________________________________|_____|interested_message________________|\n-|invalid_not_interested |56 |The peer sent an invalid not- |\n-|____________________________________|_____|interested_message________________|\n-|invalid_request |57 |The peer sent an invalid piece |\n-|____________________________________|_____|request_message___________________|\n-| | |The peer sent an invalid hash-list|\n-|invalid_hash_list |58 |message (this is part of the |\n-|____________________________________|_____|merkle-torrent_extension)_________|\n-| | |The peer sent an invalid hash- |\n-|invalid_hash_piece |59 |piece message (this is part of the|\n-|____________________________________|_____|merkle-torrent_extension)_________|\n-|invalid_cancel |60 |The peer sent an invalid cancel |\n-|____________________________________|_____|message___________________________|\n-|invalid_dht_port |61 |The peer sent an invalid DHT port-|\n-|____________________________________|_____|message___________________________|\n-|invalid_suggest |62 |The peer sent an invalid suggest |\n-|____________________________________|_____|piece-message_____________________|\n-|invalid_have_all |63 |The peer sent an invalid have all-|\n-|____________________________________|_____|message___________________________|\n-|invalid_have_none |64 |The peer sent an invalid have |\n-|____________________________________|_____|none-message______________________|\n-|invalid_reject |65 |The peer sent an invalid reject |\n-|____________________________________|_____|message___________________________|\n-|invalid_allow_fast |66 |The peer sent an invalid allow |\n-|____________________________________|_____|fast-message______________________|\n-|invalid_extended |67 |The peer sent an invalid extension|\n-|____________________________________|_____|message_ID________________________|\n-|invalid_message |68 |The peer sent an invalid message |\n-|____________________________________|_____|ID________________________________|\n-|sync_hash_not_found |69 |The synchronization hash was not |\n-|____________________________________|_____|found_in_the_encrypted_handshake__|\n-|invalid_encryption_constant |70 |The encryption constant in the |\n-|____________________________________|_____|handshake_is_invalid______________|\n-|no_plaintext_mode |71 |The peer does not support plain |\n-|____________________________________|_____|text,_which_is_the_selected_mode__|\n-|no_rc4_mode |72 |The peer does not support RC4, |\n-|____________________________________|_____|which_is_the_selected_mode________|\n-| | |The peer does not support any of |\n-|unsupported_encryption_mode |73 |the encryption modes that the |\n-|____________________________________|_____|client_supports___________________|\n-| | |The peer selected an encryption |\n-|unsupported_encryption_mode_selected|74 |mode that the client did not |\n-|____________________________________|_____|advertise_and_does_not_support____|\n-| | |The pad size used in the |\n-|invalid_pad_size |75 |encryption handshake is of invalid|\n-|____________________________________|_____|size______________________________|\n-|invalid_encrypt_handshake |76 |The encryption handshake is |\n-|____________________________________|_____|invalid___________________________|\n-| | |The client is set to not support |\n-|no_incoming_encrypted |77 |incoming encrypted connections and|\n-|____________________________________|_____|this_is_an_encrypted_connection___|\n-| | |The client is set to not support |\n-|no_incoming_regular |78 |incoming regular bittorrent |\n-| | |connections, and this is a regular|\n-|____________________________________|_____|connection________________________|\n-|duplicate_peer_id |79 |The client is already connected to|\n-|____________________________________|_____|this_peer-ID______________________|\n-|torrent_removed_____________________|80___|Torrent_was_removed_______________|\n-|packet_too_large |81 |The packet size exceeded the upper|\n-|____________________________________|_____|sanity_check-limit________________|\n-|reserved____________________________|82___|\u00a0________________________________|\n-|http_error |83 |The web server responded with an |\n-|____________________________________|_____|error_____________________________|\n-|missing_location |84 |The web server response is missing|\n-|____________________________________|_____|a_location_header_________________|\n-| | |The web seed redirected to a path |\n-|invalid_redirection |85 |that no longer matches the |\n-|____________________________________|_____|.torrent_directory_structure______|\n-|redirecting |86 |The connection was closed because |\n-|____________________________________|_____|it_redirected_to_a_different_URL__|\n-|invalid_range_______________________|87___|The_HTTP_range_header_is_invalid__|\n-|no_content_length |88 |The HTTP response did not have a |\n-|____________________________________|_____|content_length____________________|\n-|banned_by_ip_filter_________________|89___|The_IP_is_blocked_by_the_IP_filter|\n-|too_many_connections________________|90___|At_the_connection_limit___________|\n-|peer_banned_________________________|91___|The_peer_is_marked_as_banned______|\n-|stopping_torrent |92 |The torrent is stopping, causing |\n-|____________________________________|_____|the_operation_to_fail_____________|\n-|too_many_corrupt_pieces |93 |The peer has sent too many corrupt|\n-|____________________________________|_____|pieces_and_is_banned______________|\n-|torrent_not_ready |94 |The torrent is not ready to |\n-|____________________________________|_____|receive_peers_____________________|\n-|peer_not_constructed |95 |The peer is not completely |\n-|____________________________________|_____|constructed_yet___________________|\n-|session_closing |96 |The session is closing, causing |\n-|____________________________________|_____|the_operation_to_fail_____________|\n-| | |The peer was disconnected in order|\n-|optimistic_disconnect |97 |to leave room for a potentially |\n-|____________________________________|_____|better_peer_______________________|\n-|torrent_finished____________________|98___|The_torrent_is_finished___________|\n-|no_router___________________________|99___|No_UPnP_router_found______________|\n-|metadata_too_large |100 |The metadata message says the |\n-|____________________________________|_____|metadata_exceeds_the_limit________|\n-|invalid_metadata_request |101 |The peer sent an invalid metadata |\n-|____________________________________|_____|request_message___________________|\n-|invalid_metadata_size |102 |The peer advertised an invalid |\n-|____________________________________|_____|metadata_size_____________________|\n-|invalid_metadata_offset |103 |The peer sent a message with an |\n-|____________________________________|_____|invalid_metadata_offset___________|\n-|invalid_metadata_message |104 |The peer sent an invalid metadata |\n-|____________________________________|_____|message___________________________|\n-|pex_message_too_large |105 |The peer sent a peer exchange |\n-|____________________________________|_____|message_that_was_too_large________|\n-|invalid_pex_message |106 |The peer sent an invalid peer |\n-|____________________________________|_____|exchange_message__________________|\n-|invalid_lt_tracker_message |107 |The peer sent an invalid tracker |\n-|____________________________________|_____|exchange_message__________________|\n-| | |The peer sent an pex messages too |\n-|too_frequent_pex |108 |often. This is a possible attempt |\n-|____________________________________|_____|of_and_attack_____________________|\n-| | |The operation failed because it |\n-| | |requires the torrent to have the |\n-| | |metadata (.torrent file) and it |\n-|no_metadata |109 |doesn't have it yet. This happens |\n-| | |for magnet links before they have |\n-| | |downloaded the metadata, and also |\n-|____________________________________|_____|torrents_added_by_URL.____________|\n-| | |The peer sent an invalid dont_have|\n-| | |message. The don't have message is|\n-|invalid_dont_have |110 |an extension to allow peers to |\n-| | |advertise that the no longer has a|\n-|____________________________________|_____|piece_they_previously_had.________|\n-| | |The peer tried to connect to an |\n-|requires_ssl_connection |111 |SSL torrent without connecting |\n-|____________________________________|_____|over_SSL._________________________|\n-| | |The peer tried to connect to a |\n-|invalid_ssl_cert |112 |torrent with a certificate for a |\n-|____________________________________|_____|different_torrent.________________|\n-| | |the torrent is not an SSL torrent,|\n-|not_an_ssl_torrent |113 |and the operation requires an SSL |\n-|____________________________________|_____|torrent___________________________|\n-| | |peer was banned because its listen|\n-|banned_by_port_filter |114 |port is within a banned port |\n-| | |range, as specified by the |\n-|____________________________________|_____|port_filter.______________________|\n-|invalid_session_handle |115 |The session_handle is not |\n-|____________________________________|_____|referring_to_a_valid_session_impl_|\n-|invalid_listen_socket |116 |the listen socket associated with |\n-|____________________________________|_____|this_request_was_closed___________|\n-|invalid_hash_request________________|117__|\u00a0________________________________|\n-|invalid_hashes______________________|118__|\u00a0________________________________|\n-|invalid_hash_reject_________________|119__|\u00a0________________________________|\n-|deprecated_120______________________|120__|\u00a0________________________________|\n-|deprecated_121______________________|121__|\u00a0________________________________|\n-|deprecated_122______________________|122__|\u00a0________________________________|\n-|deprecated_123______________________|123__|\u00a0________________________________|\n-|deprecated_124______________________|124__|\u00a0________________________________|\n-|missing_file_sizes |130 |The resume data file is missing |\n-|____________________________________|_____|the_file_sizes_entry______________|\n-|no_files_in_resume_data |131 |The resume data file file sizes |\n-|____________________________________|_____|entry_is_empty____________________|\n-|missing_pieces |132 |The resume data file is missing |\n-|____________________________________|_____|the_pieces_and_slots_entry________|\n-| | |The number of files in the resume |\n-|mismatching_number_of_files |133 |data does not match the number of |\n-|____________________________________|_____|files_in_the_torrent______________|\n-| | |One of the files on disk has a |\n-|mismatching_file_size |134 |different size than in the fast |\n-|____________________________________|_____|resume_file_______________________|\n-| | |One of the files on disk has a |\n-|mismatching_file_timestamp |135 |different timestamp than in the |\n-|____________________________________|_____|fast_resume_file__________________|\n-|not_a_dictionary |136 |The resume data file is not a |\n-|____________________________________|_____|dictionary________________________|\n-|invalid_blocks_per_piece |137 |The blocks per piece entry is |\n-|____________________________________|_____|invalid_in_the_resume_data_file___|\n-| | |The resume file is missing the |\n-|missing_slots |138 |slots entry, which is required for|\n-| | |torrents with compact allocation. |\n-|____________________________________|_____|DEPRECATED________________________|\n-|too_many_slots |139 |The resume file contains more |\n-|____________________________________|_____|slots_than_the_torrent____________|\n-|invalid_slot_list |140 |The slot entry is invalid in the |\n-|____________________________________|_____|resume_data_______________________|\n-|invalid_piece_index |141 |One index in the slot list is |\n-|____________________________________|_____|invalid___________________________|\n-| | |The pieces on disk needs to be re-|\n-| | |ordered for the specified |\n-| | |allocation mode. This happens if |\n-|pieces_need_reorder |142 |you specify sparse allocation and |\n-| | |the files on disk are using |\n-| | |compact storage. The pieces needs |\n-| | |to be moved to their right |\n-|____________________________________|_____|position._DEPRECATED______________|\n-| | |this error is returned when asking|\n-| | |to save resume data and specifying|\n-|resume_data_not_modified |143 |the flag to only save when there's|\n-| | |anything new to save |\n-| | |(torrent_handle::only_if_modified)|\n-|____________________________________|_____|and_there_wasn't_anything_changed.|\n-|http_parse_error |150 |The HTTP header was not correctly |\n-|____________________________________|_____|formatted_________________________|\n-| | |The HTTP response was in the 300- |\n-|http_missing_location |151 |399 range but lacked a location |\n-|____________________________________|_____|header____________________________|\n-| | |The HTTP response was encoded with|\n-|http_failed_decompress |152 |gzip or deflate but decompressing |\n-|____________________________________|_____|it_failed_________________________|\n-|no_i2p_router |160 |The URL specified an i2p address, |\n-|____________________________________|_____|but_no_i2p_router_is_configured___|\n-|no_i2p_endpoint |161 |i2p acceptor is not available yet,|\n-|____________________________________|_____|can't_announce_without_endpoint___|\n-| | |The tracker URL doesn't support |\n-|scrape_not_available |170 |transforming it into a scrape URL.|\n-|____________________________________|_____|i.e._it_doesn't_contain_\"announce.|\n-|invalid_tracker_response____________|171__|invalid_tracker_response__________|\n-|invalid_peer_dict |172 |invalid peer dictionary entry. Not|\n-|____________________________________|_____|a_dictionary______________________|\n-|tracker_failure_____________________|173__|tracker_sent_a_failure_message____|\n-|invalid_files_entry_________________|174__|missing_or_invalid_files_entry____|\n-|invalid_hash_entry__________________|175__|missing_or_invalid_hash_entry_____|\n-|invalid_peers_entry |176 |missing or invalid peers and |\n-|____________________________________|_____|peers6_entry______________________|\n-|invalid_tracker_response_length |177 |UDP tracker response packet has |\n-|____________________________________|_____|invalid_size______________________|\n-|invalid_tracker_transaction_id |178 |invalid transaction id in UDP |\n-|____________________________________|_____|tracker_response__________________|\n-|invalid_tracker_action |179 |invalid action field in UDP |\n-|____________________________________|_____|tracker_response__________________|\n-| | |skipped announce (because it's |\n-|announce_skipped |180 |assumed to be unreachable over the|\n-|____________________________________|_____|given_source_network_interface)___|\n-|no_entropy__________________________|200__|random_number_generation_failed___|\n-|ssrf_mitigation_____________________|201__|blocked_by_SSRF_mitigation________|\n-|blocked_by_idna |202 |blocked because IDNA host names |\n-|____________________________________|_____|are_banned________________________|\n-|torrent_unknown_version |210 |the torrent file has an unknown |\n-|____________________________________|_____|meta_version______________________|\n-|torrent_missing_file_tree |211 |the v2 torrent file has no file |\n-|____________________________________|_____|tree______________________________|\n-|torrent_missing_meta_version |212 |the torrent contains v2 keys but |\n-|____________________________________|_____|does_not_specify_meta_version_2___|\n-|torrent_inconsistent_files |213 |the v1 and v2 file metadata does |\n-|____________________________________|_____|not_match_________________________|\n-|torrent_missing_piece_layer |214 |one or more files are missing |\n-|____________________________________|_____|piece_layer_hashes________________|\n-|torrent_invalid_piece_layer |215 |a piece layer has the wrong size |\n-|____________________________________|_____|or_failed_hash_check______________|\n-|torrent_missing_pieces_root_________|216__|a_v2_file_entry_has_no_root_hash__|\n-|torrent_inconsistent_hashes |217 |the v1 and v2 hashes do not |\n-|____________________________________|_____|describe_the_same_data____________|\n-|torrent_invalid_pad_file |218 |a file in the v2 metadata has the |\n-|____________________________________|_____|pad_attribute_set_________________|\n-|error_code_max______________________|219__|the_number_of_error_codes_________|\n+****** enum portmap_protocol ******\n+Declared in \"libtorrent/portmap.hpp\"\n+ ______________________\n+|name|value|description|\n+|none|0____|\u00a0_________|\n+|tcp_|1____|\u00a0_________|\n+|udp_|2____|\u00a0_________|\n [report_issue]\n-****** enum http_errors ******\n-Declared in \"libtorrent/error_code.hpp\"\n- _______________________________________\n-|name_________________|value|description|\n-|cont_________________|100__|\u00a0_________|\n-|ok___________________|200__|\u00a0_________|\n-|created______________|201__|\u00a0_________|\n-|accepted_____________|202__|\u00a0_________|\n-|no_content___________|204__|\u00a0_________|\n-|multiple_choices_____|300__|\u00a0_________|\n-|moved_permanently____|301__|\u00a0_________|\n-|moved_temporarily____|302__|\u00a0_________|\n-|not_modified_________|304__|\u00a0_________|\n-|bad_request__________|400__|\u00a0_________|\n-|unauthorized_________|401__|\u00a0_________|\n-|forbidden____________|403__|\u00a0_________|\n-|not_found____________|404__|\u00a0_________|\n-|internal_server_error|500__|\u00a0_________|\n-|not_implemented______|501__|\u00a0_________|\n-|bad_gateway__________|502__|\u00a0_________|\n-|service_unavailable__|503__|\u00a0_________|\n+****** enum protocol_version ******\n+Declared in \"libtorrent/info_hash.hpp\"\n+ _____________________________________________________________________\n+|name|value|description_______________________________________________|\n+|V1__|0____|The_original_BitTorrent_version,_using_SHA-1_hashes_______|\n+|V2__|1____|Version_2_of_the_BitTorrent_protocol,_using_SHA-256_hashes|\n+|NUM_|2____|\u00a0________________________________________________________|\n [report_issue]\n-****** enum socks_error_code ******\n-Declared in \"libtorrent/socks5_stream.hpp\"\n- ____________________________________________________\n-|name______________________________|value|description|\n-|no_error__________________________|0____|\u00a0_________|\n-|unsupported_version_______________|1____|\u00a0_________|\n-|unsupported_authentication_method_|2____|\u00a0_________|\n-|unsupported_authentication_version|3____|\u00a0_________|\n-|authentication_error______________|4____|\u00a0_________|\n-|username_required_________________|5____|\u00a0_________|\n-|general_failure___________________|6____|\u00a0_________|\n-|command_not_supported_____________|7____|\u00a0_________|\n-|no_identd_________________________|8____|\u00a0_________|\n-|identd_error______________________|9____|\u00a0_________|\n-|num_errors________________________|10___|\u00a0_________|\n+****** enum event_t ******\n+Declared in \"libtorrent/tracker_manager.hpp\"\n+ ___________________________\n+|name_____|value|description|\n+|none_____|0____|\u00a0_________|\n+|completed|1____|\u00a0_________|\n+|started__|2____|\u00a0_________|\n+|stopped__|3____|\u00a0_________|\n+|paused___|4____|\u00a0_________|\n [report_issue]\n-****** enum error_code_enum ******\n-Declared in \"libtorrent/upnp.hpp\"\n- _____________________________________________________________________________\n-|name______________________________|value|description_________________________|\n-|no_error__________________________|0____|No_error____________________________|\n-|invalid_argument |402 |One of the arguments in the request |\n-|__________________________________|_____|is_invalid__________________________|\n-|action_failed_____________________|501__|The_request_failed__________________|\n-|value_not_in_array |714 |The specified value does not exist |\n-|__________________________________|_____|in_the_array________________________|\n-| | |The source IP address cannot be |\n-|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |\n-|__________________________________|_____|specified___________________________|\n-|external_port_cannot_be_wildcarded|716 |The external port cannot be a |\n-|__________________________________|_____|wildcard,_but_must_be_specified_____|\n-| | |The port mapping entry specified |\n-|port_mapping_conflict |718 |conflicts with a mapping assigned |\n-|__________________________________|_____|previously_to_another_client________|\n-|internal_port_must_match_external |724 |Internal and external port value |\n-|__________________________________|_____|must_be_the_same____________________|\n-| | |The NAT implementation only supports|\n-|only_permanent_leases_supported |725 |permanent lease times on port |\n-|__________________________________|_____|mappings____________________________|\n-| | |RemoteHost must be a wildcard and |\n-|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |\n-|__________________________________|_____|DNS_name____________________________|\n-|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |\n-|__________________________________|_____|cannot_be_a_specific_port___________|\n+****** int ******\n+Declared in \"libtorrent/version.hpp\"\n+ version_major\n+ the major, minor and tiny versions of libtorrent\n+ version_minor\n+ the major, minor and tiny versions of libtorrent\n+ version_tiny\n+ the major, minor and tiny versions of libtorrent\n [report_issue]\n-****** enum pcp_errors ******\n-Declared in \"libtorrent/natpmp.hpp\"\n- _____________________________________________\n-|name_______________________|value|description|\n-|pcp_success________________|0____|\u00a0_________|\n-|pcp_unsupp_version_________|1____|\u00a0_________|\n-|pcp_not_authorized_________|2____|\u00a0_________|\n-|pcp_malformed_request______|3____|\u00a0_________|\n-|pcp_unsupp_opcode__________|4____|\u00a0_________|\n-|pcp_unsupp_option__________|5____|\u00a0_________|\n-|pcp_malformed_option_______|6____|\u00a0_________|\n-|pcp_network_failure________|7____|\u00a0_________|\n-|pcp_no_resources___________|8____|\u00a0_________|\n-|pcp_unsupp_protocol________|9____|\u00a0_________|\n-|pcp_user_ex_quota__________|10___|\u00a0_________|\n-|pcp_cannot_provide_external|11___|\u00a0_________|\n-|pcp_address_mismatch_______|12___|\u00a0_________|\n-|pcp_excessive_remote_peers_|13___|\u00a0_________|\n+****** char const* ******\n+Declared in \"libtorrent/version.hpp\"\n+ version_str\n+ the libtorrent version in string form\n [report_issue]\n-****** enum error_code_enum ******\n-Declared in \"libtorrent/bdecode.hpp\"\n- ___________________________________________________________________________\n-|name__________|value|description___________________________________________|\n-|no_error______|0____|Not_an_error__________________________________________|\n-|expected_digit|1____|expected_digit_in_bencoded_string_____________________|\n-|expected_colon|2____|expected_colon_in_bencoded_string_____________________|\n-|unexpected_eof|3____|unexpected_end_of_file_in_bencoded_string_____________|\n-|expected_value|4 |expected value (list, dict, int or string) in bencoded|\n-|______________|_____|string________________________________________________|\n-|depth_exceeded|5____|bencoded_recursion_depth_limit_exceeded_______________|\n-|limit_exceeded|6____|bencoded_item_count_limit_exceeded____________________|\n-|overflow______|7____|integer_overflow______________________________________|\n-|error_code_max|8____|the_number_of_error_codes_____________________________|\n+****** std::uint64_t ******\n+Declared in \"libtorrent/version.hpp\"\n+ version_revision\n+ the git commit of this libtorrent version\n [report_issue]\n-****** enum i2p_error_code ******\n-Declared in \"libtorrent/i2p_stream.hpp\"\n- _________________________________\n-|name___________|value|description|\n-|no_error_______|0____|\u00a0_________|\n-|parse_failed___|1____|\u00a0_________|\n-|cant_reach_peer|2____|\u00a0_________|\n-|i2p_error______|3____|\u00a0_________|\n-|invalid_key____|4____|\u00a0_________|\n-|invalid_id_____|5____|\u00a0_________|\n-|timeout________|6____|\u00a0_________|\n-|key_not_found__|7____|\u00a0_________|\n-|duplicated_id__|8____|\u00a0_________|\n-|num_errors_____|9____|\u00a0_________|\n+****** pex_flags_t ******\n+Declared in \"libtorrent/pex_flags.hpp\"\n+ pex_encryption\n+ the peer supports protocol encryption\n+ pex_seed\n+ the peer is a seed\n+ pex_utp\n+ the peer supports the uTP, transport protocol over UDP.\n+ pex_holepunch\n+ the peer supports the holepunch extension If this flag is received from a\n+ peer, it can be used as a rendezvous point in case direct connections to\n+ the peer fail\n+ pex_lt_v2\n+ protocol v2 this is not a standard flag, it is only used internally\n [report_issue]\n-****** enum error_code_enum ******\n-Declared in \"libtorrent/gzip.hpp\"\n- _____________________________________________________________________________\n-|name_______________________________|value|description________________________|\n-|no_error___________________________|0____|Not_an_error_______________________|\n-|invalid_gzip_header |1 |the supplied gzip buffer has |\n-|___________________________________|_____|invalid_header_____________________|\n-| | |the gzip buffer would inflate to |\n-|inflated_data_too_large |2 |more bytes than the specified |\n-|___________________________________|_____|maximum_size,_and_was_rejected.____|\n-|data_did_not_terminate |3 |available inflate data did not |\n-|___________________________________|_____|terminate__________________________|\n-|space_exhausted |4 |output space exhausted before |\n-|___________________________________|_____|completing_inflate_________________|\n-|invalid_block_type_________________|5____|invalid_block_type_(type_==_3)_____|\n-|invalid_stored_block_length |6 |stored block length did not match |\n-|___________________________________|_____|one's_complement___________________|\n-|too_many_length_or_distance_codes |7 |dynamic block code description: too|\n-|___________________________________|_____|many_length_or_distance_codes______|\n-|code_lengths_codes_incomplete |8 |dynamic block code description: |\n-|___________________________________|_____|code_lengths_codes_incomplete______|\n-|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\n-|___________________________________|_____|repeat_lengths_with_no_first_length|\n-|repeat_more_than_specified_lengths |10 |dynamic block code description: |\n-|___________________________________|_____|repeat_more_than_specified_lengths_|\n-|invalid_literal_length_code_lengths|11 |dynamic block code description: |\n-|___________________________________|_____|invalid_literal/length_code_lengths|\n-|invalid_distance_code_lengths |12 |dynamic block code description: |\n-|___________________________________|_____|invalid_distance_code_lengths______|\n-|invalid_literal_code_in_block |13 |invalid literal/length or distance |\n-|___________________________________|_____|code_in_fixed_or_dynamic_block_____|\n-|distance_too_far_back_in_block |14 |distance is too far back in fixed |\n-|___________________________________|_____|or_dynamic_block___________________|\n-|unknown_gzip_error |15 |an unknown error occurred during |\n-|___________________________________|_____|gzip_inflation_____________________|\n-|error_code_max_____________________|16___|the_number_of_error_codes__________|\n+****** download_priority_t ******\n+Declared in \"libtorrent/download_priority.hpp\"\n+ dont_download\n+ Don't download the file or piece. Partial pieces may still be downloaded\n+ when setting file priorities.\n+ default_priority\n+ The default priority for files and pieces.\n+ low_priority\n+ The lowest priority for files and pieces.\n+ top_priority\n+ The highest priority for files and pieces.\n [report_issue]\n-****** stats_metric ******\n-Declared in \"libtorrent/session_stats.hpp\"\n-describes one statistics metric from the session. For more information, see the\n-session_statistics section.\n-struct stats_metric\n+****** torrent_flags_t ******\n+Declared in \"libtorrent/torrent_flags.hpp\"\n+ seed_mode\n+ If seed_mode is set, libtorrent will assume that all files are present\n+ for this torrent and that they all match the hashes in the torrent file.\n+ Each time a peer requests to download a block, the piece is verified\n+ against the hash, unless it has been verified already. If a hash fails,\n+ the torrent will automatically leave the seed mode and recheck all the\n+ files. The use case for this mode is if a torrent is created and seeded,\n+ or if the user already know that the files are complete, this is a way to\n+ avoid the initial file checks, and significantly reduce the startup time.\n+ Setting seed_mode on a torrent without metadata (a .torrent file) is a\n+ no-op and will be ignored.\n+ It is not possible to set the seed_mode flag on a torrent after it has\n+ been added to a session. It is possible to clear it though.\n+ upload_mode\n+ If upload_mode is set, the torrent will be initialized in upload-mode,\n+ which means it will not make any piece requests. This state is typically\n+ entered on disk I/O errors, and if the torrent is also auto managed, it\n+ will be taken out of this state periodically (see settings_pack::\n+ optimistic_disk_retry).\n+ This mode can be used to avoid race conditions when adjusting priorities\n+ of pieces before allowing the torrent to start downloading.\n+ If the torrent is auto-managed (auto_managed), the torrent will\n+ eventually be taken out of upload-mode, regardless of how it got there.\n+ If it's important to manually control when the torrent leaves upload\n+ mode, don't make it auto managed.\n+ share_mode\n+ determines if the torrent should be added in share mode or not. Share\n+ mode indicates that we are not interested in downloading the torrent, but\n+ merely want to improve our share ratio (i.e. increase it). A torrent\n+ started in share mode will do its best to never download more than it\n+ uploads to the swarm. If the swarm does not have enough demand for upload\n+ capacity, the torrent will not download anything. This mode is intended\n+ to be safe to add any number of torrents to, without manual screening,\n+ without the risk of downloading more than is uploaded.\n+ A torrent in share mode sets the priority to all pieces to 0, except for\n+ the pieces that are downloaded, when pieces are decided to be downloaded.\n+ This affects the progress bar, which might be set to \"100% finished\" most\n+ of the time. Do not change file or piece priorities for torrents in share\n+ mode, it will make it not work.\n+ The share mode has one setting, the share ratio target, see\n+ settings_pack::share_mode_target for more info.\n+ apply_ip_filter\n+ determines if the IP filter should apply to this torrent or not. By\n+ default all torrents are subject to filtering by the IP filter (i.e. this\n+ flag is set by default). This is useful if certain torrents needs to be\n+ exempt for some reason, being an auto-update torrent for instance.\n+ paused\n+ specifies whether or not the torrent is paused. i.e. it won't connect to\n+ the tracker or any of the peers until it's resumed. Note that a paused\n+ torrent that also has the auto_managed flag set can be started at any\n+ time by libtorrent's queuing logic. See queuing.\n+ auto_managed\n+ If the torrent is auto-managed (auto_managed), the torrent may be resumed\n+ at any point, regardless of how it paused. If it's important to manually\n+ control when the torrent is paused and resumed, don't make it auto\n+ managed.\n+ If auto_managed is set, the torrent will be queued, started and seeded\n+ automatically by libtorrent. When this is set, the torrent should also be\n+ started as paused. The default queue order is the order the torrents were\n+ added. They are all downloaded in that order. For more details, see\n+ queuing.\n+ duplicate_is_error\n+ used in add_torrent_params to indicate that it's an error to attempt to\n+ add a torrent that's already in the session. If it's not considered an\n+ error, a handle to the existing torrent is returned. This flag is not\n+ saved by write_resume_data(), since it is only meant for adding torrents.\n+ update_subscribe\n+ on by default and means that this torrent will be part of state updates\n+ when calling post_torrent_updates(). This flag is not saved by\n+ write_resume_data().\n+ super_seeding\n+ sets the torrent into super seeding/initial seeding mode. If the torrent\n+ is not a seed, this flag has no effect.\n+ sequential_download\n+ sets the sequential download state for the torrent. In this mode the\n+ piece picker will pick pieces with low index numbers before pieces with\n+ high indices. The actual pieces that are picked depend on other factors\n+ still, such as which pieces a peer has and whether it is in parole mode\n+ or \"prefer whole pieces\"-mode. Sequential mode is not ideal for streaming\n+ media. For that, see set_piece_deadline() instead.\n+ stop_when_ready\n+ When this flag is set, the torrent will force stop whenever it\n+ transitions from a non-data-transferring state into a data-transferring\n+ state (referred to as being ready to download or seed). This is useful\n+ for torrents that should not start downloading or seeding yet, but want\n+ to be made ready to do so. A torrent may need to have its files checked\n+ for instance, so it needs to be started and possibly queued for checking\n+ (auto-managed and started) but as soon as it's done, it should be\n+ stopped.\n+ Force stopped means auto-managed is set to false and it's paused. As if\n+ the auto_manages flag is cleared and the paused flag is set on the\n+ torrent.\n+ Note that the torrent may transition into a downloading state while\n+ setting this flag, and since the logic is edge triggered you may miss the\n+ edge. To avoid this race, if the torrent already is in a downloading\n+ state when this call is made, it will trigger the stop-when-ready\n+ immediately.\n+ When the stop-when-ready logic fires, the flag is cleared. Any subsequent\n+ transitions between downloading and non-downloading states will not be\n+ affected, until this flag is set again.\n+ The behavior is more robust when setting this flag as part of adding the\n+ torrent. See add_torrent_params.\n+ The stop-when-ready flag fixes the inherent race condition of waiting for\n+ the state_changed_alert and then call pause(). The download/seeding will\n+ most likely start in between posting the alert and receiving the call to\n+ pause.\n+ A downloading state is one where peers are being connected. Which means\n+ just downloading the metadata via the ut_metadata extension counts as a\n+ downloading state. In order to stop a torrent once the metadata has been\n+ downloaded, instead set all file priorities to dont_download\n+ override_trackers\n+ when this flag is set, the tracker list in the add_torrent_params object\n+ override any trackers from the torrent file. If the flag is not set, the\n+ trackers from the add_torrent_params object will be added to the list of\n+ trackers used by the torrent. This flag is set by read_resume_data() if\n+ there are trackers present in the resume data file. This effectively\n+ makes the trackers saved in the resume data take precedence over the\n+ original trackers. This includes if there's an empty list of trackers, to\n+ support the case where they were explicitly removed in the previous\n+ session. This flag is not saved by write_resume_data()\n+ override_web_seeds\n+ If this flag is set, the web seeds from the add_torrent_params object\n+ will override any web seeds in the torrent file. If it's not set, web\n+ seeds in the add_torrent_params object will be added to the list of web\n+ seeds used by the torrent. This flag is set by read_resume_data() if\n+ there are web seeds present in the resume data file. This effectively\n+ makes the web seeds saved in the resume data take precedence over the\n+ original ones. This includes if there's an empty list of web seeds, to\n+ support the case where they were explicitly removed in the previous\n+ session. This flag is not saved by write_resume_data()\n+ need_save_resume\n+ if this flag is set (which it is by default) the torrent will be\n+ considered needing to save its resume data immediately as it's added. New\n+ torrents that don't have any resume data should do that. This flag is\n+ cleared by a successful call to save_resume_data() This flag is not saved\n+ by write_resume_data(), since it represents an ephemeral state of a\n+ running torrent.\n+ disable_dht\n+ set this flag to disable DHT for this torrent. This lets you have the DHT\n+ enabled for the whole client, and still have specific torrents not\n+ participating in it. i.e. not announcing to the DHT nor picking up peers\n+ from it.\n+ disable_lsd\n+ set this flag to disable local service discovery for this torrent.\n+ disable_pex\n+ set this flag to disable peer exchange for this torrent.\n+ no_verify_files\n+ if this flag is set, the resume data will be assumed to be correct\n+ without validating it against any files on disk. This may be used when\n+ restoring a session by loading resume data from disk. It will save time\n+ and also delay any hard disk errors until files are actually needed. If\n+ the resume data cannot be trusted, or if a torrent is added for the first\n+ time to some save path that may already have some of the files, this flag\n+ should not be set.\n+ default_dont_download\n+ default all file priorities to dont_download. This is useful for adding\n+ magnet links where the number of files is unknown, but the\n+ file_priorities is still set for some files. Any file not covered by the\n+ file_priorities list will be set to normal download priority, unless this\n+ flag is set, in which case they will be set to 0 (dont_download).\n+ all\n+ all torrent flags combined. Can conveniently be used when creating masks\n+ for flags\n+[report_issue]\n+****** file_slice ******\n+Declared in \"libtorrent/file_storage.hpp\"\n+represents a window of a file in a torrent.\n+The file_index refers to the index of the file (in the torrent_info). To get\n+the path and filename, use file_path() and give the file_index as argument. The\n+offset is the byte offset in the file where the range starts, and size is the\n+number of bytes this range is. The size + offset will never be greater than the\n+file size.\n+struct file_slice\n {\n- char const* name;\n- int value_index;\n- metric_type_t type;\n+ file_index_t file_index;\n+ std::int64_t offset;\n+ std::int64_t size;\n };\n [report_issue]\n- name\n- the name of the counter or gauge\n- [report_issue]\n- value_index type\n- the index into the session stats array, where the underlying value of\n- this counter or gauge is found. The session stats array is part of the\n- session_stats_alert object.\n+ file_index\n+ the index of the file\n [report_issue]\n-****** counters ******\n-Declared in \"libtorrent/performance_counters.hpp\"\n-struct counters\n+ offset\n+ the offset from the start of the file, in bytes\n+[report_issue]\n+ size\n+ the size of the window, in bytes\n+[report_issue]\n+****** file_storage ******\n+Declared in \"libtorrent/file_storage.hpp\"\n+The file_storage class represents a file list and the piece size. Everything\n+necessary to interpret a regular bittorrent storage file structure.\n+class file_storage\n {\n- counters () ;\n- counters& operator= (counters const&) & ;\n- counters (counters const&) ;\n- std::int64_t operator[] (int i) const ;\n- std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n- void set_value (int c, std::int64_t value) ;\n- void blend_stats_counter (int c, std::int64_t value, int ratio) ;\n+ bool is_valid () const;\n+ void reserve (int num_files);\n+ void add_file (std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+ void add_file_borrow (error_code& ec, string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+ void add_file (error_code& ec, std::string const& path, std::int64_t\n+file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+ void add_file_borrow (string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+ void rename_file (file_index_t index, std::string const& new_filename);\n+ std::vector map_block (piece_index_t piece, std::int64_t offset\n+ , std::int64_t size) const;\n+ peer_request map_file (file_index_t file, std::int64_t offset, int size)\n+const;\n+ int num_files () const noexcept;\n+ file_index_t end_file () const noexcept;\n+ index_range file_range () const noexcept;\n+ std::int64_t total_size () const;\n+ void set_num_pieces (int n);\n+ int num_pieces () const;\n+ piece_index_t end_piece () const;\n+ piece_index_t last_piece () const;\n+ index_range piece_range () const noexcept;\n+ int piece_length () const;\n+ void set_piece_length (int l);\n+ int piece_size (piece_index_t index) const;\n+ int piece_size2 (piece_index_t index) const;\n+ int blocks_in_piece2 (piece_index_t index) const;\n+ void set_name (std::string const& n);\n+ std::string const& name () const;\n+ void swap (file_storage& ti) noexcept;\n+ void canonicalize ();\n+ std::string symlink (file_index_t index) const;\n+ std::time_t mtime (file_index_t index) const;\n+ bool pad_file_at (file_index_t index) const;\n+ std::int64_t file_size (file_index_t index) const;\n+ sha1_hash hash (file_index_t index) const;\n+ std::int64_t file_offset (file_index_t index) const;\n+ sha256_hash root (file_index_t index) const;\n+ char const* root_ptr (file_index_t const index) const;\n+ std::string file_path (file_index_t index, std::string const& save_path =\n+\"\") const;\n+ string_view file_name (file_index_t index) const;\n+ int file_num_pieces (file_index_t index) const;\n+ int file_num_blocks (file_index_t index) const;\n+ index_range file_piece_range (file_index_t) const;\n+ int file_first_block_node (file_index_t index) const;\n+ int file_first_piece_node (file_index_t index) const;\n+ std::uint32_t file_path_hash (file_index_t index, std::string const&\n+save_path) const;\n+ void all_path_hashes (std::unordered_set& table) const;\n+ file_flags_t file_flags (file_index_t index) const;\n+ bool file_absolute_path (file_index_t index) const;\n+ file_index_t file_index_at_offset (std::int64_t offset) const;\n+ file_index_t file_index_at_piece (piece_index_t piece) const;\n+ file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n+ piece_index_t piece_index_at_file (file_index_t f) const;\n+ void sanitize_symlinks ();\n+ bool v2 () const;\n+\n+ static constexpr file_flags_t flag_pad_file = 0_bit;\n+ static constexpr file_flags_t flag_hidden = 1_bit;\n+ static constexpr file_flags_t flag_executable = 2_bit;\n+ static constexpr file_flags_t flag_symlink = 3_bit;\n };\n+[report_issue]\n+***** is_valid() *****\n+bool is_valid () const;\n+returns true if the piece length has been initialized on the file_storage. This\n+is typically taken as a proxy of whether the file_storage as a whole is\n+initialized or not.\n+[report_issue]\n+***** reserve() *****\n+void reserve (int num_files);\n+allocates space for num_files in the internal file list. This can be used to\n+avoid reallocating the internal file list when the number of files to be added\n+is known up-front.\n [report_issue]\n-***** inc_stats_counter() operator[]() *****\n-std::int64_t operator[] (int i) const ;\n-std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n-returns the new value\n+***** add_file() add_file_borrow() *****\n+void add_file (std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+void add_file_borrow (error_code& ec, string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+void add_file_borrow (string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+Adds a file to the file storage. The add_file_borrow version expects that\n+filename is the file name (without a path) of the file that's being added. This\n+memory is borrowed, i.e. it is the caller's responsibility to make sure it\n+stays valid throughout the lifetime of this file_storage object or any copy of\n+it. The same thing applies to filehash, which is an optional pointer to a 20\n+byte binary SHA-1 hash of the file.\n+if filename is empty, the filename from path is used and not borrowed.\n+The path argument is the full path (in the torrent file) to the file to add.\n+Note that this is not supposed to be an absolute path, but it is expected to\n+include the name of the torrent as the first path element.\n+file_size is the size of the file in bytes.\n+The file_flags argument sets attributes on the file. The file attributes is an\n+extension and may not work in all bittorrent clients.\n+For possible file attributes, see file_storage::flags_t.\n+The mtime argument is optional and can be set to 0. If non-zero, it is the\n+posix time of the last modification time of this file.\n+symlink_path is the path the file is a symlink to. To make this a symlink you\n+also need to set the file_storage::flag_symlink file flag.\n+root_hash is an optional pointer to a 32 byte SHA-256 hash, being the merkle\n+tree root hash for this file. This is only used for v2 torrents. If the root\n+hash is specified for one file, it has to be specified for all, otherwise this\n+function will fail. Note that the buffer root_hash points to must out-live the\n+file_storage object, it will not be copied. This parameter is only used when\n+loading torrents, that already have their file hashes computed. When creating\n+torrents, the file hashes will be computed by the piece hashes.\n+If more files than one are added, certain restrictions to their paths apply. In\n+a multi-file file storage (torrent), all files must share the same root\n+directory.\n+That is, the first path element of all files must be the same. This shared path\n+element is also set to the name of the torrent. It can be changed by calling\n+set_name.\n+The overloads that take anerror_codereference will report failures via that\n+variable, otherwisesystem_erroris thrown.\n [report_issue]\n-****** session_stats_metrics() ******\n-Declared in \"libtorrent/session_stats.hpp\"\n-std::vector session_stats_metrics ();\n-This free function returns the list of available metrics exposed by\n-libtorrent's statistics API. Each metric has a name and a value index. The\n-value index is the index into the array in session_stats_alert where this\n-metric's value can be found when the session stats is sampled (by calling\n-post_session_stats()).\n+***** rename_file() *****\n+void rename_file (file_index_t index, std::string const& new_filename);\n+renames the file at index to new_filename. Keep in mind that filenames are\n+expected to be UTF-8 encoded.\n [report_issue]\n-****** find_metric_idx() ******\n-Declared in \"libtorrent/session_stats.hpp\"\n-int find_metric_idx (string_view name);\n-given a name of a metric, this function returns the counter index of it, or -\n-1 if it could not be found. The counter index is the index into the values\n-array returned by session_stats_alert.\n+***** map_block() *****\n+std::vector map_block (piece_index_t piece, std::int64_t offset\n+ , std::int64_t size) const;\n+returns a list of file_slice objects representing the portions of files the\n+specified piece index, byte offset and size range overlaps. this is the inverse\n+mapping of map_file().\n+Preconditions of this function is that the input range is within the torrents\n+address space. piece may not be negative and\n+ piece * piece_size + offset + size\n+may not exceed the total size of the torrent.\n [report_issue]\n-****** enum metric_type_t ******\n-Declared in \"libtorrent/session_stats.hpp\"\n- _________________________\n-|name___|value|description|\n-|counter|0____|\u00a0_________|\n-|gauge__|1____|\u00a0_________|\n+***** map_file() *****\n+peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n+returns a peer_request representing the piece index, byte offset and size the\n+specified file range overlaps. This is the inverse mapping over map_block().\n+Note that the peer_request return type is meant to hold bittorrent block\n+requests, which may not be larger than 16 kiB. Mapping a range larger than that\n+may return an overflown integer.\n [report_issue]\n-****** peer_class_info ******\n-Declared in \"libtorrent/peer_class.hpp\"\n-holds settings for a peer class. Used in set_peer_class() and get_peer_class()\n-calls.\n-struct peer_class_info\n-{\n- bool ignore_unchoke_slots;\n- int connection_limit_factor;\n- std::string label;\n- int upload_limit;\n- int download_limit;\n- int upload_priority;\n- int download_priority;\n-};\n+***** num_files() *****\n+int num_files () const noexcept;\n+returns the number of files in the file_storage\n [report_issue]\n- ignore_unchoke_slots\n- ignore_unchoke_slots determines whether peers should always unchoke a\n- peer, regardless of the choking algorithm, or if it should honor the\n- unchoke slot limits. It's used for local peers by default. If any of the\n- peer classes a peer belongs to has this set to true, that peer will be\n- unchoked at all times.\n+***** end_file() *****\n+file_index_t end_file () const noexcept;\n+returns the index of the one-past-end file in the file storage\n [report_issue]\n- connection_limit_factor\n- adjusts the connection limit (global and per torrent) that applies to\n- this peer class. By default, local peers are allowed to exceed the normal\n- connection limit for instance. This is specified as a percent factor. 100\n- makes the peer class apply normally to the limit. 200 means as long as\n- there are fewer connections than twice the limit, we accept this peer.\n- This factor applies both to the global connection limit and the per-\n- torrent limit. Note that if not used carefully one peer class can\n- potentially completely starve out all other over time.\n+***** file_range() *****\n+index_range file_range () const noexcept;\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all files in the\n+file_storage.\n [report_issue]\n- label\n- not used by libtorrent. It's intended as a potentially user-facing\n- identifier of this peer class.\n+***** total_size() *****\n+std::int64_t total_size () const;\n+returns the total number of bytes all the files in this torrent spans\n [report_issue]\n- upload_limit download_limit\n- transfer rates limits for the whole peer class. They are specified in\n- bytes per second and apply to the sum of all peers that are members of\n- this class.\n+***** set_num_pieces() num_pieces() *****\n+void set_num_pieces (int n);\n+int num_pieces () const;\n+set and get the number of pieces in the torrent\n+[report_issue]\n+***** end_piece() *****\n+piece_index_t end_piece () const;\n+returns the index of the one-past-end piece in the file storage\n+[report_issue]\n+***** last_piece() *****\n+piece_index_t last_piece () const;\n+returns the index of the last piece in the torrent. The last piece is special\n+in that it may be smaller than the other pieces (and the other pieces are all\n+the same size).\n+[report_issue]\n+***** piece_range() *****\n+index_range piece_range () const noexcept;\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all pieces in the\n+file_storage.\n [report_issue]\n- upload_priority download_priority\n- relative priorities used by the bandwidth allocator in the rate limiter.\n- If no rate limits are in use, the priority is not used either. Priorities\n- start at 1 (0 is not a valid priority) and may not exceed 255.\n+***** piece_length() set_piece_length() *****\n+int piece_length () const;\n+void set_piece_length (int l);\n+set and get the size of each piece in this torrent. It must be a power of two\n+and at least 16 kiB.\n [report_issue]\n-****** peer_class_type_filter ******\n-Declared in \"libtorrent/peer_class_type_filter.hpp\"\n-peer_class_type_filter is a simple container for rules for adding and\n-subtracting peer-classes from peers. It is applied after the peer class filter\n-is applied (which is based on the peer's IP address).\n-struct peer_class_type_filter\n+***** piece_size() *****\n+int piece_size (piece_index_t index) const;\n+returns the piece size of index. This will be the same as piece_length(),\n+except for the last piece, which may be shorter.\n+[report_issue]\n+***** piece_size2() *****\n+int piece_size2 (piece_index_t index) const;\n+Returns the size of the given piece. If the piece spans multiple files, only\n+the first file is considered part of the piece. This is used for v2 torrents,\n+where all files are piece aligned and padded. i.e. The pad files are not\n+considered part of the piece for this purpose.\n+[report_issue]\n+***** blocks_in_piece2() *****\n+int blocks_in_piece2 (piece_index_t index) const;\n+returns the number of blocks in the specified piece, for v2 torrents.\n+ [report_issue]\n+***** name() set_name() *****\n+void set_name (std::string const& n);\n+std::string const& name () const;\n+set and get the name of this torrent. For multi-file torrents, this is also the\n+name of the root directory all the files are stored in.\n+[report_issue]\n+***** swap() *****\n+void swap (file_storage& ti) noexcept;\n+swap all content of this with ti.\n+[report_issue]\n+***** canonicalize() *****\n+void canonicalize ();\n+arrange files and padding to match the canonical form required by BEP 52\n+ [report_issue]\n+***** file_path() mtime() pad_file_at() symlink() file_offset() root_ptr() hash\n+() file_name() root() file_size() *****\n+std::string symlink (file_index_t index) const;\n+std::time_t mtime (file_index_t index) const;\n+bool pad_file_at (file_index_t index) const;\n+std::int64_t file_size (file_index_t index) const;\n+sha1_hash hash (file_index_t index) const;\n+std::int64_t file_offset (file_index_t index) const;\n+sha256_hash root (file_index_t index) const;\n+char const* root_ptr (file_index_t const index) const;\n+std::string file_path (file_index_t index, std::string const& save_path = \"\")\n+const;\n+string_view file_name (file_index_t index) const;\n+These functions are used to query attributes of files at a given index.\n+The hash() is a SHA-1 hash of the file, or 0 if none was provided in the\n+torrent file. This can potentially be used to join a bittorrent network with\n+other file sharing networks.\n+root() returns the SHA-256 merkle tree root of the specified file, in case this\n+is a v2 torrent. Otherwise returns zeros. root_ptr() returns a pointer to the\n+SHA-256 merkle tree root hash for the specified file. The pointer points into\n+storage referred to when the file was added, it is not owned by this object.\n+Torrents that are not v2 torrents return nullptr.\n+The mtime() is the modification time is the posix time when a file was last\n+modified when the torrent was created, or 0 if it was not included in the\n+torrent file.\n+file_path() returns the full path to a file.\n+file_size() returns the size of a file.\n+pad_file_at() returns true if the file at the given index is a pad-file.\n+file_name() returns just the name of the file, whereas file_path() returns the\n+path (inside the torrent file) with the filename appended.\n+file_offset() returns the byte offset within the torrent file where this file\n+starts. It can be used to map the file to a piece index (given the piece size).\n+ [report_issue]\n+***** file_num_pieces() file_num_blocks() file_piece_range() *****\n+int file_num_pieces (file_index_t index) const;\n+int file_num_blocks (file_index_t index) const;\n+index_range file_piece_range (file_index_t) const;\n+Returns the number of pieces or blocks the file atindexspans, under the\n+assumption that the file is aligned to the start of a piece. This is only\n+meaningful for v2 torrents, where files are guaranteed such alignment. These\n+numbers are used to size and navigate the merkle hash tree for each file.\n+ [report_issue]\n+***** file_first_block_node() file_first_piece_node() *****\n+int file_first_block_node (file_index_t index) const;\n+int file_first_piece_node (file_index_t index) const;\n+index of first piece node in the merkle tree\n+[report_issue]\n+***** file_path_hash() *****\n+std::uint32_t file_path_hash (file_index_t index, std::string const& save_path)\n+const;\n+returns the crc32 hash of file_path(index)\n+[report_issue]\n+***** all_path_hashes() *****\n+void all_path_hashes (std::unordered_set& table) const;\n+this will add the CRC32 hash of all directory entries to the table. No filename\n+will be included, just directories. Every depth of directories are added\n+separately to allow test for collisions with files at all levels. i.e. if one\n+path in the torrent is foo/bar/baz, the CRC32 hashes for foo, foo/bar and foo/\n+bar/baz will be added to the set.\n+[report_issue]\n+***** file_flags() *****\n+file_flags_t file_flags (file_index_t index) const;\n+returns a bitmask of flags from file_flags_t that apply to file at index.\n+[report_issue]\n+***** file_absolute_path() *****\n+bool file_absolute_path (file_index_t index) const;\n+returns true if the file at the specified index has been renamed to have an\n+absolute path, i.e. is not anchored in the save path of the torrent.\n+ [report_issue]\n+***** file_index_at_piece() file_index_at_offset() *****\n+file_index_t file_index_at_offset (std::int64_t offset) const;\n+file_index_t file_index_at_piece (piece_index_t piece) const;\n+returns the index of the file at the given offset in the torrent\n+[report_issue]\n+***** file_index_for_root() *****\n+file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n+finds the file with the given root hash and returns its index if there is no\n+file with the root hash, file_index_t{-1} is returned\n+[report_issue]\n+***** piece_index_at_file() *****\n+piece_index_t piece_index_at_file (file_index_t f) const;\n+returns the piece index the given file starts at\n+[report_issue]\n+***** sanitize_symlinks() *****\n+void sanitize_symlinks ();\n+validate any symlinks, to ensure they all point to other files or directories\n+inside this storage. Any invalid symlinks are updated to point to themselves.\n+[report_issue]\n+***** v2() *****\n+bool v2 () const;\n+returns true if this torrent contains v2 metadata.\n+[report_issue]\n+ flag_pad_file\n+ the file is a pad file. It's required to contain zeros at it will not be\n+ saved to disk. Its purpose is to make the following file start on a piece\n+ boundary.\n+[report_issue]\n+ flag_hidden\n+ this file has the hidden attribute set. This is primarily a windows\n+ attribute\n+[report_issue]\n+ flag_executable\n+ this file has the executable attribute set.\n+[report_issue]\n+ flag_symlink\n+ this file is a symbolic link. It should have a link target string\n+ associated with it.\n+[report_issue]\n+****** storage_params ******\n+Declared in \"libtorrent/storage_defs.hpp\"\n+a parameter pack used to construct the storage for a torrent, used in\n+disk_interface\n+struct storage_params\n {\n- void add (socket_type_t const st, peer_class_t const peer_class);\n- void remove (socket_type_t const st, peer_class_t const peer_class);\n- void disallow (socket_type_t const st, peer_class_t const peer_class);\n- void allow (socket_type_t const st, peer_class_t const peer_class);\n- std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n- friend bool operator== (peer_class_type_filter const& lhs\n- , peer_class_type_filter const& rhs);\n+ storage_params (file_storage const& f, file_storage const* mf\n+ , std::string const& sp, storage_mode_t const sm\n+ , aux::vector const& prio\n+ , sha1_hash const& ih);\n \n- enum socket_type_t\n- {\n- tcp_socket,\n- utp_socket,\n- ssl_tcp_socket,\n- ssl_utp_socket,\n- i2p_socket,\n- num_socket_types,\n- };\n+ file_storage const& files;\n+ file_storage const* mapped_files = nullptr;\n+ std::string const& path;\n+ storage_mode_t mode {storage_mode_sparse};\n+ aux::vector const& priorities;\n+ sha1_hash info_hash;\n };\n- [report_issue]\n-***** add() remove() *****\n-void add (socket_type_t const st, peer_class_t const peer_class);\n-void remove (socket_type_t const st, peer_class_t const peer_class);\n-add() and remove() adds and removes a peer class to be added to new peers based\n-on socket type.\n- [report_issue]\n-***** disallow() allow() *****\n-void disallow (socket_type_t const st, peer_class_t const peer_class);\n-void allow (socket_type_t const st, peer_class_t const peer_class);\n-disallow() and allow() adds and removes a peer class to be removed from new\n-peers based on socket type.\n-The peer_class argument cannot be greater than 31. The bitmasks representing\n-peer classes in the peer_class_type_filter are 32 bits.\n [report_issue]\n-***** apply() *****\n-std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n-takes a bitmask of peer classes and returns a new bitmask of peer classes after\n-the rules have been applied, based on the socket type argument (st).\n+****** mmap_disk_io_constructor() ******\n+Declared in \"libtorrent/mmap_disk_io.hpp\"\n+std::unique_ptr mmap_disk_io_constructor (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+constructs a memory mapped file disk I/O object.\n [report_issue]\n-***** enum socket_type_t *****\n-Declared in \"libtorrent/peer_class_type_filter.hpp\"\n- ________________________________________________________________________\n-|name____________|value|description______________________________________|\n-|tcp_socket |0 |these match the socket types from socket_type.hpp|\n-|________________|_____|shifted_one_down_________________________________|\n-|utp_socket______|1____|\u00a0_______________________________________________|\n-|ssl_tcp_socket__|2____|\u00a0_______________________________________________|\n-|ssl_utp_socket__|3____|\u00a0_______________________________________________|\n-|i2p_socket______|4____|\u00a0_______________________________________________|\n-|num_socket_types|5____|\u00a0_______________________________________________|\n+****** posix_disk_io_constructor() ******\n+Declared in \"libtorrent/posix_disk_io.hpp\"\n+std::unique_ptr posix_disk_io_constructor (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+this is a simple posix disk I/O back-end, used for systems that don't have a 64\n+bit virtual address space or don't support memory mapped files. It's\n+implemented using portable C file functions and is single-threaded.\n+[report_issue]\n+****** disabled_disk_io_constructor() ******\n+Declared in \"libtorrent/disabled_disk_io.hpp\"\n+std::unique_ptr disabled_disk_io_constructor (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+creates a disk io object that discards all data written to it, and only returns\n+zero-buffers when read from. May be useful for testing and benchmarking.\n+[report_issue]\n+****** default_disk_io_constructor() ******\n+Declared in \"libtorrent/session.hpp\"\n+std::unique_ptr default_disk_io_constructor (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+the constructor function for the default storage. On systems that support\n+memory mapped files (and a 64 bit address space) the memory mapped storage will\n+be constructed, otherwise the portable posix storage.\n+[report_issue]\n+****** enum storage_mode_t ******\n+Declared in \"libtorrent/storage_defs.hpp\"\n+ ___________________________________________________________________________\n+|name_________________|value|description____________________________________|\n+| | |All pieces will be written to their final |\n+| | |position, all files will be allocated in full |\n+|storage_mode_allocate|0 |when the torrent is first started. This mode |\n+| | |minimizes fragmentation but could be a costly |\n+|_____________________|_____|operation._____________________________________|\n+| | |All pieces will be written to the place where |\n+|storage_mode_sparse |1 |they belong and sparse files will be used. This|\n+|_____________________|_____|is_the_recommended,_and_default_mode.__________|\n+[report_issue]\n+****** enum status_t ******\n+Declared in \"libtorrent/storage_defs.hpp\"\n+ ____________________________________________________________________________\n+|name____________|value|description__________________________________________|\n+|no_error________|0____|\u00a0___________________________________________________|\n+|fatal_disk_error|1____|\u00a0___________________________________________________|\n+|need_full_check_|2____|\u00a0___________________________________________________|\n+|file_exist______|3____|\u00a0___________________________________________________|\n+| | |this is not an enum value, but a flag that can be set|\n+| | |in the return from async_check_files, in case an |\n+|oversized_file |16 |existing file was found larger than specified in the |\n+| | |torrent. i.e. it has garbage at the end the status_t |\n+|________________|_____|field_is_used_for_this_to_preserve_ABI.______________|\n+[report_issue]\n+****** enum move_flags_t ******\n+Declared in \"libtorrent/storage_defs.hpp\"\n+ ____________________________________________________________________________\n+|name________________|value|description______________________________________|\n+|always_replace_files|0 |replace any files in the destination when copying|\n+|____________________|_____|or_moving_the_storage____________________________|\n+| | |if any files that we want to copy exist in the |\n+| | |destination exist, fail the whole operation and |\n+| | |don't perform any copy or move. There is an |\n+|fail_if_exist |1 |inherent race condition in this mode. The files |\n+| | |are checked for existence before the operation |\n+| | |starts. In between the check and performing the |\n+| | |copy, the destination files may be created, in |\n+|____________________|_____|which_case_they_are_replaced.____________________|\n+|dont_replace |2 |if any file exist in the target, take those files|\n+|____________________|_____|instead_of_the_ones_we_may_have_in_the_source.___|\n The disk I/O can be customized in libtorrent. In previous versions, the\n customization was at the level of each torrent. Now, the customization point is\n at the session level. All torrents added to a session will use the same disk I/\n O subsystem, as determined by the disk_io_constructor (in session_params).\n This allows the disk subsystem to also customize threading and disk job\n management.\n To customize the disk subsystem, implement disk_interface and provide a factory\n@@ -1972,35 +2338,23 @@\n [report_issue]\n ****** settings_interface ******\n Declared in \"libtorrent/settings_pack.hpp\"\n the common interface to settings_pack and the internal representation of\n settings.\n struct settings_interface\n {\n- virtual bool has_val (int name) const = 0;\n+ virtual void set_bool (int name, bool val) = 0;\n virtual void set_int (int name, int val) = 0;\n virtual void set_str (int name, std::string val) = 0;\n- virtual void set_bool (int name, bool val) = 0;\n+ virtual bool has_val (int name) const = 0;\n virtual int get_int (int name) const = 0;\n virtual std::string const& get_str (int name) const = 0;\n virtual bool get_bool (int name) const = 0;\n };\n [report_issue]\n-****** disk_observer ******\n-Declared in \"libtorrent/disk_observer.hpp\"\n-struct disk_observer\n-{\n- virtual void on_disk () = 0;\n-};\n-[report_issue]\n-***** on_disk() *****\n-virtual void on_disk () = 0;\n-called when the disk cache size has dropped below the low watermark again and\n-we can resume downloading from peers\n-[report_issue]\n ****** open_file_state ******\n Declared in \"libtorrent/disk_interface.hpp\"\n this contains information about a file that's currently open by the libtorrent\n disk I/O subsystem. It's associated with a single torrent.\n struct open_file_state\n {\n file_index_t file_index;\n@@ -2036,21 +2390,21 @@\n thread via the io_context object passed into the constructor. The callbacks\n will be run in the network thread.\n struct disk_interface\n {\n virtual storage_holder new_torrent (storage_params const& p\n , std::shared_ptr const& torrent) = 0;\n virtual void remove_torrent (storage_index_t) = 0;\n- virtual void async_read (storage_index_t storage, peer_request const& r\n- , std::function handler\n- , disk_job_flags_t flags = {}) = 0;\n virtual bool async_write (storage_index_t storage, peer_request const& r\n , char const* buf, std::shared_ptr o\n , std::function handler\n , disk_job_flags_t flags = {}) = 0;\n+ virtual void async_read (storage_index_t storage, peer_request const& r\n+ , std::function handler\n+ , disk_job_flags_t flags = {}) = 0;\n virtual void async_hash (storage_index_t storage, piece_index_t piece,\n span v2\n , disk_job_flags_t flags\n , std::function handler) = 0;\n virtual void async_hash2 (storage_index_t storage, piece_index_t piece, int\n offset, disk_job_flags_t flags\n@@ -2106,21 +2460,21 @@\n ***** remove_torrent() *****\n virtual void remove_torrent (storage_index_t) = 0;\n remove the storage with the specified index. This is not expected to delete any\n files from disk, just to clean up any resources associated with the specified\n storage.\n [report_issue]\n ***** async_read() async_write() *****\n-virtual void async_read (storage_index_t storage, peer_request const& r\n- , std::function handler\n- , disk_job_flags_t flags = {}) = 0;\n virtual bool async_write (storage_index_t storage, peer_request const& r\n , char const* buf, std::shared_ptr o\n , std::function handler\n , disk_job_flags_t flags = {}) = 0;\n+virtual void async_read (storage_index_t storage, peer_request const& r\n+ , std::function handler\n+ , disk_job_flags_t flags = {}) = 0;\n perform a read or write operation from/to the specified storage index and the\n specified request. When the operation completes, call handler possibly with a\n disk_buffer_holder, holding the buffer with the result. Flags may be set to\n affect the read operation. See disk_job_flags_t.\n The disk_observer is a callback to indicate that the store buffer/disk write\n queue is below the watermark to let peers start writing buffers to disk again.\n When async_write() returns true, indicating the write queue is full, the peer\n@@ -2307,17 +2661,17 @@\n a unique, owning, reference to the storage of a torrent in a disk io subsystem\n (class that implements disk_interface). This is held by the internal libtorrent\n torrent object to tie the storage object allocated for a torrent to the\n lifetime of the internal torrent object. When a torrent is removed from the\n session, this holder is destructed and will inform the disk object.\n struct storage_holder\n {\n- storage_holder () = default;\n ~storage_holder ();\n storage_holder (storage_index_t idx, disk_interface& disk_io);\n+ storage_holder () = default;\n explicit operator bool () const;\n operator storage_index_t () const;\n void reset ();\n storage_holder (storage_holder const&) = delete;\n storage_holder& operator= (storage_holder const&) = delete;\n storage_holder (storage_holder&& rhs) noexcept;\n storage_holder& operator= (storage_holder&& rhs) noexcept;\n@@ -2388,14 +2742,26 @@\n bool is_mutable () const noexcept;\n if this returns true, the buffer may not be modified in place\n [report_issue]\n ***** bool() *****\n explicit operator bool () const noexcept;\n implicitly convertible to true if the object is currently holding a buffer\n [report_issue]\n+****** disk_observer ******\n+Declared in \"libtorrent/disk_observer.hpp\"\n+struct disk_observer\n+{\n+ virtual void on_disk () = 0;\n+};\n+[report_issue]\n+***** on_disk() *****\n+virtual void on_disk () = 0;\n+called when the disk cache size has dropped below the low watermark again and\n+we can resume downloading from peers\n+[report_issue]\n ****** file_open_mode_t ******\n Declared in \"libtorrent/disk_interface.hpp\"\n read_only\n open the file for reading only\n write_only\n open the file for writing only\n read_write\n@@ -3808,24 +4174,24 @@\n memory mapped, but will use normal pread/pwrite operations. This file size\n limit is specified in 16 kiB blocks.\n struct settings_pack final : settings_interface\n {\n friend void apply_pack_impl (settings_pack const*\n , aux::session_settings_single_thread&\n , std::vector*);\n- void set_bool (int name, bool val) override;\n void set_str (int name, std::string val) override;\n- void set_int (int name, flags::bitfield_flag const val);\n+ void set_bool (int name, bool val) override;\n void set_int (int name, int val) override;\n+ void set_int (int name, flags::bitfield_flag const val);\n bool has_val (int name) const override;\n void clear ();\n void clear (int name);\n- std::string const& get_str (int name) const override;\n bool get_bool (int name) const override;\n int get_int (int name) const override;\n+ std::string const& get_str (int name) const override;\n void for_each (Fun&& f) const;\n \n enum type_bases\n {\n string_type_base,\n int_type_base,\n bool_type_base,\n@@ -3896,19 +4262,19 @@\n socks5_pw,\n http,\n http_pw,\n i2p_proxy,\n };\n };\n [report_issue]\n-***** set_int() set_str() set_bool() *****\n-void set_bool (int name, bool val) override;\n+***** set_int() set_bool() set_str() *****\n void set_str (int name, std::string val) override;\n-void set_int (int name, flags::bitfield_flag const val);\n+void set_bool (int name, bool val) override;\n void set_int (int name, int val) override;\n+void set_int (int name, flags::bitfield_flag const val);\n set a configuration option in the settings_pack. name is one of the enum values\n from string_types, int_types or bool_types. They must match the respective type\n of the set_* function.\n [report_issue]\n ***** has_val() *****\n bool has_val (int name) const override;\n queries whether the specified configuration option has a value set in this\n@@ -3919,18 +4285,18 @@\n void clear ();\n clear the settings pack from all settings\n [report_issue]\n ***** clear() *****\n void clear (int name);\n clear a specific setting from the pack\n [report_issue]\n-***** get_str() get_bool() get_int() *****\n-std::string const& get_str (int name) const override;\n+***** get_bool() get_int() get_str() *****\n bool get_bool (int name) const override;\n int get_int (int name) const override;\n+std::string const& get_str (int name) const override;\n queries the current configuration option from the settings_pack. name is one of\n the enumeration values from string_types, int_types or bool_types. The enum\n value must match the type of the get_* function. If the specified setting field\n has not been set, the default value is returned.\n [report_issue]\n ***** enum type_bases *****\n Declared in \"libtorrent/settings_pack.hpp\"\n@@ -4060,47 +4426,23 @@\n | | |The server is assumed to be an HTTP proxy that requires user |\n |http_pw |5 |authorization. The username and password will be sent to the |\n |_________|_____|proxy._______________________________________________________|\n |i2p_proxy|6____|route_through_a_i2p_SAM_proxy________________________________|\n [report_issue]\n ****** setting_by_name() name_for_setting() ******\n Declared in \"libtorrent/settings_pack.hpp\"\n-int setting_by_name (string_view name);\n char const* name_for_setting (int s);\n+int setting_by_name (string_view name);\n converts a setting integer (from the enums string_types, int_types or\n bool_types) to a string, and vice versa.\n [report_issue]\n ****** default_settings() ******\n Declared in \"libtorrent/settings_pack.hpp\"\n settings_pack default_settings ();\n returns a settings_pack with every setting set to its default value\n- [report_issue]\n-****** high_performance_seed() min_memory_usage() ******\n-Declared in \"libtorrent/session.hpp\"\n-settings_pack high_performance_seed ();\n-settings_pack min_memory_usage ();\n-The default values of the session settings are set for a regular bittorrent\n-client running on a desktop system. There are functions that can set the\n-session settings to pre set settings for other environments. These can be used\n-for the basis, and should be tweaked to fit your needs better.\n-min_memory_usage returns settings that will use the minimal amount of RAM, at\n-the potential expense of upload and download performance. It adjusts the socket\n-buffer sizes, disables the disk cache, lowers the send buffer watermarks so\n-that each connection only has at most one block in use at any one time. It\n-lowers the outstanding blocks send to the disk I/O thread so that connections\n-only have one block waiting to be flushed to disk at any given time. It lowers\n-the max number of peers in the peer list for torrents. It performs multiple\n-smaller reads when it hashes pieces, instead of reading it all into memory\n-before hashing.\n-This configuration is intended to be the starting point for embedded devices.\n-It will significantly reduce memory usage.\n-high_performance_seed returns settings optimized for a seed box, serving many\n-peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n-limit of 400 files in its file pool. It support fast upload rates by allowing\n-large send buffers.\n [report_issue]\n ****** generate_fingerprint() ******\n Declared in \"libtorrent/fingerprint.hpp\"\n std::string generate_fingerprint (std::string name\n , int major, int minor = 0, int revision = 0, int tag = 0);\n This is a utility function to produce a client ID fingerprint formatted to the\n most common convention. The fingerprint can be set via the peer_fingerprint\n@@ -4118,14 +4460,332 @@\n |BT______|BitTorrent__________|\n |DE______|Deluge______________|\n |AZ______|Azureus_____________|\n |TL______|Tribler_____________|\n There's an informal directory of client id's here.\n The major, minor, revision and tag parameters are used to identify the version\n of your client.\n+ [report_issue]\n+****** min_memory_usage() high_performance_seed() ******\n+Declared in \"libtorrent/session.hpp\"\n+settings_pack min_memory_usage ();\n+settings_pack high_performance_seed ();\n+The default values of the session settings are set for a regular bittorrent\n+client running on a desktop system. There are functions that can set the\n+session settings to pre set settings for other environments. These can be used\n+for the basis, and should be tweaked to fit your needs better.\n+min_memory_usage returns settings that will use the minimal amount of RAM, at\n+the potential expense of upload and download performance. It adjusts the socket\n+buffer sizes, disables the disk cache, lowers the send buffer watermarks so\n+that each connection only has at most one block in use at any one time. It\n+lowers the outstanding blocks send to the disk I/O thread so that connections\n+only have one block waiting to be flushed to disk at any given time. It lowers\n+the max number of peers in the peer list for torrents. It performs multiple\n+smaller reads when it hashes pieces, instead of reading it all into memory\n+before hashing.\n+This configuration is intended to be the starting point for embedded devices.\n+It will significantly reduce memory usage.\n+high_performance_seed returns settings optimized for a seed box, serving many\n+peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n+limit of 400 files in its file pool. It support fast upload rates by allowing\n+large send buffers.\n+[report_issue]\n+****** peer_class_info ******\n+Declared in \"libtorrent/peer_class.hpp\"\n+holds settings for a peer class. Used in set_peer_class() and get_peer_class()\n+calls.\n+struct peer_class_info\n+{\n+ bool ignore_unchoke_slots;\n+ int connection_limit_factor;\n+ std::string label;\n+ int upload_limit;\n+ int download_limit;\n+ int upload_priority;\n+ int download_priority;\n+};\n+[report_issue]\n+ ignore_unchoke_slots\n+ ignore_unchoke_slots determines whether peers should always unchoke a\n+ peer, regardless of the choking algorithm, or if it should honor the\n+ unchoke slot limits. It's used for local peers by default. If any of the\n+ peer classes a peer belongs to has this set to true, that peer will be\n+ unchoked at all times.\n+[report_issue]\n+ connection_limit_factor\n+ adjusts the connection limit (global and per torrent) that applies to\n+ this peer class. By default, local peers are allowed to exceed the normal\n+ connection limit for instance. This is specified as a percent factor. 100\n+ makes the peer class apply normally to the limit. 200 means as long as\n+ there are fewer connections than twice the limit, we accept this peer.\n+ This factor applies both to the global connection limit and the per-\n+ torrent limit. Note that if not used carefully one peer class can\n+ potentially completely starve out all other over time.\n+[report_issue]\n+ label\n+ not used by libtorrent. It's intended as a potentially user-facing\n+ identifier of this peer class.\n+ [report_issue]\n+ upload_limit download_limit\n+ transfer rates limits for the whole peer class. They are specified in\n+ bytes per second and apply to the sum of all peers that are members of\n+ this class.\n+ [report_issue]\n+ upload_priority download_priority\n+ relative priorities used by the bandwidth allocator in the rate limiter.\n+ If no rate limits are in use, the priority is not used either. Priorities\n+ start at 1 (0 is not a valid priority) and may not exceed 255.\n+[report_issue]\n+****** peer_class_type_filter ******\n+Declared in \"libtorrent/peer_class_type_filter.hpp\"\n+peer_class_type_filter is a simple container for rules for adding and\n+subtracting peer-classes from peers. It is applied after the peer class filter\n+is applied (which is based on the peer's IP address).\n+struct peer_class_type_filter\n+{\n+ void remove (socket_type_t const st, peer_class_t const peer_class);\n+ void add (socket_type_t const st, peer_class_t const peer_class);\n+ void disallow (socket_type_t const st, peer_class_t const peer_class);\n+ void allow (socket_type_t const st, peer_class_t const peer_class);\n+ std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n+ friend bool operator== (peer_class_type_filter const& lhs\n+ , peer_class_type_filter const& rhs);\n+\n+ enum socket_type_t\n+ {\n+ tcp_socket,\n+ utp_socket,\n+ ssl_tcp_socket,\n+ ssl_utp_socket,\n+ i2p_socket,\n+ num_socket_types,\n+ };\n+};\n+ [report_issue]\n+***** remove() add() *****\n+void remove (socket_type_t const st, peer_class_t const peer_class);\n+void add (socket_type_t const st, peer_class_t const peer_class);\n+add() and remove() adds and removes a peer class to be added to new peers based\n+on socket type.\n+ [report_issue]\n+***** disallow() allow() *****\n+void disallow (socket_type_t const st, peer_class_t const peer_class);\n+void allow (socket_type_t const st, peer_class_t const peer_class);\n+disallow() and allow() adds and removes a peer class to be removed from new\n+peers based on socket type.\n+The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_type_filter are 32 bits.\n+[report_issue]\n+***** apply() *****\n+std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n+takes a bitmask of peer classes and returns a new bitmask of peer classes after\n+the rules have been applied, based on the socket type argument (st).\n+[report_issue]\n+***** enum socket_type_t *****\n+Declared in \"libtorrent/peer_class_type_filter.hpp\"\n+ ________________________________________________________________________\n+|name____________|value|description______________________________________|\n+|tcp_socket |0 |these match the socket types from socket_type.hpp|\n+|________________|_____|shifted_one_down_________________________________|\n+|utp_socket______|1____|\u00a0_______________________________________________|\n+|ssl_tcp_socket__|2____|\u00a0_______________________________________________|\n+|ssl_utp_socket__|3____|\u00a0_______________________________________________|\n+|i2p_socket______|4____|\u00a0_______________________________________________|\n+|num_socket_types|5____|\u00a0_______________________________________________|\n+[report_issue]\n+****** bitfield ******\n+Declared in \"libtorrent/bitfield.hpp\"\n+The bitfield type stores any number of bits as a bitfield in a heap allocated\n+array.\n+struct bitfield\n+{\n+ explicit bitfield (int bits);\n+ bitfield (bitfield&& rhs) noexcept = default;\n+ bitfield () noexcept = default;\n+ bitfield (char const* b, int bits);\n+ bitfield (int bits, bool val);\n+ bitfield (bitfield const& rhs);\n+ void assign (char const* b, int const bits);\n+ bool operator[] (int index) const noexcept;\n+ bool get_bit (int index) const noexcept;\n+ void set_bit (int index) noexcept;\n+ void clear_bit (int index) noexcept;\n+ bool all_set () const noexcept;\n+ bool none_set () const noexcept;\n+ int size () const noexcept;\n+ int num_words () const noexcept;\n+ bool empty () const noexcept;\n+ char* data () noexcept;\n+ char const* data () const noexcept;\n+ void swap (bitfield& rhs) noexcept;\n+ int count () const noexcept;\n+ int find_first_set () const noexcept;\n+ int find_last_clear () const noexcept;\n+};\n+[report_issue]\n+***** bitfield() *****\n+explicit bitfield (int bits);\n+bitfield (bitfield&& rhs) noexcept = default;\n+bitfield () noexcept = default;\n+bitfield (char const* b, int bits);\n+bitfield (int bits, bool val);\n+bitfield (bitfield const& rhs);\n+constructs a new bitfield. The default constructor creates an empty bitfield.\n+bits is the size of the bitfield (specified in bits). val is the value to\n+initialize the bits to. If not specified all bits are initialized to 0.\n+The constructor taking a pointer b and bits copies a bitfield from the\n+specified buffer, and bits number of bits (rounded up to the nearest byte\n+boundary).\n+[report_issue]\n+***** assign() *****\n+void assign (char const* b, int const bits);\n+copy bitfield from buffer b of bits number of bits, rounded up to the nearest\n+byte boundary.\n+ [report_issue]\n+***** operator[]() get_bit() *****\n+bool operator[] (int index) const noexcept;\n+bool get_bit (int index) const noexcept;\n+query bit at index. Returns true if bit is 1, otherwise false.\n+ [report_issue]\n+***** clear_bit() set_bit() *****\n+void set_bit (int index) noexcept;\n+void clear_bit (int index) noexcept;\n+set bit at index to 0 (clear_bit) or 1 (set_bit).\n+[report_issue]\n+***** all_set() *****\n+bool all_set () const noexcept;\n+returns true if all bits in the bitfield are set\n+[report_issue]\n+***** none_set() *****\n+bool none_set () const noexcept;\n+returns true if no bit in the bitfield is set\n+[report_issue]\n+***** size() *****\n+int size () const noexcept;\n+returns the size of the bitfield in bits.\n+[report_issue]\n+***** num_words() *****\n+int num_words () const noexcept;\n+returns the number of 32 bit words are needed to represent all bits in this\n+bitfield.\n+[report_issue]\n+***** empty() *****\n+bool empty () const noexcept;\n+returns true if the bitfield has zero size.\n+[report_issue]\n+***** data() *****\n+char* data () noexcept;\n+char const* data () const noexcept;\n+returns a pointer to the internal buffer of the bitfield, or nullptr if it's\n+empty.\n+[report_issue]\n+***** swap() *****\n+void swap (bitfield& rhs) noexcept;\n+swaps the bit-fields two variables refer to\n+[report_issue]\n+***** count() *****\n+int count () const noexcept;\n+count the number of bits in the bitfield that are set to 1.\n+[report_issue]\n+***** find_first_set() *****\n+int find_first_set () const noexcept;\n+returns the index of the first set bit in the bitfield, i.e. 1 bit.\n+[report_issue]\n+***** find_last_clear() *****\n+int find_last_clear () const noexcept;\n+returns the index to the last cleared bit in the bitfield, i.e. 0 bit.\n+[report_issue]\n+****** hasher ******\n+Declared in \"libtorrent/hasher.hpp\"\n+this is a SHA-1 hash class.\n+You use it by first instantiating it, then call update() to feed it with data.\n+i.e. you don't have to keep the entire buffer of which you want to create the\n+hash in memory. You can feed the hasher parts of it at a time. When You have\n+fed the hasher with all the data, you call final() and it will return the sha1-\n+hash of the data.\n+The constructor that takes a char const* and an integer will construct the sha1\n+context and feed it the data passed in.\n+If you want to reuse the hasher object once you have created a hash, you have\n+to call reset() to reinitialize it.\n+The built-in software version of sha1-algorithm was implemented by Steve Reid\n+and released as public domain. For more info, see src/sha1.cpp.\n+class hasher\n+{\n+ hasher ();\n+ hasher (char const* data, int len);\n+ explicit hasher (span data);\n+ hasher (hasher const&);\n+ hasher& operator= (hasher const&) &;\n+ hasher& update (span data);\n+ hasher& update (char const* data, int len);\n+ sha1_hash final ();\n+ void reset ();\n+};\n+ [report_issue]\n+***** hasher() operator=() *****\n+hasher (char const* data, int len);\n+explicit hasher (span data);\n+hasher (hasher const&);\n+hasher& operator= (hasher const&) &;\n+this is the same as default constructing followed by a call to update(data,\n+len).\n+[report_issue]\n+***** update() *****\n+hasher& update (span data);\n+hasher& update (char const* data, int len);\n+append the following bytes to what is being hashed\n+[report_issue]\n+***** final() *****\n+sha1_hash final ();\n+returns the SHA-1 digest of the buffers previously passed to update() and the\n+hasher constructor.\n+[report_issue]\n+***** reset() *****\n+void reset ();\n+restore the hasher state to be as if the hasher has just been default\n+constructed.\n+[report_issue]\n+****** hasher256 ******\n+Declared in \"libtorrent/hasher.hpp\"\n+class hasher256\n+{\n+ hasher256 ();\n+ explicit hasher256 (span data);\n+ hasher256 (char const* data, int len);\n+ hasher256& operator= (hasher256 const&) &;\n+ hasher256 (hasher256 const&);\n+ hasher256& update (span data);\n+ hasher256& update (char const* data, int len);\n+ sha256_hash final ();\n+ void reset ();\n+ ~hasher256 ();\n+};\n+ [report_issue]\n+***** hasher256() operator=() *****\n+explicit hasher256 (span data);\n+hasher256 (char const* data, int len);\n+hasher256& operator= (hasher256 const&) &;\n+hasher256 (hasher256 const&);\n+this is the same as default constructing followed by a call to update(data,\n+len).\n+[report_issue]\n+***** update() *****\n+hasher256& update (span data);\n+hasher256& update (char const* data, int len);\n+append the following bytes to what is being hashed\n+[report_issue]\n+***** final() *****\n+sha256_hash final ();\n+returns the SHA-1 digest of the buffers previously passed to update() and the\n+hasher constructor.\n+[report_issue]\n+***** reset() *****\n+void reset ();\n+restore the hasher state to be as if the hasher has just been default\n+constructed.\n libtorrent has a plugin interface for implementing extensions to the protocol.\n These can be general extensions for transferring metadata or peer exchange\n extensions, or it could be used to provide a way to customize the protocol to\n fit a particular (closed) network.\n In short, the plugin interface makes it possible to:\n * register extension messages (sent in the extension handshake), see\n extensions.\n@@ -4201,79 +4861,14 @@\n The static category is required for checking whether or not the category for a\n specific alert is enabled or not, without instantiating the alert. The category\n virtual function is the run-time equivalence.\n The what() virtual function may simply be a string literal of the class name of\n your alert.\n For more information, see the alert_section.\n [report_issue]\n-****** peer_connection_handle ******\n-Declared in \"libtorrent/peer_connection_handle.hpp\"\n-the peer_connection_handle class provides a handle to the internal peer\n-connection object, to be used by plugins. This is a low level interface that\n-may not be stable across libtorrent versions\n-struct peer_connection_handle\n-{\n- explicit peer_connection_handle (std::weak_ptr impl);\n- connection_type type () const;\n- peer_plugin const* find_plugin (string_view type) const;\n- void add_extension (std::shared_ptr);\n- bool is_seed () const;\n- bool upload_only () const;\n- bool has_piece (piece_index_t i) const;\n- peer_id const& pid () const;\n- bool is_interesting () const;\n- bool is_choked () const;\n- bool is_peer_interested () const;\n- bool has_peer_choked () const;\n- void choke_this_peer ();\n- void maybe_unchoke_this_peer ();\n- void get_peer_info (peer_info& p) const;\n- torrent_handle associated_torrent () const;\n- tcp::endpoint const& remote () const;\n- tcp::endpoint local_endpoint () const;\n- void disconnect (error_code const& ec, operation_t op\n- , disconnect_severity_t = peer_connection_interface::normal);\n- bool is_connecting () const;\n- bool is_outgoing () const;\n- bool is_disconnecting () const;\n- bool on_local_network () const;\n- bool ignore_unchoke_slots () const;\n- bool failed () const;\n- bool should_log (peer_log_alert::direction_t direction) const;\n- void peer_log (peer_log_alert::direction_t direction\n- , char const* event, char const* fmt = \"\", ...) const TORRENT_FORMAT\n-(4,5);\n- bool can_disconnect (error_code const& ec) const;\n- bool has_metadata () const;\n- bool in_handshake () const;\n- void send_buffer (char const* begin, int size);\n- std::time_t last_seen_complete () const;\n- time_point time_of_last_unchoke () const;\n- bool operator!= (peer_connection_handle const& o) const;\n- bool operator< (peer_connection_handle const& o) const;\n- bool operator== (peer_connection_handle const& o) const;\n- std::shared_ptr native_handle () const;\n-};\n-[report_issue]\n-****** bt_peer_connection_handle ******\n-Declared in \"libtorrent/peer_connection_handle.hpp\"\n-The bt_peer_connection_handle provides a handle to the internal bittorrent peer\n-connection object to plugins. It's low level and may not be a stable API across\n-libtorrent versions.\n-struct bt_peer_connection_handle : peer_connection_handle\n-{\n- explicit bt_peer_connection_handle (peer_connection_handle pc);\n- bool packet_finished () const;\n- bool support_extensions () const;\n- bool supports_encryption () const;\n- void switch_send_crypto (std::shared_ptr crypto);\n- void switch_recv_crypto (std::shared_ptr crypto);\n- std::shared_ptr native_handle () const;\n-};\n-[report_issue]\n ****** plugin ******\n Declared in \"libtorrent/extensions.hpp\"\n this is the base class for a session plugin. One primary feature is that it is\n notified of all torrents that are added to the session, and can add its own\n torrent_plugins.\n struct plugin\n {\n@@ -4389,16 +4984,16 @@\n struct torrent_plugin\n {\n virtual std::shared_ptr new_connection (peer_connection_handle\n const&);\n virtual void on_piece_pass (piece_index_t);\n virtual void on_piece_failed (piece_index_t);\n virtual void tick ();\n- virtual bool on_pause ();\n virtual bool on_resume ();\n+ virtual bool on_pause ();\n virtual void on_files_checked ();\n virtual void on_state (torrent_status::state_t);\n virtual void on_add_peer (tcp::endpoint const&,\n peer_source_flags_t, add_peer_flags_t);\n \n static constexpr add_peer_flags_t first_time = 1_bit;\n static constexpr add_peer_flags_t filtered = 2_bit;\n@@ -4428,17 +5023,17 @@\n through the torrent and the piece_picker.\n [report_issue]\n ***** tick() *****\n virtual void tick ();\n This hook is called approximately once per second. It is a way of making it\n easy for plugins to do timed events, for sending messages or whatever.\n [report_issue]\n-***** on_resume() on_pause() *****\n-virtual bool on_pause ();\n+***** on_pause() on_resume() *****\n virtual bool on_resume ();\n+virtual bool on_pause ();\n These hooks are called when the torrent is paused and resumed respectively. The\n return value indicates if the event was handled. A return value of true\n indicates that it was handled, and no other plugin after this one will have\n this hook function called, and the standard handler will also not be invoked.\n So, returning true effectively overrides the standard behavior of pause or\n resume.\n Note that if you call pause() or resume() on the torrent from your handler it\n@@ -4484,43 +5079,43 @@\n {\n virtual string_view type () const;\n virtual void add_handshake (entry&);\n virtual void on_disconnect (error_code const&);\n virtual void on_connected ();\n virtual bool on_handshake (span);\n virtual bool on_extension_handshake (bdecode_node const&);\n- virtual bool on_interested ();\n+ virtual bool on_have (piece_index_t);\n+ virtual bool on_have_all ();\n+ virtual bool on_have_none ();\n+ virtual bool on_request (peer_request const&);\n+ virtual bool on_allowed_fast (piece_index_t);\n+ virtual bool on_not_interested ();\n virtual bool on_unchoke ();\n+ virtual bool on_interested ();\n virtual bool on_choke ();\n- virtual bool on_request (peer_request const&);\n virtual bool on_dont_have (piece_index_t);\n- virtual bool on_have (piece_index_t);\n- virtual bool on_allowed_fast (piece_index_t);\n- virtual bool on_have_none ();\n- virtual bool on_have_all ();\n virtual bool on_bitfield (bitfield const& /*bitfield*/);\n- virtual bool on_not_interested ();\n virtual bool on_piece (peer_request const& /*piece*/\n , span /*buf*/);\n- virtual bool on_cancel (peer_request const&);\n- virtual bool on_suggest (piece_index_t);\n virtual bool on_reject (peer_request const&);\n+ virtual bool on_suggest (piece_index_t);\n+ virtual bool on_cancel (peer_request const&);\n+ virtual void sent_have_all ();\n+ virtual void sent_suggest (piece_index_t);\n virtual void sent_have_none ();\n virtual void sent_cancel (peer_request const&);\n- virtual void sent_suggest (piece_index_t);\n- virtual void sent_request (peer_request const&);\n- virtual void sent_allow_fast (piece_index_t);\n virtual void sent_reject_request (peer_request const&);\n- virtual void sent_have_all ();\n virtual void sent_choke ();\n+ virtual void sent_request (peer_request const&);\n+ virtual void sent_allow_fast (piece_index_t);\n+ virtual void sent_interested ();\n virtual void sent_have (piece_index_t);\n- virtual void sent_unchoke ();\n virtual void sent_piece (peer_request const&);\n virtual void sent_not_interested ();\n- virtual void sent_interested ();\n+ virtual void sent_unchoke ();\n virtual void sent_payload (int /* bytes */);\n virtual bool can_disconnect (error_code const& /*ec*/);\n virtual bool on_extended (int /*length*/, int /*msg*/,\n span /*body*/);\n virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n span /*body*/);\n virtual void on_piece_pass (piece_index_t);\n@@ -4556,48 +5151,48 @@\n ***** on_extension_handshake() *****\n virtual bool on_extension_handshake (bdecode_node const&);\n called when the extension handshake from the other end is received if this\n returns false, it means that this extension isn't supported by this peer. It\n will result in this peer_plugin being removed from the peer_connection and\n destructed. this is not called for web seeds\n [report_issue]\n-***** on_interested() on_not_interested() on_have() on_allowed_fast()\n-on_have_none() on_unchoke() on_have_all() on_dont_have() on_request() on_choke\n-() on_bitfield() *****\n-virtual bool on_interested ();\n+***** on_bitfield() on_have() on_dont_have() on_have_none() on_request()\n+on_choke() on_interested() on_have_all() on_allowed_fast() on_not_interested()\n+on_unchoke() *****\n+virtual bool on_have (piece_index_t);\n+virtual bool on_have_all ();\n+virtual bool on_have_none ();\n+virtual bool on_request (peer_request const&);\n+virtual bool on_allowed_fast (piece_index_t);\n+virtual bool on_not_interested ();\n virtual bool on_unchoke ();\n+virtual bool on_interested ();\n virtual bool on_choke ();\n-virtual bool on_request (peer_request const&);\n virtual bool on_dont_have (piece_index_t);\n-virtual bool on_have (piece_index_t);\n-virtual bool on_allowed_fast (piece_index_t);\n-virtual bool on_have_none ();\n-virtual bool on_have_all ();\n virtual bool on_bitfield (bitfield const& /*bitfield*/);\n-virtual bool on_not_interested ();\n returning true from any of the message handlers indicates that the plugin has\n handled the message. it will break the plugin chain traversing and not let\n anyone else handle the message, including the default handler.\n [report_issue]\n ***** on_piece() *****\n virtual bool on_piece (peer_request const& /*piece*/\n , span /*buf*/);\n This function is called when the peer connection is receiving a piece. buf\n points (non-owning pointer) to the data in an internal immutable disk buffer.\n The length of the data is specified in the length member of the piece\n parameter. returns true to indicate that the piece is handled and the rest of\n the logic should be ignored.\n [report_issue]\n-***** sent_not_interested() sent_unchoke() sent_interested() sent_have()\n-sent_piece() *****\n+***** sent_have() sent_interested() sent_piece() sent_not_interested()\n+sent_unchoke() *****\n+virtual void sent_interested ();\n virtual void sent_have (piece_index_t);\n-virtual void sent_unchoke ();\n virtual void sent_piece (peer_request const&);\n virtual void sent_not_interested ();\n-virtual void sent_interested ();\n+virtual void sent_unchoke ();\n called after a choke message has been sent to the peer\n [report_issue]\n ***** sent_payload() *****\n virtual void sent_payload (int /* bytes */);\n called after piece data has been sent to the peer this can be used for stats\n book keeping\n [report_issue]\n@@ -4640,16 +5235,16 @@\n original request message won't be sent and no other plugin will have this\n function called.\n [report_issue]\n ****** crypto_plugin ******\n Declared in \"libtorrent/extensions.hpp\"\n struct crypto_plugin\n {\n- virtual void set_outgoing_key (span key) = 0;\n virtual void set_incoming_key (span key) = 0;\n+ virtual void set_outgoing_key (span key) = 0;\n encrypt (span> /*send_vec*/) = 0;\n virtual std::tuple decrypt (span> /*receive_vec*/\n ) = 0;\n };\n [report_issue]\n ***** decrypt() *****\n virtual std::tuple decrypt (span> /*receive_vec*/) =\n@@ -4659,154 +5254,111 @@\n consume is set to the number of bytes which should be trimmed from the head of\n the buffers, default is 0\n produce is set to the number of bytes of payload which are now ready to be sent\n to the upper layer. default is the number of bytes passed in receive_vec\n packet_size is set to the minimum number of bytes which must be read to advance\n the next step of decryption. default is 0\n [report_issue]\n+****** peer_connection_handle ******\n+Declared in \"libtorrent/peer_connection_handle.hpp\"\n+the peer_connection_handle class provides a handle to the internal peer\n+connection object, to be used by plugins. This is a low level interface that\n+may not be stable across libtorrent versions\n+struct peer_connection_handle\n+{\n+ explicit peer_connection_handle (std::weak_ptr impl);\n+ connection_type type () const;\n+ void add_extension (std::shared_ptr);\n+ peer_plugin const* find_plugin (string_view type) const;\n+ bool is_seed () const;\n+ bool upload_only () const;\n+ peer_id const& pid () const;\n+ bool has_piece (piece_index_t i) const;\n+ bool is_choked () const;\n+ bool is_interesting () const;\n+ bool is_peer_interested () const;\n+ bool has_peer_choked () const;\n+ void choke_this_peer ();\n+ void maybe_unchoke_this_peer ();\n+ void get_peer_info (peer_info& p) const;\n+ torrent_handle associated_torrent () const;\n+ tcp::endpoint local_endpoint () const;\n+ tcp::endpoint const& remote () const;\n+ void disconnect (error_code const& ec, operation_t op\n+ , disconnect_severity_t = peer_connection_interface::normal);\n+ bool is_connecting () const;\n+ bool is_disconnecting () const;\n+ bool is_outgoing () const;\n+ bool on_local_network () const;\n+ bool ignore_unchoke_slots () const;\n+ bool failed () const;\n+ bool should_log (peer_log_alert::direction_t direction) const;\n+ void peer_log (peer_log_alert::direction_t direction\n+ , char const* event, char const* fmt = \"\", ...) const TORRENT_FORMAT\n+(4,5);\n+ bool can_disconnect (error_code const& ec) const;\n+ bool has_metadata () const;\n+ bool in_handshake () const;\n+ void send_buffer (char const* begin, int size);\n+ time_point time_of_last_unchoke () const;\n+ std::time_t last_seen_complete () const;\n+ bool operator== (peer_connection_handle const& o) const;\n+ bool operator!= (peer_connection_handle const& o) const;\n+ bool operator< (peer_connection_handle const& o) const;\n+ std::shared_ptr native_handle () const;\n+};\n+[report_issue]\n+****** bt_peer_connection_handle ******\n+Declared in \"libtorrent/peer_connection_handle.hpp\"\n+The bt_peer_connection_handle provides a handle to the internal bittorrent peer\n+connection object to plugins. It's low level and may not be a stable API across\n+libtorrent versions.\n+struct bt_peer_connection_handle : peer_connection_handle\n+{\n+ explicit bt_peer_connection_handle (peer_connection_handle pc);\n+ bool support_extensions () const;\n+ bool packet_finished () const;\n+ bool supports_encryption () const;\n+ void switch_recv_crypto (std::shared_ptr crypto);\n+ void switch_send_crypto (std::shared_ptr crypto);\n+ std::shared_ptr native_handle () const;\n+};\n+[report_issue]\n ****** create_ut_metadata_plugin() ******\n Declared in \"libtorrent/extensions/ut_metadata.hpp\"\n std::shared_ptr create_ut_metadata_plugin (torrent_handle\n const&, client_data_t);\n constructor function for the ut_metadata extension. The ut_metadata extension\n allows peers to request the .torrent file (or more specifically the info-\n dictionary of the .torrent file) from each other. This is the main building\n block in making magnet links work. This extension is enabled by default unless\n explicitly disabled in the session constructor.\n This can either be passed in the add_torrent_params::extensions field, or via\n torrent_handle::add_extension().\n [report_issue]\n-****** create_smart_ban_plugin() ******\n-Declared in \"libtorrent/extensions/smart_ban.hpp\"\n-std::shared_ptr create_smart_ban_plugin (torrent_handle const&,\n-client_data_t);\n-constructor function for the smart ban extension. The extension keeps track of\n-the data peers have sent us for failing pieces and once the piece completes and\n-passes the hash check bans the peers that turned out to have sent corrupt data.\n-This function can either be passed in the add_torrent_params::extensions field,\n-or via torrent_handle::add_extension().\n-[report_issue]\n ****** create_ut_pex_plugin() ******\n Declared in \"libtorrent/extensions/ut_pex.hpp\"\n std::shared_ptr create_ut_pex_plugin (torrent_handle const&,\n client_data_t);\n constructor function for the ut_pex extension. The ut_pex extension allows\n peers to gossip about their connections, allowing the swarm stay well connected\n and peers aware of more peers in the swarm. This extension is enabled by\n default unless explicitly disabled in the session constructor.\n This can either be passed in the add_torrent_params::extensions field, or via\n torrent_handle::add_extension().\n [report_issue]\n-****** session_proxy ******\n-Declared in \"libtorrent/session.hpp\"\n-this is a holder for the internal session implementation object. Once the\n-session destruction is explicitly initiated, this holder is used to synchronize\n-the completion of the shutdown. The lifetime of this object may outlive\n-session, causing the session destructor to not block. The session_proxy\n-destructor will block however, until the underlying session is done shutting\n-down.\n-struct session_proxy\n-{\n- ~session_proxy ();\n- session_proxy& operator= (session_proxy const&) &;\n- session_proxy& operator= (session_proxy&&) & noexcept;\n- session_proxy (session_proxy const&);\n- session_proxy ();\n- session_proxy (session_proxy&&) noexcept;\n-};\n- [report_issue]\n-***** session_proxy() ~session_proxy() operator=() *****\n-~session_proxy ();\n-session_proxy& operator= (session_proxy const&) &;\n-session_proxy& operator= (session_proxy&&) & noexcept;\n-session_proxy (session_proxy const&);\n-session_proxy ();\n-session_proxy (session_proxy&&) noexcept;\n-default constructor, does not refer to any session implementation object.\n-[report_issue]\n-****** session ******\n-Declared in \"libtorrent/session.hpp\"\n-The session holds all state that spans multiple torrents. Among other things it\n-runs the network loop and manages all torrents. Once it's created, the session\n-object will spawn the main thread that will do all the work. The main thread\n-will be idle as long it doesn't have any torrents to participate in.\n-You have some control over session configuration through the session_handle::\n-apply_settings() member function. To change one or more configuration options,\n-create a settings_pack. object and fill it with the settings to be set and pass\n-it in to session::apply_settings().\n-see apply_settings().\n-struct session : session_handle\n-{\n- explicit session (session_params&& params);\n- session (session_params&& params, session_flags_t flags);\n- session ();\n- session (session_params const& params, session_flags_t flags);\n- explicit session (session_params const& params);\n- session (session_params const& params, io_context& ios);\n- session (session_params const& params, io_context& ios, session_flags_t);\n- session (session_params&& params, io_context& ios);\n- session (session_params&& params, io_context& ios, session_flags_t);\n- ~session ();\n- session_proxy abort ();\n-};\n-[report_issue]\n-***** session() *****\n-explicit session (session_params&& params);\n-session (session_params&& params, session_flags_t flags);\n-session ();\n-session (session_params const& params, session_flags_t flags);\n-explicit session (session_params const& params);\n-Constructs the session objects which acts as the container of torrents. In\n-order to avoid a race condition between starting the session and configuring\n-it, you can pass in a session_params object. Its settings will take effect\n-before the session starts up.\n-The overloads taking flags can be used to start a session in paused mode (by\n-passing in session::paused). Note that add_default_plugins do not have an\n-affect on constructors that take a session_params object. It already contains\n-the plugins to use.\n-[report_issue]\n-***** session() *****\n-session (session_params const& params, io_context& ios);\n-session (session_params const& params, io_context& ios, session_flags_t);\n-session (session_params&& params, io_context& ios);\n-session (session_params&& params, io_context& ios, session_flags_t);\n-Overload of the constructor that takes an external io_context to run the\n-session object on. This is primarily useful for tests that may want to run\n-multiple sessions on a single io_context, or low resource systems where\n-additional threads are expensive and sharing an io_context with other events is\n-fine.\n-Warning\n-The session object does not cleanly terminate with an external io_context. The\n-io_context::run() call must have returned before it's safe to destruct the\n-session. Which means you MUST call session::abort() and save the session_proxy\n-first, then destruct the session object, then sync with the io_context, then\n-destruct the session_proxy object.\n-[report_issue]\n-***** ~session() *****\n-~session ();\n-The destructor of session will notify all trackers that our torrents have been\n-shut down. If some trackers are down, they will time out. All this before the\n-destructor of session returns. So, it's advised that any kind of interface\n-(such as windows) are closed before destructing the session object. Because it\n-can take a few second for it to finish. The timeout can be set with\n-apply_settings().\n-[report_issue]\n-***** abort() *****\n-session_proxy abort ();\n-In case you want to destruct the session asynchronously, you can request a\n-session destruction proxy. If you don't do this, the destructor of the session\n-object will block while the trackers are contacted. If you keep one\n-session_proxy to the session when destructing it, the destructor will not\n-block, but start to close down the session, the destructor of the proxy will\n-then synchronize the threads. So, the destruction of the session is performed\n-from the session destructor call until the session_proxy destructor call. The\n-session_proxy does not have any operations on it (since the session is being\n-closed down, no operations are allowed on it). The only valid operation is\n-calling the destructor:\n-struct session_proxy {};\n+****** create_smart_ban_plugin() ******\n+Declared in \"libtorrent/extensions/smart_ban.hpp\"\n+std::shared_ptr create_smart_ban_plugin (torrent_handle const&,\n+client_data_t);\n+constructor function for the smart ban extension. The extension keeps track of\n+the data peers have sent us for failing pieces and once the piece completes and\n+passes the hash check bans the peers that turned out to have sent corrupt data.\n+This function can either be passed in the add_torrent_params::extensions field,\n+or via torrent_handle::add_extension().\n [report_issue]\n ****** session_handle ******\n Declared in \"libtorrent/session_handle.hpp\"\n this class provides a non-owning handle to a session and a subset of the\n interface of the session class. If the underlying session is destructed any\n handle to it will no longer be valid. is_valid() will return false and any\n operation on it will throw a system_error exception, with error code\n@@ -4824,70 +5376,70 @@\n void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n void post_session_stats ();\n void post_dht_stats ();\n void set_dht_state (dht::dht_state&& st);\n void set_dht_state (dht::dht_state const& st);\n std::vector get_torrents () const;\n torrent_handle find_torrent (sha1_hash const& info_hash) const;\n- torrent_handle add_torrent (add_torrent_params const& params);\n- torrent_handle add_torrent (add_torrent_params&& params);\n void async_add_torrent (add_torrent_params&& params);\n- torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n+ torrent_handle add_torrent (add_torrent_params const& params);\n torrent_handle add_torrent (add_torrent_params const& params, error_code&\n ec);\n void async_add_torrent (add_torrent_params const& params);\n+ torrent_handle add_torrent (add_torrent_params&& params);\n+ torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n bool is_paused () const;\n- void resume ();\n void pause ();\n+ void resume ();\n bool is_dht_running () const;\n void set_dht_storage (dht::dht_storage_constructor_type sc);\n void add_dht_node (std::pair const& node);\n void dht_get_item (sha1_hash const& target);\n void dht_get_item (std::array key\n , std::string salt = std::string());\n sha1_hash dht_put_item (entry data);\n void dht_put_item (std::array key\n , std::function&\n , std::int64_t&, std::string const&)> cb\n , std::string salt = std::string());\n- void dht_get_peers (sha1_hash const& info_hash);\n void dht_announce (sha1_hash const& info_hash, int port = 0, dht::\n announce_flags_t flags = {});\n+ void dht_get_peers (sha1_hash const& info_hash);\n void dht_live_nodes (sha1_hash const& nid);\n void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const&\n target);\n void dht_direct_request (udp::endpoint const& ep, entry const& e,\n client_data_t userdata = {});\n void add_extension (std::shared_ptr ext);\n void add_extension (std::function(\n torrent_handle const&, client_data_t)> ext);\n- ip_filter get_ip_filter () const;\n void set_ip_filter (ip_filter f);\n+ ip_filter get_ip_filter () const;\n void set_port_filter (port_filter const& f);\n unsigned short listen_port () const;\n- unsigned short ssl_listen_port () const;\n bool is_listening () const;\n+ unsigned short ssl_listen_port () const;\n ip_filter get_peer_class_filter () const;\n void set_peer_class_filter (ip_filter const& f);\n void set_peer_class_type_filter (peer_class_type_filter const& f);\n peer_class_type_filter get_peer_class_type_filter () const;\n peer_class_t create_peer_class (char const* name);\n void delete_peer_class (peer_class_t cid);\n peer_class_info get_peer_class (peer_class_t cid) const;\n void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n void remove_torrent (const torrent_handle&, remove_flags_t = {});\n+ settings_pack get_settings () const;\n void apply_settings (settings_pack const&);\n void apply_settings (settings_pack&&);\n- settings_pack get_settings () const;\n+ alert* wait_for_alert (time_duration max_wait);\n void pop_alerts (std::vector* alerts);\n void set_alert_notify (std::function const& fun);\n- alert* wait_for_alert (time_duration max_wait);\n- void delete_port_mapping (port_mapping_t handle);\n std::vector add_port_mapping (portmap_protocol t, int\n external_port, int local_port);\n+ void delete_port_mapping (port_mapping_t handle);\n void reopen_network_sockets (reopen_network_flags_t options =\n reopen_map_ports);\n std::shared_ptr native_handle () const;\n \n static constexpr save_state_flags_t save_settings = 0_bit;\n static constexpr save_state_flags_t save_dht_state = 2_bit;\n static constexpr save_state_flags_t save_extension_state = 11_bit;\n@@ -4913,15 +5465,15 @@\n all()) const;\n returns the current session state. This can be passed to write_session_params()\n to save the state to disk and restored using read_session_params() when\n constructing a new session. The kind of state that's included is all settings,\n the DHT routing table, possibly plugin-specific state. the flags parameter can\n be used to only save certain parts of the session state\n [report_issue]\n-***** get_torrent_status() refresh_torrent_status() *****\n+***** refresh_torrent_status() get_torrent_status() *****\n void refresh_torrent_status (std::vector* ret\n , status_flags_t flags = {}) const;\n std::vector get_torrent_status (\n std::function const& pred\n , status_flags_t flags = {}) const;\n Note\n these calls are potentially expensive and won't scale well with lots of\n@@ -4952,1967 +5504,673 @@\n interested torrents up to date, you can either call get_torrent_status() from\n time to time, to include torrents you might have become interested in since the\n last time. In order to stop refreshing a certain torrent, simply remove it from\n the list.\n [report_issue]\n ***** post_torrent_updates() *****\n void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n-This functions instructs the session to post the state_update_alert, containing\n-the status of all torrents whose state changed since the last time this\n-function was called.\n-Only torrents who has the state subscription flag set will be included. This\n-flag is on by default. See add_torrent_params. the flags argument is the same\n-as for torrent_handle::status(). see status_flags_t in torrent_handle.\n-[report_issue]\n-***** post_session_stats() *****\n-void post_session_stats ();\n-This function will post a session_stats_alert object, containing a snapshot of\n-the performance counters from the internals of libtorrent. To interpret these\n-counters, query the session via session_stats_metrics().\n-For more information, see the session_statistics section.\n-[report_issue]\n-***** post_dht_stats() *****\n-void post_dht_stats ();\n-This will cause a dht_stats_alert to be posted.\n-[report_issue]\n-***** set_dht_state() *****\n-void set_dht_state (dht::dht_state&& st);\n-void set_dht_state (dht::dht_state const& st);\n-set the DHT state for the session. This will be taken into account the next\n-time the DHT is started, as if it had been passed in via the session_params on\n-startup.\n- [report_issue]\n-***** find_torrent() get_torrents() *****\n-std::vector get_torrents () const;\n-torrent_handle find_torrent (sha1_hash const& info_hash) const;\n-find_torrent() looks for a torrent with the given info-hash. In case there is\n-such a torrent in the session, a torrent_handle to that torrent is returned. In\n-case the torrent cannot be found, an invalid torrent_handle is returned.\n-See torrent_handle::is_valid() to know if the torrent was found or not.\n-get_torrents() returns a vector of torrent_handles to all the torrents\n-currently in the session.\n- [report_issue]\n-***** add_torrent() async_add_torrent() *****\n-torrent_handle add_torrent (add_torrent_params const& params);\n-torrent_handle add_torrent (add_torrent_params&& params);\n-void async_add_torrent (add_torrent_params&& params);\n-torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n-torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n-void async_add_torrent (add_torrent_params const& params);\n-You add torrents through the add_torrent() function where you give an object\n-with all the parameters. The add_torrent() overloads will block until the\n-torrent has been added (or failed to be added) and returns an error code and a\n-torrent_handle. In order to add torrents more efficiently, consider using\n-async_add_torrent() which returns immediately, without waiting for the torrent\n-to add. Notification of the torrent being added is sent as add_torrent_alert.\n-The overload that does not take an error_code throws an exception on error and\n-is not available when building without exception support. The torrent_handle\n-returned by add_torrent() can be used to retrieve information about the\n-torrent's progress, its peers etc. It is also used to abort a torrent.\n-If the torrent you are trying to add already exists in the session (is either\n-queued for checking, being checked or downloading) add_torrent() will throw\n-system_error which derives from std::exception unless duplicate_is_error is set\n-to false. In that case, add_torrent() will return the handle to the existing\n-torrent.\n-The add_torrent_params class has a flags field. It can be used to control what\n-state the new torrent will be added in. Common flags to want to control are\n-torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet\n-link that will just download the metadata, but no payload, set the\n-torrent_flags::upload_mode flag.\n-Special consideration has to be taken when adding hybrid torrents (i.e.\n-torrents that are BitTorrent v2 torrents that are backwards compatible with\n-v1). For more details, see BitTorrent_v2_torrents.\n- [report_issue]\n-***** resume() is_paused() pause() *****\n-bool is_paused () const;\n-void resume ();\n-void pause ();\n-Pausing the session has the same effect as pausing every torrent in it, except\n-that torrents will not be resumed by the auto-manage mechanism. Resuming will\n-restore the torrents to their previous paused state. i.e. the session pause\n-state is separate from the torrent pause state. A torrent is inactive if it is\n-paused or if the session is paused.\n-[report_issue]\n-***** is_dht_running() *****\n-bool is_dht_running () const;\n-is_dht_running() returns true if the DHT support has been started and false\n-otherwise.\n-[report_issue]\n-***** set_dht_storage() *****\n-void set_dht_storage (dht::dht_storage_constructor_type sc);\n-set_dht_storage set a dht custom storage constructor function to be used\n-internally when the dht is created.\n-Since the dht storage is a critical component for the dht behavior, this\n-function will only be effective the next time the dht is started. If you never\n-touch this feature, a default map-memory based storage is used.\n-If you want to make sure the dht is initially created with your custom storage,\n-create a session with the setting settings_pack::enable_dht to false, set your\n-constructor function and call apply_settings with settings_pack::enable_dht to\n-true.\n-[report_issue]\n-***** add_dht_node() *****\n-void add_dht_node (std::pair const& node);\n-add_dht_node takes a host name and port pair. That endpoint will be pinged, and\n-if a valid DHT reply is received, the node will be added to the routing table.\n-[report_issue]\n-***** dht_get_item() *****\n-void dht_get_item (sha1_hash const& target);\n-query the DHT for an immutable item at the target hash. the result is posted as\n-a dht_immutable_item_alert.\n-[report_issue]\n-***** dht_get_item() *****\n-void dht_get_item (std::array key\n- , std::string salt = std::string());\n-query the DHT for a mutable item under the public key key. this is an ed25519\n-key. salt is optional and may be left as an empty string if no salt is to be\n-used. if the item is found in the DHT, a dht_mutable_item_alert is posted.\n-[report_issue]\n-***** dht_put_item() *****\n-sha1_hash dht_put_item (entry data);\n-store the given bencoded data as an immutable item in the DHT. the returned\n-hash is the key that is to be used to look the item up again. It's just the\n-SHA-1 hash of the bencoded form of the structure.\n-[report_issue]\n-***** dht_put_item() *****\n-void dht_put_item (std::array key\n- , std::function&\n- , std::int64_t&, std::string const&)> cb\n- , std::string salt = std::string());\n-store a mutable item. The key is the public key the blob is to be stored under.\n-The optional salt argument is a string that is to be mixed in with the key when\n-determining where in the DHT the value is to be stored. The callback function\n-is called from within the libtorrent network thread once we've found where to\n-store the blob, possibly with the current value stored under the key. The\n-values passed to the callback functions are:\n- entry& value\n- the current value stored under the key (may be empty). Also expected to\n- be set to the value to be stored by the function.\n- std::array& signature\n- the signature authenticating the current value. This may be zeros if\n- there is currently no value stored. The function is expected to fill in\n- this buffer with the signature of the new value to store. To generate the\n- signature, you may want to use the sign_mutable_item function.\n- std::int64_t& seq\n- current sequence number. May be zero if there is no current value. The\n- function is expected to set this to the new sequence number of the value\n- that is to be stored. Sequence numbers must be monotonically increasing.\n- Attempting to overwrite a value with a lower or equal sequence number\n- will fail, even if the signature is correct.\n- std::string const& salt\n- this is the salt that was used for this put call.\n-Since the callback function cb is called from within libtorrent, it is critical\n-to not perform any blocking operations. Ideally not even locking a mutex. Pass\n-any data required for this function along with the function object's context\n-and make the function entirely self-contained. The only reason data blob's\n-value is computed via a function instead of just passing in the new value is to\n-avoid race conditions. If you want to update the value in the DHT, you must\n-first retrieve it, then modify it, then write it back. The way the DHT works,\n-it is natural to always do a lookup before storing and calling the callback in\n-between is convenient.\n- [report_issue]\n-***** dht_announce() dht_get_peers() *****\n-void dht_get_peers (sha1_hash const& info_hash);\n-void dht_announce (sha1_hash const& info_hash, int port = 0, dht::\n-announce_flags_t flags = {});\n-dht_get_peers() will issue a DHT get_peer request to the DHT for the specified\n-info-hash. The response (the peers) will be posted back in a\n-dht_get_peers_reply_alert.\n-dht_announce() will issue a DHT announce request to the DHT to the specified\n-info-hash, advertising the specified port. If the port is left at its default,\n-0, the port will be implied by the DHT message's source port (which may improve\n-connectivity through a NAT).\n-Both these functions are exposed for advanced custom use of the DHT. All\n-torrents eligible to be announce to the DHT will be automatically, by\n-libtorrent.\n-For possible flags, see announce_flags_t.\n-[report_issue]\n-***** dht_live_nodes() *****\n-void dht_live_nodes (sha1_hash const& nid);\n-Retrieve all the live DHT (identified by nid) nodes. All the nodes id and\n-endpoint will be returned in the list of nodes in the alert\n-dht_live_nodes_alert. Since this alert is a response to an explicit call, it\n-will always be posted, regardless of the alert mask.\n-[report_issue]\n-***** dht_sample_infohashes() *****\n-void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n-Query the DHT node specified by ep to retrieve a sample of the info-hashes that\n-the node currently have in their storage. The target is included for iterative\n-lookups so that indexing nodes can perform a key space traversal with a single\n-RPC per node by adjusting the target value for each RPC. It has no effect on\n-the returned sample value. The result is posted as a\n-dht_sample_infohashes_alert.\n-[report_issue]\n-***** dht_direct_request() *****\n-void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t\n-userdata = {});\n-Send an arbitrary DHT request directly to the specified endpoint. This function\n-is intended for use by plugins. When a response is received or the request\n-times out, a dht_direct_response_alert will be posted with the response (if\n-any) and the userdata pointer passed in here. Since this alert is a response to\n-an explicit call, it will always be posted, regardless of the alert mask.\n-[report_issue]\n-***** add_extension() *****\n-void add_extension (std::shared_ptr ext);\n-void add_extension (std::function(\n- torrent_handle const&, client_data_t)> ext);\n-This function adds an extension to this session. The argument is a function\n-object that is called with a torrent_handle and which should return a std::\n-shared_ptr. To write custom plugins, see libtorrent_plugins.\n-For the typical bittorrent client all of these extensions should be added. The\n-main plugins implemented in libtorrent are:\n- uTorrent metadata\n- Allows peers to download the metadata (.torrent files) from the swarm\n- directly. Makes it possible to join a swarm with just a tracker and info-\n- hash.\n-#include \n-ses.add_extension(<::create_ut_metadata_plugin);\n- uTorrent peer exchange\n- Exchanges peers between clients.\n-#include \n-ses.add_extension(<::create_ut_pex_plugin);\n- smart ban plugin\n- A plugin that, with a small overhead, can ban peers that sends bad data\n- with very high accuracy. Should eliminate most problems on poisoned\n- torrents.\n-#include \n-ses.add_extension(<::create_smart_ban_plugin);\n- [report_issue]\n-***** get_ip_filter() set_ip_filter() *****\n-ip_filter get_ip_filter () const;\n-void set_ip_filter (ip_filter f);\n-Sets a filter that will be used to reject and accept incoming as well as\n-outgoing connections based on their originating ip address. The default filter\n-will allow connections to any ip address. To build a set of rules for which\n-addresses are accepted and not, see ip_filter.\n-Each time a peer is blocked because of the IP filter, a peer_blocked_alert is\n-generated. get_ip_filter() Returns the ip_filter currently in the session. See\n-ip_filter.\n-[report_issue]\n-***** set_port_filter() *****\n-void set_port_filter (port_filter const& f);\n-apply port_filter f to incoming and outgoing peers. a port filter will reject\n-making outgoing peer connections to certain remote ports. The main intention is\n-to be able to avoid triggering certain anti-virus software by connecting to\n-SMTP, FTP ports.\n- [report_issue]\n-***** is_listening() listen_port() ssl_listen_port() *****\n-unsigned short listen_port () const;\n-unsigned short ssl_listen_port () const;\n-bool is_listening () const;\n-is_listening() will tell you whether or not the session has successfully opened\n-a listening port. If it hasn't, this function will return false, and then you\n-can set a new settings_pack::listen_interfaces to try another interface and\n-port to bind to.\n-listen_port() returns the port we ended up listening on.\n- [report_issue]\n-***** set_peer_class_filter() get_peer_class_filter() *****\n-ip_filter get_peer_class_filter () const;\n-void set_peer_class_filter (ip_filter const& f);\n-Sets the peer class filter for this session. All new peer connections will take\n-this into account and be added to the peer classes specified by this filter,\n-based on the peer's IP address.\n-The ip-filter essentially maps an IP -> uint32. Each bit in that 32 bit integer\n-represents a peer class. The least significant bit represents class 0, the next\n-bit class 1 and so on.\n-For more info, see ip_filter.\n-For example, to make all peers in the range 200.1.1.0 - 200.1.255.255 belong to\n-their own peer class, apply the following filter:\n-ip_filter f = ses.get_peer_class_filter();\n-peer_class_t my_class = ses.create_peer_class(\"200.1.x.x IP range\");\n-f.add_rule(make_address(\"200.1.1.0\"), make_address(\"200.1.255.255\")\n- , 1 << static_cast(my_class));\n-ses.set_peer_class_filter(f);\n-This setting only applies to new connections, it won't affect existing peer\n-connections.\n-This function is limited to only peer class 0-31, since there are only 32 bits\n-in the IP range mapping. Only the set bits matter; no peer class will be\n-removed from a peer as a result of this call, peer classes are only added.\n-The peer_class argument cannot be greater than 31. The bitmasks representing\n-peer classes in the peer_class_filter are 32 bits.\n-The get_peer_class_filter() function returns the current filter.\n-For more information, see peer_classes.\n- [report_issue]\n-***** set_peer_class_type_filter() get_peer_class_type_filter() *****\n-void set_peer_class_type_filter (peer_class_type_filter const& f);\n-peer_class_type_filter get_peer_class_type_filter () const;\n-Sets and gets the peer class type filter. This is controls automatic peer class\n-assignments to peers based on what kind of socket it is.\n-It does not only support assigning peer classes, it also supports removing peer\n-classes based on socket type.\n-The order of these rules being applied are:\n- 1. peer-class IP filter\n- 2. peer-class type filter, removing classes\n- 3. peer-class type filter, adding classes\n-For more information, see peer_classes.\n-[report_issue]\n-***** create_peer_class() *****\n-peer_class_t create_peer_class (char const* name);\n-Creates a new peer class (see peer_classes) with the given name. The returned\n-integer is the new peer class identifier. Peer classes may have the same name,\n-so each invocation of this function creates a new class and returns a unique\n-identifier.\n-Identifiers are assigned from low numbers to higher. So if you plan on using\n-certain peer classes in a call to set_peer_class_filter(), make sure to create\n-those early on, to get low identifiers.\n-For more information on peer classes, see peer_classes.\n-[report_issue]\n-***** delete_peer_class() *****\n-void delete_peer_class (peer_class_t cid);\n-This call dereferences the reference count of the specified peer class. When\n-creating a peer class it's automatically referenced by 1. If you want to\n-recycle a peer class, you may call this function. You may only call this\n-function once per peer class you create. Calling it more than once for the same\n-class will lead to memory corruption.\n-Since peer classes are reference counted, this function will not remove the\n-peer class if it's still assigned to torrents or peers. It will however remove\n-it once the last peer and torrent drops their references to it.\n-There is no need to call this function for custom peer classes. All peer\n-classes will be properly destructed when the session object destructs.\n-For more information on peer classes, see peer_classes.\n- [report_issue]\n-***** set_peer_class() get_peer_class() *****\n-peer_class_info get_peer_class (peer_class_t cid) const;\n-void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n-These functions queries information from a peer class and updates the\n-configuration of a peer class, respectively.\n-cid must refer to an existing peer class. If it does not, the return value of\n-get_peer_class() is undefined.\n-set_peer_class() sets all the information in the peer_class_info object in the\n-specified peer class. There is no option to only update a single property.\n-A peer or torrent belonging to more than one class, the highest priority among\n-any of its classes is the one that is taken into account.\n-For more information, see peer_classes.\n-[report_issue]\n-***** remove_torrent() *****\n-void remove_torrent (const torrent_handle&, remove_flags_t = {});\n-remove_torrent() will close all peer connections associated with the torrent\n-and tell the tracker that we've stopped participating in the swarm. This\n-operation cannot fail. When it completes, you will receive a\n-torrent_removed_alert.\n-remove_torrent() is non-blocking, but will remove the torrent from the session\n-synchronously. Calling session_handle::add_torrent() immediately afterward with\n-the same torrent will succeed. Note that this creates a new handle which is not\n-equal to the removed one.\n-The optional second argument options can be used to delete all the files\n-downloaded by this torrent. To do so, pass in the value session_handle::\n-delete_files. Once the torrent is deleted, a torrent_deleted_alert is posted.\n-The torrent_handle remains valid for some time after remove_torrent() is\n-called. It will become invalid only after all libtorrent tasks (such as I/\n-O tasks) release their references to the torrent. Until this happens,\n-torrent_handle::is_valid() will return true, and other calls such as\n-torrent_handle::status() will succeed. Because of this, and because\n-remove_torrent() is non-blocking, the following sequence usually succeeds (does\n-not throw system_error): .. code:: c++\n- session.remove_handle(handle); handle.save_resume_data();\n-Note that when a queued or downloading torrent is removed, its position in the\n-download queue is vacated and every subsequent torrent in the queue has their\n-queue positions updated. This can potentially cause a large state_update to be\n-posted. When removing all torrents, it is advised to remove them from the back\n-of the queue, to minimize the shifting.\n- [report_issue]\n-***** get_settings() apply_settings() *****\n-void apply_settings (settings_pack const&);\n-void apply_settings (settings_pack&&);\n-settings_pack get_settings () const;\n-Applies the settings specified by the settings_pack s. This is an asynchronous\n-operation that will return immediately and actually apply the settings to the\n-main thread of libtorrent some time later.\n- [report_issue]\n-***** pop_alerts() set_alert_notify() wait_for_alert() *****\n-void pop_alerts (std::vector* alerts);\n-void set_alert_notify (std::function const& fun);\n-alert* wait_for_alert (time_duration max_wait);\n-Alerts is the main mechanism for libtorrent to report errors and events.\n-pop_alerts fills in the vector passed to it with pointers to new alerts. The\n-session still owns these alerts and they will stay valid until the next time\n-pop_alerts is called. You may not delete the alert objects.\n-It is safe to call pop_alerts from multiple different threads, as long as the\n-alerts themselves are not accessed once another thread calls pop_alerts. Doing\n-this requires manual synchronization between the popping threads.\n-wait_for_alert will block the current thread for max_wait time duration, or\n-until another alert is posted. If an alert is available at the time of the\n-call, it returns immediately. The returned alert pointer is the head of the\n-alert queue. wait_for_alert does not pop alerts from the queue, it merely peeks\n-at it. The returned alert will stay valid until pop_alerts is called twice. The\n-first time will pop it and the second will free it.\n-If there is no alert in the queue and no alert arrives within the specified\n-timeout, wait_for_alert returns nullptr.\n-In the python binding, wait_for_alert takes the number of milliseconds to wait\n-as an integer.\n-The alert queue in the session will not grow indefinitely. Make sure to pop\n-periodically to not miss notifications. To control the max number of alerts\n-that's queued by the session, see settings_pack::alert_queue_size.\n-Some alerts are considered so important that they are posted even when the\n-alert queue is full. Some alerts are considered mandatory and cannot be\n-disabled by the alert_mask. For instance, save_resume_data_alert and\n-save_resume_data_failed_alert are always posted, regardless of the alert mask.\n-To control which alerts are posted, set the alert_mask (settings_pack::\n-alert_mask).\n-If the alert queue fills up to the point where alerts are dropped, this will be\n-indicated by a alerts_dropped_alert, which contains a bitmask of which types of\n-alerts were dropped. Generally it is a good idea to make sure the alert queue\n-is large enough, the alert_mask doesn't have unnecessary categories enabled and\n-to call pop_alert() frequently, to avoid alerts being dropped.\n-the set_alert_notify function lets the client set a function object to be\n-invoked every time the alert queue goes from having 0 alerts to 1 alert. This\n-function is called from within libtorrent, it may be the main thread, or it may\n-be from within a user call. The intention of of the function is that the client\n-wakes up its main thread, to poll for more alerts using pop_alerts(). If the\n-notify function fails to do so, it won't be called again, until pop_alerts is\n-called for some other reason. For instance, it could signal an eventfd, post a\n-message to an HWND or some other main message pump. The actual retrieval of\n-alerts should not be done in the callback. In fact, the callback should not\n-block. It should not perform any expensive work. It really should just notify\n-the main application thread.\n-The type of an alert is returned by the polymorphic function alert::type() but\n-can also be queries from a concrete type via T::alert_type, as a static\n-constant.\n- [report_issue]\n-***** delete_port_mapping() add_port_mapping() *****\n-void delete_port_mapping (port_mapping_t handle);\n-std::vector add_port_mapping (portmap_protocol t, int\n-external_port, int local_port);\n-add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n-whichever is enabled. A mapping is created for each listen socket in the\n-session. The return values are all handles referring to the port mappings that\n-were just created. Pass them to delete_port_mapping() to remove them.\n-[report_issue]\n-***** reopen_network_sockets() *****\n-void reopen_network_sockets (reopen_network_flags_t options =\n-reopen_map_ports);\n-Instructs the session to reopen all listen and outgoing sockets.\n-It's useful in the case your platform doesn't support the built in IP notifier\n-mechanism, or if you have a better more reliable way to detect changes in the\n-IP routing table.\n-[report_issue]\n-***** native_handle() *****\n-std::shared_ptr native_handle () const;\n-This function is intended only for use by plugins. This type does not have a\n-stable API and should be relied on as little as possible.\n-[report_issue]\n- save_settings\n- saves settings (i.e. the settings_pack)\n-[report_issue]\n- save_dht_state\n- saves dht state such as nodes and node-id, possibly accelerating joining\n- the DHT if provided at next session startup.\n-[report_issue]\n- save_extension_state\n- load or save state from plugins\n-[report_issue]\n- save_ip_filter\n- load or save the IP filter set on the session\n- [report_issue]\n- global_peer_class_id tcp_peer_class_id local_peer_class_id\n- built-in peer classes\n-[report_issue]\n- delete_files\n- delete the files belonging to the torrent from disk. including the part-\n- file, if there is one\n-[report_issue]\n- delete_partfile\n- delete just the part-file associated with this torrent\n-[report_issue]\n- paused\n- when set, the session will start paused. Call session_handle::resume() to\n- start\n- [report_issue]\n- udp tcp\n- protocols used by add_port_mapping()\n-[report_issue]\n- reopen_map_ports\n- This option indicates if the ports are mapped using natpmp and upnp. If\n- mapping was already made, they are deleted and added again. This only\n- works if natpmp and/or upnp are configured to be enable.\n-[report_issue]\n-****** session_params ******\n-Declared in \"libtorrent/session_params.hpp\"\n-The session_params is a parameters pack for configuring the session before it's\n-started.\n-struct session_params\n-{\n- session_params (settings_pack const& sp);\n- session_params ();\n- session_params (settings_pack&& sp);\n- session_params (settings_pack&& sp\n- , std::vector> exts);\n- session_params (settings_pack const& sp\n- , std::vector> exts);\n-\n- settings_pack settings;\n- std::vector> extensions;\n- dht::dht_state dht_state;\n- dht::dht_storage_constructor_type dht_storage_constructor;\n- disk_io_constructor_type disk_io_constructor;\n- std::map ext_state;\n- libtorrent::ip_filter ip_filter;\n-};\n-[report_issue]\n-***** session_params() *****\n-session_params (settings_pack const& sp);\n-session_params ();\n-session_params (settings_pack&& sp);\n-This constructor can be used to start with the default plugins (ut_metadata,\n-ut_pex and smart_ban). Pass a settings_pack to set the initial settings when\n-the session starts.\n-[report_issue]\n-***** session_params() *****\n-session_params (settings_pack&& sp\n- , std::vector> exts);\n-session_params (settings_pack const& sp\n- , std::vector> exts);\n-This constructor helps to configure the set of initial plugins to be added to\n-the session before it's started.\n-[report_issue]\n- settings\n- The settings to configure the session with\n-[report_issue]\n- extensions\n- the plugins to add to the session as it is constructed\n-[report_issue]\n- dht_state\n- DHT node ID and node addresses to bootstrap the DHT with.\n-[report_issue]\n- dht_storage_constructor\n- function object to construct the storage object for DHT items.\n-[report_issue]\n- disk_io_constructor\n- function object to create the disk I/O subsystem. Defaults to\n- default_disk_io_constructor.\n-[report_issue]\n- ext_state\n- this container can be used by extensions/plugins to store settings. It's\n- primarily here to make it convenient to save and restore state across\n- sessions, using read_session_params() and write_session_params().\n-[report_issue]\n- ip_filter\n- the IP filter to use for the session. This restricts which peers are\n- allowed to connect. As if passed to set_ip_filter().\n- [report_issue]\n-****** write_session_params_buf() read_session_params() write_session_params()\n-******\n-Declared in \"libtorrent/session_params.hpp\"\n-entry write_session_params (session_params const& sp\n- , save_state_flags_t flags = save_state_flags_t::all());\n-std::vector write_session_params_buf (session_params const& sp\n- , save_state_flags_t flags = save_state_flags_t::all());\n-session_params read_session_params (span buf\n- , save_state_flags_t flags = save_state_flags_t::all());\n-session_params read_session_params (bdecode_node const& e\n- , save_state_flags_t flags = save_state_flags_t::all());\n-These functions serialize and de-serialize a session_params object to and from\n-bencoded form. The session_params object is used to initialize a new session\n-using the state from a previous one (or by programmatically configure the\n-session up-front). The flags parameter can be used to only save and load\n-certain aspects of the session's state. The _buf suffix indicates the function\n-operates on buffer rather than the bencoded structure. The torrents in a\n-session are not part of the session_params state, they have to be restored\n-separately.\n-[report_issue]\n-****** peer_info ******\n-Declared in \"libtorrent/peer_info.hpp\"\n-holds information and statistics about one peer that libtorrent is connected to\n-struct peer_info\n-{\n- std::string client;\n- typed_bitfield pieces;\n- std::int64_t total_download;\n- std::int64_t total_upload;\n- time_duration last_request;\n- time_duration last_active;\n- time_duration download_queue_time;\n- static constexpr peer_flags_t interesting = 0_bit;\n- static constexpr peer_flags_t choked = 1_bit;\n- static constexpr peer_flags_t remote_interested = 2_bit;\n- static constexpr peer_flags_t remote_choked = 3_bit;\n- static constexpr peer_flags_t supports_extensions = 4_bit;\n- static constexpr peer_flags_t outgoing_connection = 5_bit;\n- static constexpr peer_flags_t local_connection = 5_bit;\n- static constexpr peer_flags_t handshake = 6_bit;\n- static constexpr peer_flags_t connecting = 7_bit;\n- static constexpr peer_flags_t on_parole = 9_bit;\n- static constexpr peer_flags_t seed = 10_bit;\n- static constexpr peer_flags_t optimistic_unchoke = 11_bit;\n- static constexpr peer_flags_t snubbed = 12_bit;\n- static constexpr peer_flags_t upload_only = 13_bit;\n- static constexpr peer_flags_t endgame_mode = 14_bit;\n- static constexpr peer_flags_t holepunched = 15_bit;\n- static constexpr peer_flags_t i2p_socket = 16_bit;\n- static constexpr peer_flags_t utp_socket = 17_bit;\n- static constexpr peer_flags_t ssl_socket = 18_bit;\n- static constexpr peer_flags_t rc4_encrypted = 19_bit;\n- static constexpr peer_flags_t plaintext_encrypted = 20_bit;\n- peer_flags_t flags;\n- static constexpr peer_source_flags_t tracker = 0_bit;\n- static constexpr peer_source_flags_t dht = 1_bit;\n- static constexpr peer_source_flags_t pex = 2_bit;\n- static constexpr peer_source_flags_t lsd = 3_bit;\n- static constexpr peer_source_flags_t resume_data = 4_bit;\n- static constexpr peer_source_flags_t incoming = 5_bit;\n- peer_source_flags_t source;\n- int up_speed;\n- int down_speed;\n- int payload_up_speed;\n- int payload_down_speed;\n- peer_id pid;\n- int queue_bytes;\n- int request_timeout;\n- int send_buffer_size;\n- int used_send_buffer;\n- int receive_buffer_size;\n- int used_receive_buffer;\n- int receive_buffer_watermark;\n- int num_hashfails;\n- int download_queue_length;\n- int timed_out_requests;\n- int busy_requests;\n- int requests_in_buffer;\n- int target_dl_queue_length;\n- int upload_queue_length;\n- int failcount;\n- piece_index_t downloading_piece_index;\n- int downloading_block_index;\n- int downloading_progress;\n- int downloading_total;\n- static constexpr connection_type_t standard_bittorrent = 0_bit;\n- static constexpr connection_type_t web_seed = 1_bit;\n- static constexpr connection_type_t http_seed = 2_bit;\n- connection_type_t connection_type;\n- int pending_disk_bytes;\n- int pending_disk_read_bytes;\n- int send_quota;\n- int receive_quota;\n- int rtt;\n- int num_pieces;\n- int download_rate_peak;\n- int upload_rate_peak;\n- float progress;\n- int progress_ppm;\n- tcp::endpoint ip;\n- tcp::endpoint local_endpoint;\n- static constexpr bandwidth_state_flags_t bw_idle = 0_bit;\n- static constexpr bandwidth_state_flags_t bw_limit = 1_bit;\n- static constexpr bandwidth_state_flags_t bw_network = 2_bit;\n- static constexpr bandwidth_state_flags_t bw_disk = 4_bit;\n- bandwidth_state_flags_t read_state;\n- bandwidth_state_flags_t write_state;\n-};\n-[report_issue]\n- client\n- A human readable string describing the software at the other end of the\n- connection. In some cases this information is not available, then it will\n- contain a string that may give away something about which software is\n- running in the other end. In the case of a web seed, the server type and\n- version will be a part of this string. This is UTF-8 encoded.\n-[report_issue]\n- pieces\n- a bitfield, with one bit per piece in the torrent. Each bit tells you if\n- the peer has that piece (if it's set to 1) or if the peer miss that piece\n- (set to 0).\n- [report_issue]\n- total_download total_upload\n- the total number of bytes downloaded from and uploaded to this peer.\n- These numbers do not include the protocol chatter, but only the payload\n- data.\n- [report_issue]\n- last_request last_active\n- the time since we last sent a request to this peer and since any transfer\n- occurred with this peer\n-[report_issue]\n- download_queue_time\n- the time until all blocks in the request queue will be downloaded\n-[report_issue]\n- interesting\n- we are interested in pieces from this peer.\n-[report_issue]\n- choked\n- we have choked this peer.\n-[report_issue]\n- remote_interested\n- the peer is interested in us\n-[report_issue]\n- remote_choked\n- the peer has choked us.\n-[report_issue]\n- supports_extensions\n- means that this peer supports the extension_protocol.\n-[report_issue]\n- outgoing_connection\n- The connection was initiated by us, the peer has a listen port open, and\n- that port is the same as in the address of this peer. If this flag is not\n- set, this peer connection was opened by this peer connecting to us.\n-[report_issue]\n- local_connection\n- deprecated synonym for outgoing_connection\n-[report_issue]\n- handshake\n- The connection is opened, and waiting for the handshake. Until the\n- handshake is done, the peer cannot be identified.\n-[report_issue]\n- connecting\n- The connection is in a half-open state (i.e. it is being connected).\n-[report_issue]\n- on_parole\n- The peer has participated in a piece that failed the hash check, and is\n- now \"on parole\", which means we're only requesting whole pieces from this\n- peer until it either fails that piece or proves that it doesn't send bad\n- data.\n-[report_issue]\n- seed\n- This peer is a seed (it has all the pieces).\n-[report_issue]\n- optimistic_unchoke\n- This peer is subject to an optimistic unchoke. It has been unchoked for a\n- while to see if it might unchoke us in return an earn an upload/unchoke\n- slot. If it doesn't within some period of time, it will be choked and\n- another peer will be optimistically unchoked.\n-[report_issue]\n- snubbed\n- This peer has recently failed to send a block within the request timeout\n- from when the request was sent. We're currently picking one block at a\n- time from this peer.\n-[report_issue]\n- upload_only\n- This peer has either explicitly (with an extension) or implicitly (by\n- becoming a seed) told us that it will not downloading anything more,\n- regardless of which pieces we have.\n-[report_issue]\n- endgame_mode\n- This means the last time this peer picket a piece, it could not pick as\n- many as it wanted because there were not enough free ones. i.e. all\n- pieces this peer has were already requested from other peers.\n-[report_issue]\n- holepunched\n- This flag is set if the peer was in holepunch mode when the connection\n- succeeded. This typically only happens if both peers are behind a NAT and\n- the peers connect via the NAT holepunch mechanism.\n-[report_issue]\n- i2p_socket\n- indicates that this socket is running on top of the I2P transport.\n-[report_issue]\n- utp_socket\n- indicates that this socket is a uTP socket\n-[report_issue]\n- ssl_socket\n- indicates that this socket is running on top of an SSL (TLS) channel\n-[report_issue]\n- rc4_encrypted\n- this connection is obfuscated with RC4\n-[report_issue]\n- plaintext_encrypted\n- the handshake of this connection was obfuscated with a Diffie-Hellman\n- exchange\n-[report_issue]\n- flags\n- tells you in which state the peer is in. It is set to any combination of\n- the peer_flags_t flags above.\n-[report_issue]\n- tracker\n- The peer was received from the tracker.\n-[report_issue]\n- dht\n- The peer was received from the kademlia DHT.\n-[report_issue]\n- pex\n- The peer was received from the peer exchange extension.\n-[report_issue]\n- lsd\n- The peer was received from the local service discovery (The peer is on\n- the local network).\n-[report_issue]\n- resume_data\n- The peer was added from the fast resume data.\n-[report_issue]\n- incoming\n- we received an incoming connection from this peer\n-[report_issue]\n- source\n- a combination of flags describing from which sources this peer was\n- received. A combination of the peer_source_flags_t above.\n- [report_issue]\n- up_speed down_speed\n- the current upload and download speed we have to and from this peer\n- (including any protocol messages). updated about once per second\n- [report_issue]\n- payload_up_speed payload_down_speed\n- The transfer rates of payload data only updated about once per second\n-[report_issue]\n- pid\n- the peer's id as used in the bit torrent protocol. This id can be used to\n- extract 'fingerprints' from the peer. Sometimes it can tell you which\n- client the peer is using. See identify_client()_\n-[report_issue]\n- queue_bytes\n- the number of bytes we have requested from this peer, but not yet\n- received.\n-[report_issue]\n- request_timeout\n- the number of seconds until the current front piece request will time\n- out. This timeout can be adjusted through settings_pack::request_timeout.\n- -1 means that there is not outstanding request.\n- [report_issue]\n- send_buffer_size used_send_buffer\n- the number of bytes allocated and used for the peer's send buffer,\n- respectively.\n- [report_issue]\n- receive_buffer_size used_receive_buffer receive_buffer_watermark\n- the number of bytes allocated and used as receive buffer, respectively.\n-[report_issue]\n- num_hashfails\n- the number of pieces this peer has participated in sending us that turned\n- out to fail the hash check.\n-[report_issue]\n- download_queue_length\n- this is the number of requests we have sent to this peer that we haven't\n- got a response for yet\n-[report_issue]\n- timed_out_requests\n- the number of block requests that have timed out, and are still in the\n- download queue\n-[report_issue]\n- busy_requests\n- the number of busy requests in the download queue. A busy request is a\n- request for a block we've also requested from a different peer\n-[report_issue]\n- requests_in_buffer\n- the number of requests messages that are currently in the send buffer\n- waiting to be sent.\n-[report_issue]\n- target_dl_queue_length\n- the number of requests that is tried to be maintained (this is typically\n- a function of download speed)\n-[report_issue]\n- upload_queue_length\n- the number of piece-requests we have received from this peer that we\n- haven't answered with a piece yet.\n-[report_issue]\n- failcount\n- the number of times this peer has \"failed\". i.e. failed to connect or\n- disconnected us. The failcount is decremented when we see this peer in a\n- tracker response or peer exchange message.\n- [report_issue]\n- downloading_piece_index downloading_block_index downloading_progress\n- downloading_total\n- You can know which piece, and which part of that piece, that is currently\n- being downloaded from a specific peer by looking at these four members.\n- downloading_piece_index is the index of the piece that is currently being\n- downloaded. This may be set to -1 if there's currently no piece\n- downloading from this peer. If it is >= 0, the other three members are\n- valid. downloading_block_index is the index of the block (or sub-piece)\n- that is being downloaded. downloading_progress is the number of bytes of\n- this block we have received from the peer, and downloading_total is the\n- total number of bytes in this block.\n-[report_issue]\n- standard_bittorrent\n- Regular bittorrent connection\n-[report_issue]\n- web_seed\n- HTTP connection using the BEP_19 protocol\n-[report_issue]\n- http_seed\n- HTTP connection using the BEP_17 protocol\n-[report_issue]\n- connection_type\n- the kind of connection this peer uses. See connection_type_t.\n-[report_issue]\n- pending_disk_bytes\n- the number of bytes this peer has pending in the disk-io thread.\n- Downloaded and waiting to be written to disk. This is what is capped by\n- settings_pack::max_queued_disk_bytes.\n-[report_issue]\n- pending_disk_read_bytes\n- number of outstanding bytes to read from disk\n- [report_issue]\n- send_quota receive_quota\n- the number of bytes this peer has been assigned to be allowed to send and\n- receive until it has to request more quota from the bandwidth manager.\n-[report_issue]\n- rtt\n- an estimated round trip time to this peer, in milliseconds. It is\n- estimated by timing the TCP connect(). It may be 0 for incoming\n- connections.\n-[report_issue]\n- num_pieces\n- the number of pieces this peer has.\n- [report_issue]\n- download_rate_peak upload_rate_peak\n- the highest download and upload rates seen on this connection. They are\n- given in bytes per second. This number is reset to 0 on reconnect.\n-[report_issue]\n- progress\n- the progress of the peer in the range [0, 1]. This is always 0 when\n- floating point operations are disabled, instead use progress_ppm.\n-[report_issue]\n- progress_ppm\n- indicates the download progress of the peer in the range [0, 1000000]\n- (parts per million).\n-[report_issue]\n- ip\n- the IP-address to this peer. The type is an asio endpoint. For more info,\n- see the asio documentation.\n-[report_issue]\n- local_endpoint\n- the IP and port pair the socket is bound to locally. i.e. the IP address\n- of the interface it's going out over. This may be useful for multi-homed\n- clients with multiple interfaces to the internet.\n-[report_issue]\n- bw_idle\n- The peer is not waiting for any external events to send or receive data.\n-[report_issue]\n- bw_limit\n- The peer is waiting for the rate limiter.\n-[report_issue]\n- bw_network\n- The peer has quota and is currently waiting for a network read or write\n- operation to complete. This is the state all peers are in if there are no\n- bandwidth limits.\n-[report_issue]\n- bw_disk\n- The peer is waiting for the disk I/O thread to catch up writing buffers\n- to disk before downloading more.\n- [report_issue]\n- read_state write_state\n- bitmasks indicating what state this peer is in with regards to sending\n- and receiving data. The states are defined as independent flags of type\n- bandwidth_state_flags_t, in this class.\n-[report_issue]\n-****** peer_request ******\n-Declared in \"libtorrent/peer_request.hpp\"\n-represents a byte range within a piece. Internally this is is used for incoming\n-piece requests.\n-struct peer_request\n-{\n- bool operator== (peer_request const& r) const;\n-\n- piece_index_t piece;\n- int start;\n- int length;\n-};\n-[report_issue]\n-***** operator==() *****\n-bool operator== (peer_request const& r) const;\n-returns true if the right hand side peer_request refers to the same range as\n-this does.\n-[report_issue]\n- piece\n- The index of the piece in which the range starts.\n-[report_issue]\n- start\n- The byte offset within that piece where the range starts.\n-[report_issue]\n- length\n- The size of the range, in bytes.\n-[report_issue]\n-****** piece_block ******\n-Declared in \"libtorrent/piece_block.hpp\"\n-struct piece_block\n-{\n- piece_block () = default;\n- piece_block (piece_index_t p_index, int b_index);\n- bool operator< (piece_block const& b) const;\n- bool operator== (piece_block const& b) const;\n- bool operator!= (piece_block const& b) const;\n-\n- static const piece_block invalid;\n- piece_index_t piece_index {0};\n- int block_index = 0;\n-};\n-[report_issue]\n-****** info_hash_t ******\n-Declared in \"libtorrent/info_hash.hpp\"\n-class holding the info-hash of a torrent. It can hold a v1 info-hash (SHA-1) or\n-a v2 info-hash (SHA-256) or both.\n-Note\n-If has_v2() is false then the v1 hash might actually be a truncated v2 hash\n-struct info_hash_t\n-{\n- explicit info_hash_t (sha256_hash h2) noexcept;\n- info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n- explicit info_hash_t (sha1_hash h1) noexcept;\n- info_hash_t () noexcept = default;\n- bool has_v2 () const;\n- bool has (protocol_version v) const;\n- bool has_v1 () const;\n- sha1_hash get (protocol_version v) const;\n- sha1_hash get_best () const;\n- friend bool operator!= (info_hash_t const& lhs, info_hash_t const& rhs);\n- friend bool operator== (info_hash_t const& lhs, info_hash_t const& rhs)\n-noexcept;\n- template void for_each (F f) const;\n- bool operator< (info_hash_t const& o) const;\n- friend std::ostream& operator<< (std::ostream& os, info_hash_t const& ih);\n-\n- sha1_hash v1;\n- sha256_hash v2;\n-};\n-[report_issue]\n-***** info_hash_t() *****\n-explicit info_hash_t (sha256_hash h2) noexcept;\n-info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n-explicit info_hash_t (sha1_hash h1) noexcept;\n-info_hash_t () noexcept = default;\n-The default constructor creates an object that has neither a v1 or v2 hash.\n-For backwards compatibility, make it possible to construct directly from a v1\n-hash. This constructor allows implicit conversion from a v1 hash, but the\n-implicitness is deprecated.\n- [report_issue]\n-***** has_v1() has_v2() has() *****\n-bool has_v2 () const;\n-bool has (protocol_version v) const;\n-bool has_v1 () const;\n-returns true if the corresponding info hash is present in this object.\n-[report_issue]\n-***** get() *****\n-sha1_hash get (protocol_version v) const;\n-returns the has for the specified protocol version\n-[report_issue]\n-***** get_best() *****\n-sha1_hash get_best () const;\n-returns the v2 (truncated) info-hash, if there is one, otherwise returns the v1\n-info-hash\n-[report_issue]\n-***** for_each() *****\n-template void for_each (F f) const;\n-calls the function object f for each hash that is available. starting with v1.\n-The signature of F is:\n-void(sha1_hash const&, protocol_version);\n-[report_issue]\n-****** truncate_files() ******\n-Declared in \"libtorrent/truncate.hpp\"\n-void truncate_files (file_storage const& fs, std::string const& save_path,\n-storage_error& ec);\n-Truncates files larger than specified in the file_storage, saved under the\n-specified save_path.\n-[report_issue]\n-****** version() ******\n-Declared in \"libtorrent/version.hpp\"\n-char const* version ();\n-returns the libtorrent version as string form in this format:\n-\"...\"\n-[report_issue]\n-****** make_magnet_uri() ******\n-Declared in \"libtorrent/magnet_uri.hpp\"\n-std::string make_magnet_uri (add_torrent_params const& atp);\n-std::string make_magnet_uri (torrent_info const& info);\n-std::string make_magnet_uri (torrent_handle const& handle);\n-Generates a magnet URI from the specified torrent.\n-Several fields from the add_torrent_params objects are recorded in the magnet\n-link. In order to not include them, they have to be cleared before calling\n-make_magnet_uri(). These fields are used:\n- ti, info_hashes, url_seeds, dht_nodes, file_priorities, trackers,\n- name, peers.\n-Depending on what the use case for the resulting magnet link is, clearing peers\n-and dht_nodes is probably a good idea if the add_torrent_params came from a\n-running torrent. Those lists may be long and be ephemeral.\n-If none of the info_hashes or ti fields are set, there is not info-hash\n-available, and a magnet link cannot be created. In this case make_magnet_uri()\n-returns an empty string.\n-The recommended way to generate a magnet link from a torrent_handle is to call\n-save_resume_data(), which will post a save_resume_data_alert containing an\n-add_torrent_params object. This can then be passed to make_magnet_uri().\n-The overload that takes a torrent_handle will make blocking calls to query\n-information about the torrent. If the torrent handle is invalid, an empty\n-string is returned.\n-For more information about magnet links, see magnet_links.\n-[report_issue]\n-****** parse_magnet_uri() ******\n-Declared in \"libtorrent/magnet_uri.hpp\"\n-void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec);\n-add_torrent_params parse_magnet_uri (string_view uri);\n-add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\n-This function parses out information from the magnet link and populates the\n-add_torrent_params object. The overload that does not take an error_code\n-reference will throw a system_error on error The overload taking an\n-add_torrent_params reference will fill in the fields specified in the magnet\n-URI.\n- [report_issue]\n-****** load_torrent_buffer() load_torrent_parsed() load_torrent_file() ******\n-Declared in \"libtorrent/load_torrent.hpp\"\n-add_torrent_params load_torrent_file (\n- std::string const& filename);\n-add_torrent_params load_torrent_parsed (\n- bdecode_node const& torrent_file);\n-add_torrent_params load_torrent_buffer (\n- span buffer, load_torrent_limits const& cfg);\n-add_torrent_params load_torrent_buffer (\n- span buffer);\n-add_torrent_params load_torrent_file (\n- std::string const& filename, load_torrent_limits const& cfg);\n-add_torrent_params load_torrent_parsed (\n- bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-These functions load the content of a .torrent file into an add_torrent_params\n-object. The immutable part of a torrent file (the info-dictionary) is stored in\n-the ti field in the add_torrent_params object (as a torrent_info object). The\n-returned object is suitable to be:\n- * added to a session via add_torrent() or async_add_torrent()\n- * saved as a .torrent_file via write_torrent_file()\n- * turned into a magnet link via make_magnet_uri()\n-[report_issue]\n-****** enum event_t ******\n-Declared in \"libtorrent/tracker_manager.hpp\"\n- ___________________________\n-|name_____|value|description|\n-|none_____|0____|\u00a0_________|\n-|completed|1____|\u00a0_________|\n-|started__|2____|\u00a0_________|\n-|stopped__|3____|\u00a0_________|\n-|paused___|4____|\u00a0_________|\n-[report_issue]\n-****** enum connection_type ******\n-Declared in \"libtorrent/peer_connection.hpp\"\n- ____________________________\n-|name______|value|description|\n-|bittorrent|0____|\u00a0_________|\n-|url_seed__|1____|\u00a0_________|\n-|http_seed_|2____|\u00a0_________|\n-[report_issue]\n-****** enum protocol_version ******\n-Declared in \"libtorrent/info_hash.hpp\"\n- _____________________________________________________________________\n-|name|value|description_______________________________________________|\n-|V1__|0____|The_original_BitTorrent_version,_using_SHA-1_hashes_______|\n-|V2__|1____|Version_2_of_the_BitTorrent_protocol,_using_SHA-256_hashes|\n-|NUM_|2____|\u00a0________________________________________________________|\n-[report_issue]\n-****** enum portmap_transport ******\n-Declared in \"libtorrent/portmap.hpp\"\n- _________________________________________\n-|name__|value|description_________________|\n-|natpmp|0____|natpmp_can_be_NAT-PMP_or_PCP|\n-|upnp__|1____|\u00a0__________________________|\n-[report_issue]\n-****** enum portmap_protocol ******\n-Declared in \"libtorrent/portmap.hpp\"\n- ______________________\n-|name|value|description|\n-|none|0____|\u00a0_________|\n-|tcp_|1____|\u00a0_________|\n-|udp_|2____|\u00a0_________|\n-[report_issue]\n-****** enum socket_type_t ******\n-Declared in \"libtorrent/socket_type.hpp\"\n- ____________________________\n-|name______|value|description|\n-|tcp_______|0____|\u00a0_________|\n-|socks5____|1____|\u00a0_________|\n-|http______|2____|\u00a0_________|\n-|utp_______|3____|\u00a0_________|\n-|i2p_______|4____|\u00a0_________|\n-|tcp_ssl___|5____|\u00a0_________|\n-|socks5_ssl|6____|\u00a0_________|\n-|http_ssl__|7____|\u00a0_________|\n-|utp_ssl___|8____|\u00a0_________|\n-[report_issue]\n-****** torrent_flags_t ******\n-Declared in \"libtorrent/torrent_flags.hpp\"\n- seed_mode\n- If seed_mode is set, libtorrent will assume that all files are present\n- for this torrent and that they all match the hashes in the torrent file.\n- Each time a peer requests to download a block, the piece is verified\n- against the hash, unless it has been verified already. If a hash fails,\n- the torrent will automatically leave the seed mode and recheck all the\n- files. The use case for this mode is if a torrent is created and seeded,\n- or if the user already know that the files are complete, this is a way to\n- avoid the initial file checks, and significantly reduce the startup time.\n- Setting seed_mode on a torrent without metadata (a .torrent file) is a\n- no-op and will be ignored.\n- It is not possible to set the seed_mode flag on a torrent after it has\n- been added to a session. It is possible to clear it though.\n- upload_mode\n- If upload_mode is set, the torrent will be initialized in upload-mode,\n- which means it will not make any piece requests. This state is typically\n- entered on disk I/O errors, and if the torrent is also auto managed, it\n- will be taken out of this state periodically (see settings_pack::\n- optimistic_disk_retry).\n- This mode can be used to avoid race conditions when adjusting priorities\n- of pieces before allowing the torrent to start downloading.\n- If the torrent is auto-managed (auto_managed), the torrent will\n- eventually be taken out of upload-mode, regardless of how it got there.\n- If it's important to manually control when the torrent leaves upload\n- mode, don't make it auto managed.\n- share_mode\n- determines if the torrent should be added in share mode or not. Share\n- mode indicates that we are not interested in downloading the torrent, but\n- merely want to improve our share ratio (i.e. increase it). A torrent\n- started in share mode will do its best to never download more than it\n- uploads to the swarm. If the swarm does not have enough demand for upload\n- capacity, the torrent will not download anything. This mode is intended\n- to be safe to add any number of torrents to, without manual screening,\n- without the risk of downloading more than is uploaded.\n- A torrent in share mode sets the priority to all pieces to 0, except for\n- the pieces that are downloaded, when pieces are decided to be downloaded.\n- This affects the progress bar, which might be set to \"100% finished\" most\n- of the time. Do not change file or piece priorities for torrents in share\n- mode, it will make it not work.\n- The share mode has one setting, the share ratio target, see\n- settings_pack::share_mode_target for more info.\n- apply_ip_filter\n- determines if the IP filter should apply to this torrent or not. By\n- default all torrents are subject to filtering by the IP filter (i.e. this\n- flag is set by default). This is useful if certain torrents needs to be\n- exempt for some reason, being an auto-update torrent for instance.\n- paused\n- specifies whether or not the torrent is paused. i.e. it won't connect to\n- the tracker or any of the peers until it's resumed. Note that a paused\n- torrent that also has the auto_managed flag set can be started at any\n- time by libtorrent's queuing logic. See queuing.\n- auto_managed\n- If the torrent is auto-managed (auto_managed), the torrent may be resumed\n- at any point, regardless of how it paused. If it's important to manually\n- control when the torrent is paused and resumed, don't make it auto\n- managed.\n- If auto_managed is set, the torrent will be queued, started and seeded\n- automatically by libtorrent. When this is set, the torrent should also be\n- started as paused. The default queue order is the order the torrents were\n- added. They are all downloaded in that order. For more details, see\n- queuing.\n- duplicate_is_error\n- used in add_torrent_params to indicate that it's an error to attempt to\n- add a torrent that's already in the session. If it's not considered an\n- error, a handle to the existing torrent is returned. This flag is not\n- saved by write_resume_data(), since it is only meant for adding torrents.\n- update_subscribe\n- on by default and means that this torrent will be part of state updates\n- when calling post_torrent_updates(). This flag is not saved by\n- write_resume_data().\n- super_seeding\n- sets the torrent into super seeding/initial seeding mode. If the torrent\n- is not a seed, this flag has no effect.\n- sequential_download\n- sets the sequential download state for the torrent. In this mode the\n- piece picker will pick pieces with low index numbers before pieces with\n- high indices. The actual pieces that are picked depend on other factors\n- still, such as which pieces a peer has and whether it is in parole mode\n- or \"prefer whole pieces\"-mode. Sequential mode is not ideal for streaming\n- media. For that, see set_piece_deadline() instead.\n- stop_when_ready\n- When this flag is set, the torrent will force stop whenever it\n- transitions from a non-data-transferring state into a data-transferring\n- state (referred to as being ready to download or seed). This is useful\n- for torrents that should not start downloading or seeding yet, but want\n- to be made ready to do so. A torrent may need to have its files checked\n- for instance, so it needs to be started and possibly queued for checking\n- (auto-managed and started) but as soon as it's done, it should be\n- stopped.\n- Force stopped means auto-managed is set to false and it's paused. As if\n- the auto_manages flag is cleared and the paused flag is set on the\n- torrent.\n- Note that the torrent may transition into a downloading state while\n- setting this flag, and since the logic is edge triggered you may miss the\n- edge. To avoid this race, if the torrent already is in a downloading\n- state when this call is made, it will trigger the stop-when-ready\n- immediately.\n- When the stop-when-ready logic fires, the flag is cleared. Any subsequent\n- transitions between downloading and non-downloading states will not be\n- affected, until this flag is set again.\n- The behavior is more robust when setting this flag as part of adding the\n- torrent. See add_torrent_params.\n- The stop-when-ready flag fixes the inherent race condition of waiting for\n- the state_changed_alert and then call pause(). The download/seeding will\n- most likely start in between posting the alert and receiving the call to\n- pause.\n- A downloading state is one where peers are being connected. Which means\n- just downloading the metadata via the ut_metadata extension counts as a\n- downloading state. In order to stop a torrent once the metadata has been\n- downloaded, instead set all file priorities to dont_download\n- override_trackers\n- when this flag is set, the tracker list in the add_torrent_params object\n- override any trackers from the torrent file. If the flag is not set, the\n- trackers from the add_torrent_params object will be added to the list of\n- trackers used by the torrent. This flag is set by read_resume_data() if\n- there are trackers present in the resume data file. This effectively\n- makes the trackers saved in the resume data take precedence over the\n- original trackers. This includes if there's an empty list of trackers, to\n- support the case where they were explicitly removed in the previous\n- session. This flag is not saved by write_resume_data()\n- override_web_seeds\n- If this flag is set, the web seeds from the add_torrent_params object\n- will override any web seeds in the torrent file. If it's not set, web\n- seeds in the add_torrent_params object will be added to the list of web\n- seeds used by the torrent. This flag is set by read_resume_data() if\n- there are web seeds present in the resume data file. This effectively\n- makes the web seeds saved in the resume data take precedence over the\n- original ones. This includes if there's an empty list of web seeds, to\n- support the case where they were explicitly removed in the previous\n- session. This flag is not saved by write_resume_data()\n- need_save_resume\n- if this flag is set (which it is by default) the torrent will be\n- considered needing to save its resume data immediately as it's added. New\n- torrents that don't have any resume data should do that. This flag is\n- cleared by a successful call to save_resume_data() This flag is not saved\n- by write_resume_data(), since it represents an ephemeral state of a\n- running torrent.\n- disable_dht\n- set this flag to disable DHT for this torrent. This lets you have the DHT\n- enabled for the whole client, and still have specific torrents not\n- participating in it. i.e. not announcing to the DHT nor picking up peers\n- from it.\n- disable_lsd\n- set this flag to disable local service discovery for this torrent.\n- disable_pex\n- set this flag to disable peer exchange for this torrent.\n- no_verify_files\n- if this flag is set, the resume data will be assumed to be correct\n- without validating it against any files on disk. This may be used when\n- restoring a session by loading resume data from disk. It will save time\n- and also delay any hard disk errors until files are actually needed. If\n- the resume data cannot be trusted, or if a torrent is added for the first\n- time to some save path that may already have some of the files, this flag\n- should not be set.\n- default_dont_download\n- default all file priorities to dont_download. This is useful for adding\n- magnet links where the number of files is unknown, but the\n- file_priorities is still set for some files. Any file not covered by the\n- file_priorities list will be set to normal download priority, unless this\n- flag is set, in which case they will be set to 0 (dont_download).\n- all\n- all torrent flags combined. Can conveniently be used when creating masks\n- for flags\n-[report_issue]\n-****** int ******\n-Declared in \"libtorrent/version.hpp\"\n- version_major\n- the major, minor and tiny versions of libtorrent\n- version_minor\n- the major, minor and tiny versions of libtorrent\n- version_tiny\n- the major, minor and tiny versions of libtorrent\n-[report_issue]\n-****** char const* ******\n-Declared in \"libtorrent/version.hpp\"\n- version_str\n- the libtorrent version in string form\n-[report_issue]\n-****** std::uint64_t ******\n-Declared in \"libtorrent/version.hpp\"\n- version_revision\n- the git commit of this libtorrent version\n-[report_issue]\n-****** pex_flags_t ******\n-Declared in \"libtorrent/pex_flags.hpp\"\n- pex_encryption\n- the peer supports protocol encryption\n- pex_seed\n- the peer is a seed\n- pex_utp\n- the peer supports the uTP, transport protocol over UDP.\n- pex_holepunch\n- the peer supports the holepunch extension If this flag is received from a\n- peer, it can be used as a rendezvous point in case direct connections to\n- the peer fail\n- pex_lt_v2\n- protocol v2 this is not a standard flag, it is only used internally\n-[report_issue]\n-****** download_priority_t ******\n-Declared in \"libtorrent/download_priority.hpp\"\n- dont_download\n- Don't download the file or piece. Partial pieces may still be downloaded\n- when setting file priorities.\n- default_priority\n- The default priority for files and pieces.\n- low_priority\n- The lowest priority for files and pieces.\n- top_priority\n- The highest priority for files and pieces.\n-[report_issue]\n-****** web_seed_entry ******\n-Declared in \"libtorrent/torrent_info.hpp\"\n-the web_seed_entry holds information about a web seed (also known as URL seed\n-or HTTP seed). It is essentially a URL with some state associated with it. For\n-more information, see BEP_17 and BEP_19.\n-struct web_seed_entry\n-{\n- bool operator== (web_seed_entry const& e) const;\n- bool operator< (web_seed_entry const& e) const;\n-\n- enum type_t\n- {\n- url_seed,\n- http_seed,\n- };\n-\n- std::string url;\n- std::string auth;\n- headers_t extra_headers;\n- std::uint8_t type;\n-};\n-[report_issue]\n-***** operator==() *****\n-bool operator== (web_seed_entry const& e) const;\n-URL and type comparison\n-[report_issue]\n-***** operator<() *****\n-bool operator< (web_seed_entry const& e) const;\n-URL and type less-than comparison\n-[report_issue]\n-***** enum type_t *****\n-Declared in \"libtorrent/torrent_info.hpp\"\n- ___________________________\n-|name_____|value|description|\n-|url_seed_|0____|\u00a0_________|\n-|http_seed|1____|\u00a0_________|\n-[report_issue]\n- url\n- The URL of the web seed\n-[report_issue]\n- auth\n- Optional authentication. If this is set, it's passed in as HTTP basic\n- auth to the web seed. The format is: username:password.\n-[report_issue]\n- extra_headers\n- Any extra HTTP headers that need to be passed to the web seed\n-[report_issue]\n- type\n- The type of web seed (see type_t)\n-[report_issue]\n-****** load_torrent_limits ******\n-Declared in \"libtorrent/torrent_info.hpp\"\n-this object holds configuration options for limits to use when loading\n-torrents. They are meant to prevent loading potentially malicious torrents that\n-cause excessive memory allocations.\n-struct load_torrent_limits\n-{\n- int max_buffer_size = 10000000;\n- int max_pieces = 0x200000;\n- int max_decode_depth = 100;\n- int max_decode_tokens = 3000000;\n-};\n-[report_issue]\n- max_buffer_size\n- the max size of a .torrent file to load into RAM\n-[report_issue]\n- max_pieces\n- the max number of pieces allowed in the torrent\n-[report_issue]\n- max_decode_depth\n- the max recursion depth in the bdecoded structure\n-[report_issue]\n- max_decode_tokens\n- the max number of bdecode tokens\n-[report_issue]\n-****** torrent_info ******\n-Declared in \"libtorrent/torrent_info.hpp\"\n-the torrent_info class holds the information found in a .torrent file.\n-class torrent_info\n-{\n- explicit torrent_info (info_hash_t const& info_hash);\n- torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n- torrent_info (bdecode_node const& torrent_file, error_code& ec);\n- torrent_info (span buffer, error_code& ec, from_span_t);\n- torrent_info (span buffer, load_torrent_limits const& cfg,\n-from_span_t);\n- torrent_info (char const* buffer, int size, error_code& ec);\n- torrent_info (torrent_info const& t);\n- torrent_info (std::string const& filename, error_code& ec);\n- explicit torrent_info (std::string const& filename);\n- explicit torrent_info (bdecode_node const& torrent_file);\n- torrent_info (bdecode_node const& torrent_file, load_torrent_limits const&\n-cfg);\n- torrent_info (char const* buffer, int size);\n- explicit torrent_info (span buffer, from_span_t);\n- ~torrent_info ();\n- file_storage const& orig_files () const;\n- file_storage const& files () const;\n- void rename_file (file_index_t index, std::string const& new_filename);\n- void remap_files (file_storage const& f);\n- void add_tracker (std::string const& url, int tier = 0);\n- void add_tracker (std::string const& url, int tier\n- , announce_entry::tracker_source source);\n- void clear_trackers ();\n- std::vector const& trackers () const;\n- std::vector similar_torrents () const;\n- std::vector collections () const;\n- std::vector const& web_seeds () const;\n- void set_web_seeds (std::vector seeds);\n- void add_url_seed (std::string const& url\n- , std::string const& ext_auth = std::string()\n- , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n-headers_t());\n- void add_http_seed (std::string const& url\n- , std::string const& extern_auth = std::string()\n- , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n-headers_t());\n- std::int64_t total_size () const;\n- int piece_length () const;\n- int num_pieces () const;\n- index_range piece_range () const;\n- piece_index_t last_piece () const;\n- piece_index_t end_piece () const;\n- sha1_hash info_hash () const noexcept;\n- info_hash_t const& info_hashes () const;\n- bool v2 () const;\n- bool v1 () const;\n- int num_files () const;\n- std::vector map_block (piece_index_t const piece\n- , std::int64_t offset, int size) const;\n- peer_request map_file (file_index_t const file, std::int64_t offset, int\n-size) const;\n- string_view ssl_cert () const;\n- bool is_valid () const;\n- bool priv () const;\n- bool is_i2p () const;\n- int piece_size (piece_index_t index) const;\n- char const* hash_for_piece_ptr (piece_index_t const index) const;\n- sha1_hash hash_for_piece (piece_index_t index) const;\n- bool is_loaded () const;\n- const std::string& name () const;\n- std::time_t creation_date () const;\n- const std::string& creator () const;\n- const std::string& comment () const;\n- std::vector> const& nodes () const;\n- void add_node (std::pair const& node);\n- bool parse_info_section (bdecode_node const& info, error_code& ec, int\n-max_pieces);\n- bdecode_node info (char const* key) const;\n- span info_section () const;\n- span piece_layer (file_index_t) const;\n- void free_piece_layers ();\n-};\n-[report_issue]\n-***** torrent_info() *****\n-explicit torrent_info (info_hash_t const& info_hash);\n-torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n-torrent_info (bdecode_node const& torrent_file, error_code& ec);\n-torrent_info (span buffer, error_code& ec, from_span_t);\n-torrent_info (span buffer, load_torrent_limits const& cfg,\n-from_span_t);\n-torrent_info (char const* buffer, int size, error_code& ec);\n-torrent_info (torrent_info const& t);\n-torrent_info (std::string const& filename, error_code& ec);\n-explicit torrent_info (std::string const& filename);\n-explicit torrent_info (bdecode_node const& torrent_file);\n-torrent_info (bdecode_node const& torrent_file, load_torrent_limits const&\n-cfg);\n-torrent_info (char const* buffer, int size);\n-explicit torrent_info (span buffer, from_span_t);\n-The constructor that takes an info-hash will initialize the info-hash to the\n-given value, but leave all other fields empty. This is used internally when\n-downloading torrents without the metadata. The metadata will be created by\n-libtorrent as soon as it has been downloaded from the swarm.\n-The constructor that takes a bdecode_node will create a torrent_info object\n-from the information found in the given torrent_file. The bdecode_node\n-represents a tree node in an bencoded file. To load an ordinary .torrent file\n-into a bdecode_node, use bdecode().\n-The version that takes a buffer pointer and a size will decode it as a .torrent\n-file and initialize the torrent_info object for you.\n-The version that takes a filename will simply load the torrent file and decode\n-it inside the constructor, for convenience. This might not be the most suitable\n-for applications that want to be able to report detailed errors on what might\n-go wrong.\n-There is an upper limit on the size of the torrent file that will be loaded by\n-the overload taking a filename. If it's important that even very large torrent\n-files are loaded, use one of the other overloads.\n-The overloads that takes an error_code const& never throws if an error occur,\n-they will simply set the error code to describe what went wrong and not fully\n-initialize the torrent_info object. The overloads that do not take the extra\n-error_code parameter will always throw if an error occurs. These overloads are\n-not available when building without exception support.\n-The overload that takes a span also needs an extra parameter of type\n-from_span_t to disambiguate the std::string overload for string literals. There\n-is an object in the libtorrent namespace of this type called from_span.\n-[report_issue]\n-***** ~torrent_info() *****\n-~torrent_info ();\n-frees all storage associated with this torrent_info object\n- [report_issue]\n-***** files() orig_files() *****\n-file_storage const& orig_files () const;\n-file_storage const& files () const;\n-The file_storage object contains the information on how to map the pieces to\n-files. It is separated from the torrent_info object because when creating\n-torrents a storage object needs to be created without having a torrent file.\n-When renaming files in a storage, the storage needs to make its own copy of the\n-file_storage in order to make its mapping differ from the one in the torrent\n-file.\n-orig_files() returns the original (unmodified) file storage for this torrent.\n-This is used by the web server connection, which needs to request files with\n-the original names. Filename may be changed using torrent_info::rename_file().\n-For more information on the file_storage object, see the separate document on\n-how to create torrents.\n-[report_issue]\n-***** rename_file() *****\n-void rename_file (file_index_t index, std::string const& new_filename);\n-Renames the file with the specified index to the new name. The new filename is\n-reflected by the file_storage returned by files() but not by the one returned\n-by orig_files().\n-If you want to rename the base name of the torrent (for a multi file torrent),\n-you can copy the file_storage (see files() and orig_files() ), change the name,\n-and then use remap_files().\n-The new_filename can both be a relative path, in which case the file name is\n-relative to the save_path of the torrent. If the new_filename is an absolute\n-path (i.e. is_complete(new_filename) == true), then the file is detached from\n-the save_path of the torrent. In this case the file is not moved when\n-move_storage() is invoked.\n-[report_issue]\n-***** remap_files() *****\n-void remap_files (file_storage const& f);\n-Warning\n-Usingremap_files()is discouraged as it's incompatible with v2 torrents. This is\n-because the piece boundaries and piece hashes in v2 torrents are intimately\n-tied to the file boundaries. Instead, just rename individual files, or\n-implement a custom disk_interface to customize how to store files.\n-Remaps the file storage to a new file layout. This can be used to, for\n-instance, download all data in a torrent to a single file, or to a number of\n-fixed size sector aligned files, regardless of the number and sizes of the\n-files in the torrent.\n-The new specified file_storage must have the exact same size as the current\n-one.\n- [report_issue]\n-***** trackers() clear_trackers() add_tracker() *****\n-void add_tracker (std::string const& url, int tier = 0);\n-void add_tracker (std::string const& url, int tier\n- , announce_entry::tracker_source source);\n-void clear_trackers ();\n-std::vector const& trackers () const;\n-add_tracker() adds a tracker to the announce-list. The tier determines the\n-order in which the trackers are to be tried. The trackers() function will\n-return a sorted vector of announce_entry. Each announce entry contains a\n-string, which is the tracker url, and a tier index. The tier index is the high-\n-level priority. No matter which trackers that works or not, the ones with lower\n-tier will always be tried before the one with higher tier number. For more\n-information, see announce_entry.\n-trackers() returns all entries from announce-list.\n-clear_trackers() removes all trackers from announce-list.\n- [report_issue]\n-***** similar_torrents() collections() *****\n-std::vector similar_torrents () const;\n-std::vector collections () const;\n-These two functions are related to BEP_38 (mutable torrents). The vectors\n-returned from these correspond to the \"similar\" and \"collections\" keys in the\n-.torrent file. Both info-hashes and collections from within the info-dict and\n-from outside of it are included.\n- [report_issue]\n-***** add_url_seed() web_seeds() add_http_seed() set_web_seeds() *****\n-std::vector const& web_seeds () const;\n-void set_web_seeds (std::vector seeds);\n-void add_url_seed (std::string const& url\n- , std::string const& ext_auth = std::string()\n- , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n-headers_t());\n-void add_http_seed (std::string const& url\n- , std::string const& extern_auth = std::string()\n- , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n-headers_t());\n-web_seeds() returns all url seeds and http seeds in the torrent. Each entry is\n-a web_seed_entry and may refer to either a url seed or http seed.\n-add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n-set_web_seeds() replaces all web seeds with the ones specified in the seeds\n-vector.\n-The extern_auth argument can be used for other authorization schemes than basic\n-HTTP authorization. If set, it will override any username and password found in\n-the URL itself. The string will be sent as the HTTP authorization header's\n-value (without specifying \"Basic\").\n-The extra_headers argument defaults to an empty list, but can be used to insert\n-custom HTTP headers in the requests to a specific web seed.\n-See http_seeding for more information.\n-[report_issue]\n-***** total_size() *****\n-std::int64_t total_size () const;\n-total_size() returns the total number of bytes the torrent-file represents.\n-Note that this is the number of pieces times the piece size (modulo the last\n-piece possibly being smaller). With pad files, the total size will be larger\n-than the sum of all (regular) file sizes.\n- [report_issue]\n-***** piece_length() num_pieces() *****\n-int piece_length () const;\n-int num_pieces () const;\n-piece_length() and num_pieces() returns the number of byte for each piece and\n-the total number of pieces, respectively. The difference between piece_size()\n-and piece_length() is that piece_size() takes the piece index as argument and\n-gives you the exact size of that piece. It will always be the same as\n-piece_length() except in the case of the last piece, which may be smaller.\n- [report_issue]\n-***** piece_range() end_piece() last_piece() *****\n-index_range piece_range () const;\n-piece_index_t last_piece () const;\n-piece_index_t end_piece () const;\n-last_piece() returns the index to the last piece in the torrent and end_piece()\n-returns the index to the one-past-end piece in the torrent piece_range()\n-returns an implementation-defined type that can be used as the container in a\n-range-for loop. Where the values are the indices of all pieces in the\n-file_storage.\n+This functions instructs the session to post the state_update_alert, containing\n+the status of all torrents whose state changed since the last time this\n+function was called.\n+Only torrents who has the state subscription flag set will be included. This\n+flag is on by default. See add_torrent_params. the flags argument is the same\n+as for torrent_handle::status(). see status_flags_t in torrent_handle.\n+[report_issue]\n+***** post_session_stats() *****\n+void post_session_stats ();\n+This function will post a session_stats_alert object, containing a snapshot of\n+the performance counters from the internals of libtorrent. To interpret these\n+counters, query the session via session_stats_metrics().\n+For more information, see the session_statistics section.\n+[report_issue]\n+***** post_dht_stats() *****\n+void post_dht_stats ();\n+This will cause a dht_stats_alert to be posted.\n+[report_issue]\n+***** set_dht_state() *****\n+void set_dht_state (dht::dht_state&& st);\n+void set_dht_state (dht::dht_state const& st);\n+set the DHT state for the session. This will be taken into account the next\n+time the DHT is started, as if it had been passed in via the session_params on\n+startup.\n [report_issue]\n-***** info_hashes() info_hash() *****\n-sha1_hash info_hash () const noexcept;\n-info_hash_t const& info_hashes () const;\n-returns the info-hash of the torrent. For BitTorrent v2 support, use\n-info_hashes() to get an object that may hold both a v1 and v2 info-hash\n+***** find_torrent() get_torrents() *****\n+std::vector get_torrents () const;\n+torrent_handle find_torrent (sha1_hash const& info_hash) const;\n+find_torrent() looks for a torrent with the given info-hash. In case there is\n+such a torrent in the session, a torrent_handle to that torrent is returned. In\n+case the torrent cannot be found, an invalid torrent_handle is returned.\n+See torrent_handle::is_valid() to know if the torrent was found or not.\n+get_torrents() returns a vector of torrent_handles to all the torrents\n+currently in the session.\n [report_issue]\n-***** v2() v1() *****\n-bool v2 () const;\n-bool v1 () const;\n-returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n-torrents have both. These are shortcuts for info_hashes().has_v1() and\n-info_hashes().has_v2() calls.\n-[report_issue]\n-***** num_files() *****\n-int num_files () const;\n-If you need index-access to files you can use the num_files() along with the\n-file_path(), file_size()-family of functions to access files using indices.\n+***** async_add_torrent() add_torrent() *****\n+void async_add_torrent (add_torrent_params&& params);\n+torrent_handle add_torrent (add_torrent_params const& params);\n+torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n+void async_add_torrent (add_torrent_params const& params);\n+torrent_handle add_torrent (add_torrent_params&& params);\n+torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n+You add torrents through the add_torrent() function where you give an object\n+with all the parameters. The add_torrent() overloads will block until the\n+torrent has been added (or failed to be added) and returns an error code and a\n+torrent_handle. In order to add torrents more efficiently, consider using\n+async_add_torrent() which returns immediately, without waiting for the torrent\n+to add. Notification of the torrent being added is sent as add_torrent_alert.\n+The overload that does not take an error_code throws an exception on error and\n+is not available when building without exception support. The torrent_handle\n+returned by add_torrent() can be used to retrieve information about the\n+torrent's progress, its peers etc. It is also used to abort a torrent.\n+If the torrent you are trying to add already exists in the session (is either\n+queued for checking, being checked or downloading) add_torrent() will throw\n+system_error which derives from std::exception unless duplicate_is_error is set\n+to false. In that case, add_torrent() will return the handle to the existing\n+torrent.\n+The add_torrent_params class has a flags field. It can be used to control what\n+state the new torrent will be added in. Common flags to want to control are\n+torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet\n+link that will just download the metadata, but no payload, set the\n+torrent_flags::upload_mode flag.\n+Special consideration has to be taken when adding hybrid torrents (i.e.\n+torrents that are BitTorrent v2 torrents that are backwards compatible with\n+v1). For more details, see BitTorrent_v2_torrents.\n+ [report_issue]\n+***** resume() pause() is_paused() *****\n+bool is_paused () const;\n+void pause ();\n+void resume ();\n+Pausing the session has the same effect as pausing every torrent in it, except\n+that torrents will not be resumed by the auto-manage mechanism. Resuming will\n+restore the torrents to their previous paused state. i.e. the session pause\n+state is separate from the torrent pause state. A torrent is inactive if it is\n+paused or if the session is paused.\n [report_issue]\n-***** map_block() *****\n-std::vector map_block (piece_index_t const piece\n- , std::int64_t offset, int size) const;\n-This function will map a piece index, a byte offset within that piece and a\n-size (in bytes) into the corresponding files with offsets where that data for\n-that piece is supposed to be stored. See file_slice.\n+***** is_dht_running() *****\n+bool is_dht_running () const;\n+is_dht_running() returns true if the DHT support has been started and false\n+otherwise.\n [report_issue]\n-***** map_file() *****\n-peer_request map_file (file_index_t const file, std::int64_t offset, int size)\n-const;\n-This function will map a range in a specific file into a range in the torrent.\n-The file_offset parameter is the offset in the file, given in bytes, where 0 is\n-the start of the file. See peer_request.\n-The input range is assumed to be valid within the torrent. file_offset + size\n-is not allowed to be greater than the file size. file_index must refer to a\n-valid file, i.e. it cannot be >= num_files().\n+***** set_dht_storage() *****\n+void set_dht_storage (dht::dht_storage_constructor_type sc);\n+set_dht_storage set a dht custom storage constructor function to be used\n+internally when the dht is created.\n+Since the dht storage is a critical component for the dht behavior, this\n+function will only be effective the next time the dht is started. If you never\n+touch this feature, a default map-memory based storage is used.\n+If you want to make sure the dht is initially created with your custom storage,\n+create a session with the setting settings_pack::enable_dht to false, set your\n+constructor function and call apply_settings with settings_pack::enable_dht to\n+true.\n [report_issue]\n-***** ssl_cert() *****\n-string_view ssl_cert () const;\n-Returns the SSL root certificate for the torrent, if it is an SSL torrent.\n-Otherwise returns an empty string. The certificate is the public certificate in\n-x509 format.\n+***** add_dht_node() *****\n+void add_dht_node (std::pair const& node);\n+add_dht_node takes a host name and port pair. That endpoint will be pinged, and\n+if a valid DHT reply is received, the node will be added to the routing table.\n [report_issue]\n-***** is_valid() *****\n-bool is_valid () const;\n-returns true if this torrent_info object has a torrent loaded. This is\n-primarily used to determine if a magnet link has had its metadata resolved yet\n-or not.\n+***** dht_get_item() *****\n+void dht_get_item (sha1_hash const& target);\n+query the DHT for an immutable item at the target hash. the result is posted as\n+a dht_immutable_item_alert.\n [report_issue]\n-***** priv() *****\n-bool priv () const;\n-returns true if this torrent is private. i.e., the client should not advertise\n-itself on the trackerless network (the Kademlia DHT) for this torrent.\n+***** dht_get_item() *****\n+void dht_get_item (std::array key\n+ , std::string salt = std::string());\n+query the DHT for a mutable item under the public key key. this is an ed25519\n+key. salt is optional and may be left as an empty string if no salt is to be\n+used. if the item is found in the DHT, a dht_mutable_item_alert is posted.\n [report_issue]\n-***** is_i2p() *****\n-bool is_i2p () const;\n-returns true if this is an i2p torrent. This is determined by whether or not it\n-has a tracker whose URL domain name ends with \".i2p\". i2p torrents disable the\n-DHT and local peer discovery as well as talking to peers over anything other\n-than the i2p network.\n+***** dht_put_item() *****\n+sha1_hash dht_put_item (entry data);\n+store the given bencoded data as an immutable item in the DHT. the returned\n+hash is the key that is to be used to look the item up again. It's just the\n+SHA-1 hash of the bencoded form of the structure.\n [report_issue]\n-***** piece_size() *****\n-int piece_size (piece_index_t index) const;\n-returns the piece size of file with index. This will be the same as\n-piece_length(), except for the last piece, which may be shorter.\n+***** dht_put_item() *****\n+void dht_put_item (std::array key\n+ , std::function&\n+ , std::int64_t&, std::string const&)> cb\n+ , std::string salt = std::string());\n+store a mutable item. The key is the public key the blob is to be stored under.\n+The optional salt argument is a string that is to be mixed in with the key when\n+determining where in the DHT the value is to be stored. The callback function\n+is called from within the libtorrent network thread once we've found where to\n+store the blob, possibly with the current value stored under the key. The\n+values passed to the callback functions are:\n+ entry& value\n+ the current value stored under the key (may be empty). Also expected to\n+ be set to the value to be stored by the function.\n+ std::array& signature\n+ the signature authenticating the current value. This may be zeros if\n+ there is currently no value stored. The function is expected to fill in\n+ this buffer with the signature of the new value to store. To generate the\n+ signature, you may want to use the sign_mutable_item function.\n+ std::int64_t& seq\n+ current sequence number. May be zero if there is no current value. The\n+ function is expected to set this to the new sequence number of the value\n+ that is to be stored. Sequence numbers must be monotonically increasing.\n+ Attempting to overwrite a value with a lower or equal sequence number\n+ will fail, even if the signature is correct.\n+ std::string const& salt\n+ this is the salt that was used for this put call.\n+Since the callback function cb is called from within libtorrent, it is critical\n+to not perform any blocking operations. Ideally not even locking a mutex. Pass\n+any data required for this function along with the function object's context\n+and make the function entirely self-contained. The only reason data blob's\n+value is computed via a function instead of just passing in the new value is to\n+avoid race conditions. If you want to update the value in the DHT, you must\n+first retrieve it, then modify it, then write it back. The way the DHT works,\n+it is natural to always do a lookup before storing and calling the callback in\n+between is convenient.\n [report_issue]\n-***** hash_for_piece_ptr() hash_for_piece() *****\n-char const* hash_for_piece_ptr (piece_index_t const index) const;\n-sha1_hash hash_for_piece (piece_index_t index) const;\n-hash_for_piece() takes a piece-index and returns the 20-bytes sha1-hash for\n-that piece and info_hash() returns the 20-bytes sha1-hash for the info-section\n-of the torrent file. hash_for_piece_ptr() returns a pointer to the 20 byte sha1\n-digest for the piece. Note that the string is not 0-terminated.\n+***** dht_get_peers() dht_announce() *****\n+void dht_announce (sha1_hash const& info_hash, int port = 0, dht::\n+announce_flags_t flags = {});\n+void dht_get_peers (sha1_hash const& info_hash);\n+dht_get_peers() will issue a DHT get_peer request to the DHT for the specified\n+info-hash. The response (the peers) will be posted back in a\n+dht_get_peers_reply_alert.\n+dht_announce() will issue a DHT announce request to the DHT to the specified\n+info-hash, advertising the specified port. If the port is left at its default,\n+0, the port will be implied by the DHT message's source port (which may improve\n+connectivity through a NAT).\n+Both these functions are exposed for advanced custom use of the DHT. All\n+torrents eligible to be announce to the DHT will be automatically, by\n+libtorrent.\n+For possible flags, see announce_flags_t.\n [report_issue]\n-***** name() *****\n-const std::string& name () const;\n-name() returns the name of the torrent. name contains UTF-8 encoded string.\n+***** dht_live_nodes() *****\n+void dht_live_nodes (sha1_hash const& nid);\n+Retrieve all the live DHT (identified by nid) nodes. All the nodes id and\n+endpoint will be returned in the list of nodes in the alert\n+dht_live_nodes_alert. Since this alert is a response to an explicit call, it\n+will always be posted, regardless of the alert mask.\n [report_issue]\n-***** creation_date() *****\n-std::time_t creation_date () const;\n-creation_date() returns the creation date of the torrent as time_t (posix\n-time). If there's no time stamp in the torrent file, 0 is returned. .. posix\n-time: http://www.opengroup.org/onlinepubs/009695399/functions/time.html\n+***** dht_sample_infohashes() *****\n+void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n+Query the DHT node specified by ep to retrieve a sample of the info-hashes that\n+the node currently have in their storage. The target is included for iterative\n+lookups so that indexing nodes can perform a key space traversal with a single\n+RPC per node by adjusting the target value for each RPC. It has no effect on\n+the returned sample value. The result is posted as a\n+dht_sample_infohashes_alert.\n [report_issue]\n-***** creator() *****\n-const std::string& creator () const;\n-creator() returns the creator string in the torrent. If there is no creator\n-string it will return an empty string.\n+***** dht_direct_request() *****\n+void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t\n+userdata = {});\n+Send an arbitrary DHT request directly to the specified endpoint. This function\n+is intended for use by plugins. When a response is received or the request\n+times out, a dht_direct_response_alert will be posted with the response (if\n+any) and the userdata pointer passed in here. Since this alert is a response to\n+an explicit call, it will always be posted, regardless of the alert mask.\n [report_issue]\n-***** comment() *****\n-const std::string& comment () const;\n-comment() returns the comment associated with the torrent. If there's no\n-comment, it will return an empty string. comment contains UTF-8 encoded string.\n+***** add_extension() *****\n+void add_extension (std::shared_ptr ext);\n+void add_extension (std::function(\n+ torrent_handle const&, client_data_t)> ext);\n+This function adds an extension to this session. The argument is a function\n+object that is called with a torrent_handle and which should return a std::\n+shared_ptr. To write custom plugins, see libtorrent_plugins.\n+For the typical bittorrent client all of these extensions should be added. The\n+main plugins implemented in libtorrent are:\n+ uTorrent metadata\n+ Allows peers to download the metadata (.torrent files) from the swarm\n+ directly. Makes it possible to join a swarm with just a tracker and info-\n+ hash.\n+#include \n+ses.add_extension(<::create_ut_metadata_plugin);\n+ uTorrent peer exchange\n+ Exchanges peers between clients.\n+#include \n+ses.add_extension(<::create_ut_pex_plugin);\n+ smart ban plugin\n+ A plugin that, with a small overhead, can ban peers that sends bad data\n+ with very high accuracy. Should eliminate most problems on poisoned\n+ torrents.\n+#include \n+ses.add_extension(<::create_smart_ban_plugin);\n+ [report_issue]\n+***** get_ip_filter() set_ip_filter() *****\n+void set_ip_filter (ip_filter f);\n+ip_filter get_ip_filter () const;\n+Sets a filter that will be used to reject and accept incoming as well as\n+outgoing connections based on their originating ip address. The default filter\n+will allow connections to any ip address. To build a set of rules for which\n+addresses are accepted and not, see ip_filter.\n+Each time a peer is blocked because of the IP filter, a peer_blocked_alert is\n+generated. get_ip_filter() Returns the ip_filter currently in the session. See\n+ip_filter.\n [report_issue]\n-***** nodes() *****\n-std::vector> const& nodes () const;\n-If this torrent contains any DHT nodes, they are put in this vector in their\n-original form (host name and port number).\n+***** set_port_filter() *****\n+void set_port_filter (port_filter const& f);\n+apply port_filter f to incoming and outgoing peers. a port filter will reject\n+making outgoing peer connections to certain remote ports. The main intention is\n+to be able to avoid triggering certain anti-virus software by connecting to\n+SMTP, FTP ports.\n+ [report_issue]\n+***** listen_port() ssl_listen_port() is_listening() *****\n+unsigned short listen_port () const;\n+bool is_listening () const;\n+unsigned short ssl_listen_port () const;\n+is_listening() will tell you whether or not the session has successfully opened\n+a listening port. If it hasn't, this function will return false, and then you\n+can set a new settings_pack::listen_interfaces to try another interface and\n+port to bind to.\n+listen_port() returns the port we ended up listening on.\n+ [report_issue]\n+***** get_peer_class_filter() set_peer_class_filter() *****\n+ip_filter get_peer_class_filter () const;\n+void set_peer_class_filter (ip_filter const& f);\n+Sets the peer class filter for this session. All new peer connections will take\n+this into account and be added to the peer classes specified by this filter,\n+based on the peer's IP address.\n+The ip-filter essentially maps an IP -> uint32. Each bit in that 32 bit integer\n+represents a peer class. The least significant bit represents class 0, the next\n+bit class 1 and so on.\n+For more info, see ip_filter.\n+For example, to make all peers in the range 200.1.1.0 - 200.1.255.255 belong to\n+their own peer class, apply the following filter:\n+ip_filter f = ses.get_peer_class_filter();\n+peer_class_t my_class = ses.create_peer_class(\"200.1.x.x IP range\");\n+f.add_rule(make_address(\"200.1.1.0\"), make_address(\"200.1.255.255\")\n+ , 1 << static_cast(my_class));\n+ses.set_peer_class_filter(f);\n+This setting only applies to new connections, it won't affect existing peer\n+connections.\n+This function is limited to only peer class 0-31, since there are only 32 bits\n+in the IP range mapping. Only the set bits matter; no peer class will be\n+removed from a peer as a result of this call, peer classes are only added.\n+The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_filter are 32 bits.\n+The get_peer_class_filter() function returns the current filter.\n+For more information, see peer_classes.\n+ [report_issue]\n+***** set_peer_class_type_filter() get_peer_class_type_filter() *****\n+void set_peer_class_type_filter (peer_class_type_filter const& f);\n+peer_class_type_filter get_peer_class_type_filter () const;\n+Sets and gets the peer class type filter. This is controls automatic peer class\n+assignments to peers based on what kind of socket it is.\n+It does not only support assigning peer classes, it also supports removing peer\n+classes based on socket type.\n+The order of these rules being applied are:\n+ 1. peer-class IP filter\n+ 2. peer-class type filter, removing classes\n+ 3. peer-class type filter, adding classes\n+For more information, see peer_classes.\n [report_issue]\n-***** add_node() *****\n-void add_node (std::pair const& node);\n-This is used when creating torrent. Use this to add a known DHT node. It may be\n-used, by the client, to bootstrap into the DHT network.\n+***** create_peer_class() *****\n+peer_class_t create_peer_class (char const* name);\n+Creates a new peer class (see peer_classes) with the given name. The returned\n+integer is the new peer class identifier. Peer classes may have the same name,\n+so each invocation of this function creates a new class and returns a unique\n+identifier.\n+Identifiers are assigned from low numbers to higher. So if you plan on using\n+certain peer classes in a call to set_peer_class_filter(), make sure to create\n+those early on, to get low identifiers.\n+For more information on peer classes, see peer_classes.\n [report_issue]\n-***** parse_info_section() *****\n-bool parse_info_section (bdecode_node const& info, error_code& ec, int\n-max_pieces);\n-populates the torrent_info by providing just the info-dict buffer. This is used\n-when loading a torrent from a magnet link for instance, where we only have the\n-info-dict. The bdecode_node e points to a parsed info-dictionary. ec returns an\n-error code if something fails (typically if the info dictionary is malformed).\n-Themax_piecesparameter allows limiting the amount of memory dedicated to\n-loading the torrent, and fails for torrents that exceed the limit. To load\n-large torrents, this limit may also need to be raised in settings_pack::\n-max_piece_count and in calls to read_resume_data().\n+***** delete_peer_class() *****\n+void delete_peer_class (peer_class_t cid);\n+This call dereferences the reference count of the specified peer class. When\n+creating a peer class it's automatically referenced by 1. If you want to\n+recycle a peer class, you may call this function. You may only call this\n+function once per peer class you create. Calling it more than once for the same\n+class will lead to memory corruption.\n+Since peer classes are reference counted, this function will not remove the\n+peer class if it's still assigned to torrents or peers. It will however remove\n+it once the last peer and torrent drops their references to it.\n+There is no need to call this function for custom peer classes. All peer\n+classes will be properly destructed when the session object destructs.\n+For more information on peer classes, see peer_classes.\n+ [report_issue]\n+***** set_peer_class() get_peer_class() *****\n+peer_class_info get_peer_class (peer_class_t cid) const;\n+void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n+These functions queries information from a peer class and updates the\n+configuration of a peer class, respectively.\n+cid must refer to an existing peer class. If it does not, the return value of\n+get_peer_class() is undefined.\n+set_peer_class() sets all the information in the peer_class_info object in the\n+specified peer class. There is no option to only update a single property.\n+A peer or torrent belonging to more than one class, the highest priority among\n+any of its classes is the one that is taken into account.\n+For more information, see peer_classes.\n [report_issue]\n-***** info() *****\n-bdecode_node info (char const* key) const;\n-This function looks up keys from the info-dictionary of the loaded torrent\n-file. It can be used to access extension values put in the .torrent file. If\n-the specified key cannot be found, it returns nullptr.\n+***** remove_torrent() *****\n+void remove_torrent (const torrent_handle&, remove_flags_t = {});\n+remove_torrent() will close all peer connections associated with the torrent\n+and tell the tracker that we've stopped participating in the swarm. This\n+operation cannot fail. When it completes, you will receive a\n+torrent_removed_alert.\n+remove_torrent() is non-blocking, but will remove the torrent from the session\n+synchronously. Calling session_handle::add_torrent() immediately afterward with\n+the same torrent will succeed. Note that this creates a new handle which is not\n+equal to the removed one.\n+The optional second argument options can be used to delete all the files\n+downloaded by this torrent. To do so, pass in the value session_handle::\n+delete_files. Once the torrent is deleted, a torrent_deleted_alert is posted.\n+The torrent_handle remains valid for some time after remove_torrent() is\n+called. It will become invalid only after all libtorrent tasks (such as I/\n+O tasks) release their references to the torrent. Until this happens,\n+torrent_handle::is_valid() will return true, and other calls such as\n+torrent_handle::status() will succeed. Because of this, and because\n+remove_torrent() is non-blocking, the following sequence usually succeeds (does\n+not throw system_error): .. code:: c++\n+ session.remove_handle(handle); handle.save_resume_data();\n+Note that when a queued or downloading torrent is removed, its position in the\n+download queue is vacated and every subsequent torrent in the queue has their\n+queue positions updated. This can potentially cause a large state_update to be\n+posted. When removing all torrents, it is advised to remove them from the back\n+of the queue, to minimize the shifting.\n+ [report_issue]\n+***** apply_settings() get_settings() *****\n+settings_pack get_settings () const;\n+void apply_settings (settings_pack const&);\n+void apply_settings (settings_pack&&);\n+Applies the settings specified by the settings_pack s. This is an asynchronous\n+operation that will return immediately and actually apply the settings to the\n+main thread of libtorrent some time later.\n+ [report_issue]\n+***** pop_alerts() wait_for_alert() set_alert_notify() *****\n+alert* wait_for_alert (time_duration max_wait);\n+void pop_alerts (std::vector* alerts);\n+void set_alert_notify (std::function const& fun);\n+Alerts is the main mechanism for libtorrent to report errors and events.\n+pop_alerts fills in the vector passed to it with pointers to new alerts. The\n+session still owns these alerts and they will stay valid until the next time\n+pop_alerts is called. You may not delete the alert objects.\n+It is safe to call pop_alerts from multiple different threads, as long as the\n+alerts themselves are not accessed once another thread calls pop_alerts. Doing\n+this requires manual synchronization between the popping threads.\n+wait_for_alert will block the current thread for max_wait time duration, or\n+until another alert is posted. If an alert is available at the time of the\n+call, it returns immediately. The returned alert pointer is the head of the\n+alert queue. wait_for_alert does not pop alerts from the queue, it merely peeks\n+at it. The returned alert will stay valid until pop_alerts is called twice. The\n+first time will pop it and the second will free it.\n+If there is no alert in the queue and no alert arrives within the specified\n+timeout, wait_for_alert returns nullptr.\n+In the python binding, wait_for_alert takes the number of milliseconds to wait\n+as an integer.\n+The alert queue in the session will not grow indefinitely. Make sure to pop\n+periodically to not miss notifications. To control the max number of alerts\n+that's queued by the session, see settings_pack::alert_queue_size.\n+Some alerts are considered so important that they are posted even when the\n+alert queue is full. Some alerts are considered mandatory and cannot be\n+disabled by the alert_mask. For instance, save_resume_data_alert and\n+save_resume_data_failed_alert are always posted, regardless of the alert mask.\n+To control which alerts are posted, set the alert_mask (settings_pack::\n+alert_mask).\n+If the alert queue fills up to the point where alerts are dropped, this will be\n+indicated by a alerts_dropped_alert, which contains a bitmask of which types of\n+alerts were dropped. Generally it is a good idea to make sure the alert queue\n+is large enough, the alert_mask doesn't have unnecessary categories enabled and\n+to call pop_alert() frequently, to avoid alerts being dropped.\n+the set_alert_notify function lets the client set a function object to be\n+invoked every time the alert queue goes from having 0 alerts to 1 alert. This\n+function is called from within libtorrent, it may be the main thread, or it may\n+be from within a user call. The intention of of the function is that the client\n+wakes up its main thread, to poll for more alerts using pop_alerts(). If the\n+notify function fails to do so, it won't be called again, until pop_alerts is\n+called for some other reason. For instance, it could signal an eventfd, post a\n+message to an HWND or some other main message pump. The actual retrieval of\n+alerts should not be done in the callback. In fact, the callback should not\n+block. It should not perform any expensive work. It really should just notify\n+the main application thread.\n+The type of an alert is returned by the polymorphic function alert::type() but\n+can also be queries from a concrete type via T::alert_type, as a static\n+constant.\n+ [report_issue]\n+***** add_port_mapping() delete_port_mapping() *****\n+std::vector add_port_mapping (portmap_protocol t, int\n+external_port, int local_port);\n+void delete_port_mapping (port_mapping_t handle);\n+add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n+whichever is enabled. A mapping is created for each listen socket in the\n+session. The return values are all handles referring to the port mappings that\n+were just created. Pass them to delete_port_mapping() to remove them.\n [report_issue]\n-***** info_section() *****\n-span info_section () const;\n-returns a the raw info section of the torrent file. The underlying buffer is\n-still owned by the torrent_info object\n+***** reopen_network_sockets() *****\n+void reopen_network_sockets (reopen_network_flags_t options =\n+reopen_map_ports);\n+Instructs the session to reopen all listen and outgoing sockets.\n+It's useful in the case your platform doesn't support the built in IP notifier\n+mechanism, or if you have a better more reliable way to detect changes in the\n+IP routing table.\n [report_issue]\n-***** piece_layer() *****\n-span piece_layer (file_index_t) const;\n-return the bytes of the piece layer hashes for the specified file. If the file\n-doesn't have a piece layer, an empty span is returned. The span size is\n-divisible by 32, the size of a SHA-256 hash. If the size of the file is smaller\n-than or equal to the piece size, the files \"root hash\" is the hash of the file\n-and is not saved separately in the \"piece layers\" field, but this function\n-still returns the root hash of the file in that case.\n+***** native_handle() *****\n+std::shared_ptr native_handle () const;\n+This function is intended only for use by plugins. This type does not have a\n+stable API and should be relied on as little as possible.\n [report_issue]\n-***** free_piece_layers() *****\n-void free_piece_layers ();\n-clears the piece layers from the torrent_info. This is done by the session when\n-a torrent is added, to avoid storing it twice. The piece layer (or other hashes\n-part of the merkle tree) are stored in the internal torrent object.\n+ save_settings\n+ saves settings (i.e. the settings_pack)\n [report_issue]\n-****** announce_infohash ******\n-Declared in \"libtorrent/announce_entry.hpp\"\n-struct announce_infohash\n-{\n- std::string message;\n- error_code last_error;\n- int scrape_incomplete = -1;\n- int scrape_complete = -1;\n- int scrape_downloaded = -1;\n- std::uint8_t fails : 7;\n- bool updating : 1;\n- bool start_sent : 1;\n- bool complete_sent : 1;\n-};\n+ save_dht_state\n+ saves dht state such as nodes and node-id, possibly accelerating joining\n+ the DHT if provided at next session startup.\n [report_issue]\n- message\n- if this tracker has returned an error or warning message that message is\n- stored here\n+ save_extension_state\n+ load or save state from plugins\n [report_issue]\n- last_error\n- if this tracker failed the last time it was contacted this error code\n- specifies what error occurred\n+ save_ip_filter\n+ load or save the IP filter set on the session\n [report_issue]\n- scrape_incomplete scrape_complete scrape_downloaded\n- if this tracker has returned scrape data, these fields are filled in with\n- valid numbers. Otherwise they are set to -1. incomplete counts the number\n- of current downloaders. complete counts the number of current peers\n- completed the download, or \"seeds\". downloaded is the cumulative number\n- of completed downloads.\n+ global_peer_class_id tcp_peer_class_id local_peer_class_id\n+ built-in peer classes\n [report_issue]\n- fails\n- the number of times in a row we have failed to announce to this tracker.\n+ delete_files\n+ delete the files belonging to the torrent from disk. including the part-\n+ file, if there is one\n [report_issue]\n- updating\n- true while we're waiting for a response from the tracker.\n+ delete_partfile\n+ delete just the part-file associated with this torrent\n [report_issue]\n- start_sent\n- set to true when we get a valid response from an announce with\n- event=started. If it is set, we won't send start in the subsequent\n- announces.\n+ paused\n+ when set, the session will start paused. Call session_handle::resume() to\n+ start\n+ [report_issue]\n+ udp tcp\n+ protocols used by add_port_mapping()\n [report_issue]\n- complete_sent\n- set to true when we send a event=completed.\n+ reopen_map_ports\n+ This option indicates if the ports are mapped using natpmp and upnp. If\n+ mapping was already made, they are deleted and added again. This only\n+ works if natpmp and/or upnp are configured to be enable.\n [report_issue]\n-****** announce_endpoint ******\n-Declared in \"libtorrent/announce_entry.hpp\"\n-announces are sent to each tracker using every listen socket this class holds\n-information about one listen socket for one tracker\n-struct announce_endpoint\n+****** session_proxy ******\n+Declared in \"libtorrent/session.hpp\"\n+this is a holder for the internal session implementation object. Once the\n+session destruction is explicitly initiated, this holder is used to synchronize\n+the completion of the shutdown. The lifetime of this object may outlive\n+session, causing the session destructor to not block. The session_proxy\n+destructor will block however, until the underlying session is done shutting\n+down.\n+struct session_proxy\n {\n- announce_endpoint ();\n-\n- tcp::endpoint local_endpoint;\n- aux::array info_hashes;\n- bool enabled = true;\n+ session_proxy (session_proxy&&) noexcept;\n+ session_proxy (session_proxy const&);\n+ session_proxy& operator= (session_proxy const&) &;\n+ session_proxy& operator= (session_proxy&&) & noexcept;\n+ session_proxy ();\n+ ~session_proxy ();\n };\n+ [report_issue]\n+***** session_proxy() ~session_proxy() operator=() *****\n+session_proxy (session_proxy&&) noexcept;\n+session_proxy (session_proxy const&);\n+session_proxy& operator= (session_proxy const&) &;\n+session_proxy& operator= (session_proxy&&) & noexcept;\n+session_proxy ();\n+~session_proxy ();\n+default constructor, does not refer to any session implementation object.\n [report_issue]\n- local_endpoint\n- the local endpoint of the listen interface associated with this endpoint\n+****** session ******\n+Declared in \"libtorrent/session.hpp\"\n+The session holds all state that spans multiple torrents. Among other things it\n+runs the network loop and manages all torrents. Once it's created, the session\n+object will spawn the main thread that will do all the work. The main thread\n+will be idle as long it doesn't have any torrents to participate in.\n+You have some control over session configuration through the session_handle::\n+apply_settings() member function. To change one or more configuration options,\n+create a settings_pack. object and fill it with the settings to be set and pass\n+it in to session::apply_settings().\n+see apply_settings().\n+struct session : session_handle\n+{\n+ explicit session (session_params&& params);\n+ session ();\n+ session (session_params const& params, session_flags_t flags);\n+ explicit session (session_params const& params);\n+ session (session_params&& params, session_flags_t flags);\n+ session (session_params&& params, io_context& ios);\n+ session (session_params&& params, io_context& ios, session_flags_t);\n+ session (session_params const& params, io_context& ios);\n+ session (session_params const& params, io_context& ios, session_flags_t);\n+ ~session ();\n+ session_proxy abort ();\n+};\n [report_issue]\n- info_hashes\n- info_hashes[0] is the v1 info hash (SHA1) info_hashes[1] is the v2 info\n- hash (truncated SHA-256)\n+***** session() *****\n+explicit session (session_params&& params);\n+session ();\n+session (session_params const& params, session_flags_t flags);\n+explicit session (session_params const& params);\n+session (session_params&& params, session_flags_t flags);\n+Constructs the session objects which acts as the container of torrents. In\n+order to avoid a race condition between starting the session and configuring\n+it, you can pass in a session_params object. Its settings will take effect\n+before the session starts up.\n+The overloads taking flags can be used to start a session in paused mode (by\n+passing in session::paused). Note that add_default_plugins do not have an\n+affect on constructors that take a session_params object. It already contains\n+the plugins to use.\n [report_issue]\n- enabled\n- set to false to not announce from this endpoint\n+***** session() *****\n+session (session_params&& params, io_context& ios);\n+session (session_params&& params, io_context& ios, session_flags_t);\n+session (session_params const& params, io_context& ios);\n+session (session_params const& params, io_context& ios, session_flags_t);\n+Overload of the constructor that takes an external io_context to run the\n+session object on. This is primarily useful for tests that may want to run\n+multiple sessions on a single io_context, or low resource systems where\n+additional threads are expensive and sharing an io_context with other events is\n+fine.\n+Warning\n+The session object does not cleanly terminate with an external io_context. The\n+io_context::run() call must have returned before it's safe to destruct the\n+session. Which means you MUST call session::abort() and save the session_proxy\n+first, then destruct the session object, then sync with the io_context, then\n+destruct the session_proxy object.\n [report_issue]\n-****** announce_entry ******\n-Declared in \"libtorrent/announce_entry.hpp\"\n-this class holds information about one bittorrent tracker, as it relates to a\n-specific torrent.\n-struct announce_entry\n+***** ~session() *****\n+~session ();\n+The destructor of session will notify all trackers that our torrents have been\n+shut down. If some trackers are down, they will time out. All this before the\n+destructor of session returns. So, it's advised that any kind of interface\n+(such as windows) are closed before destructing the session object. Because it\n+can take a few second for it to finish. The timeout can be set with\n+apply_settings().\n+[report_issue]\n+***** abort() *****\n+session_proxy abort ();\n+In case you want to destruct the session asynchronously, you can request a\n+session destruction proxy. If you don't do this, the destructor of the session\n+object will block while the trackers are contacted. If you keep one\n+session_proxy to the session when destructing it, the destructor will not\n+block, but start to close down the session, the destructor of the proxy will\n+then synchronize the threads. So, the destruction of the session is performed\n+from the session destructor call until the session_proxy destructor call. The\n+session_proxy does not have any operations on it (since the session is being\n+closed down, no operations are allowed on it). The only valid operation is\n+calling the destructor:\n+struct session_proxy {};\n+[report_issue]\n+****** session_params ******\n+Declared in \"libtorrent/session_params.hpp\"\n+The session_params is a parameters pack for configuring the session before it's\n+started.\n+struct session_params\n {\n- announce_entry ();\n- announce_entry& operator= (announce_entry const&) &;\n- ~announce_entry ();\n- explicit announce_entry (string_view u);\n- announce_entry (announce_entry const&);\n-\n- enum tracker_source\n- {\n- source_torrent,\n- source_client,\n- source_magnet_link,\n- source_tex,\n- };\n+ session_params (settings_pack&& sp);\n+ session_params ();\n+ session_params (settings_pack const& sp);\n+ session_params (settings_pack const& sp\n+ , std::vector> exts);\n+ session_params (settings_pack&& sp\n+ , std::vector> exts);\n \n- std::string url;\n- std::string trackerid;\n- std::vector endpoints;\n- std::uint8_t tier = 0;\n- std::uint8_t fail_limit = 0;\n- std::uint8_t source:4;\n- bool verified:1;\n+ settings_pack settings;\n+ std::vector> extensions;\n+ dht::dht_state dht_state;\n+ dht::dht_storage_constructor_type dht_storage_constructor;\n+ disk_io_constructor_type disk_io_constructor;\n+ std::map ext_state;\n+ libtorrent::ip_filter ip_filter;\n };\n- [report_issue]\n-***** announce_entry() operator=() ~announce_entry() *****\n-announce_entry ();\n-announce_entry& operator= (announce_entry const&) &;\n-~announce_entry ();\n-explicit announce_entry (string_view u);\n-announce_entry (announce_entry const&);\n-constructs a tracker announce entry with u as the URL.\n [report_issue]\n-***** enum tracker_source *****\n-Declared in \"libtorrent/announce_entry.hpp\"\n- ____________________________________________________________________________\n-|name______________|value|description________________________________________|\n-|source_torrent____|1____|the_tracker_was_part_of_the_.torrent_file__________|\n-|source_client |2 |the tracker was added programmatically via the |\n-|__________________|_____|add_tracker()_function_____________________________|\n-|source_magnet_link|4____|the_tracker_was_part_of_a_magnet_link______________|\n-|source_tex |8 |the tracker was received from the swarm via tracker|\n-|__________________|_____|exchange___________________________________________|\n+***** session_params() *****\n+session_params (settings_pack&& sp);\n+session_params ();\n+session_params (settings_pack const& sp);\n+This constructor can be used to start with the default plugins (ut_metadata,\n+ut_pex and smart_ban). Pass a settings_pack to set the initial settings when\n+the session starts.\n [report_issue]\n- url\n- tracker URL as it appeared in the torrent file\n+***** session_params() *****\n+session_params (settings_pack const& sp\n+ , std::vector> exts);\n+session_params (settings_pack&& sp\n+ , std::vector> exts);\n+This constructor helps to configure the set of initial plugins to be added to\n+the session before it's started.\n [report_issue]\n- trackerid\n- the current &trackerid= argument passed to the tracker. this is optional\n- and is normally empty (in which case no trackerid is sent).\n+ settings\n+ The settings to configure the session with\n [report_issue]\n- endpoints\n- each local listen socket (endpoint) will announce to the tracker. This\n- list contains state per endpoint.\n+ extensions\n+ the plugins to add to the session as it is constructed\n [report_issue]\n- tier\n- the tier this tracker belongs to\n+ dht_state\n+ DHT node ID and node addresses to bootstrap the DHT with.\n [report_issue]\n- fail_limit\n- the max number of failures to announce to this tracker in a row, before\n- this tracker is not used anymore. 0 means unlimited\n+ dht_storage_constructor\n+ function object to construct the storage object for DHT items.\n [report_issue]\n- source\n- a bitmask specifying which sources we got this tracker from.\n+ disk_io_constructor\n+ function object to create the disk I/O subsystem. Defaults to\n+ default_disk_io_constructor.\n [report_issue]\n- verified\n- set to true the first time we receive a valid response from this tracker.\n+ ext_state\n+ this container can be used by extensions/plugins to store settings. It's\n+ primarily here to make it convenient to save and restore state across\n+ sessions, using read_session_params() and write_session_params().\n+[report_issue]\n+ ip_filter\n+ the IP filter to use for the session. This restricts which peers are\n+ allowed to connect. As if passed to set_ip_filter().\n+ [report_issue]\n+****** write_session_params() write_session_params_buf() read_session_params()\n+******\n+Declared in \"libtorrent/session_params.hpp\"\n+entry write_session_params (session_params const& sp\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+session_params read_session_params (span buf\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+std::vector write_session_params_buf (session_params const& sp\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+session_params read_session_params (bdecode_node const& e\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+These functions serialize and de-serialize a session_params object to and from\n+bencoded form. The session_params object is used to initialize a new session\n+using the state from a previous one (or by programmatically configure the\n+session up-front). The flags parameter can be used to only save and load\n+certain aspects of the session's state. The _buf suffix indicates the function\n+operates on buffer rather than the bencoded structure. The torrents in a\n+session are not part of the session_params state, they have to be restored\n+separately.\n [report_issue]\n ****** block_info ******\n Declared in \"libtorrent/torrent_handle.hpp\"\n holds the state of a block in a piece. Who we requested it from and how far\n along we are at downloading it.\n struct block_info\n {\n@@ -6929,15 +6187,15 @@\n \n unsigned bytes_progress:15;\n unsigned block_size:15;\n unsigned state:2;\n unsigned num_peers:14;\n };\n [report_issue]\n-***** set_peer() peer() *****\n+***** peer() set_peer() *****\n void set_peer (tcp::endpoint const& ep);\n tcp::endpoint peer () const;\n The peer is the ip address of the peer this block was downloaded from.\n [report_issue]\n ***** enum block_state_t *****\n Declared in \"libtorrent/torrent_handle.hpp\"\n ___________________________________________________________________________\n@@ -7034,105 +6292,105 @@\n add_piece_flags_t flags = {}) const;\n void add_piece (piece_index_t piece, char const* data, add_piece_flags_t\n flags = {}) const;\n void read_piece (piece_index_t piece) const;\n bool have_piece (piece_index_t piece) const;\n void get_peer_info (std::vector& v) const;\n torrent_status status (status_flags_t flags = status_flags_t::all()) const;\n- std::vector get_download_queue () const;\n void get_download_queue (std::vector& queue) const;\n+ std::vector get_download_queue () const;\n void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t\n flags = {}) const;\n void reset_piece_deadline (piece_index_t index) const;\n void clear_piece_deadlines () const;\n- void file_progress (std::vector& progress,\n-file_progress_flags_t flags = {}) const;\n std::vector file_progress (file_progress_flags_t flags = {})\n const;\n+ void file_progress (std::vector& progress,\n+file_progress_flags_t flags = {}) const;\n std::vector file_status () const;\n void clear_error () const;\n- void add_tracker (announce_entry const&) const;\n- std::vector trackers () const;\n void replace_trackers (std::vector const&) const;\n+ std::vector trackers () const;\n+ void add_tracker (announce_entry const&) const;\n std::set url_seeds () const;\n void remove_url_seed (std::string const& url) const;\n void add_url_seed (std::string const& url) const;\n- std::set http_seeds () const;\n void remove_http_seed (std::string const& url) const;\n void add_http_seed (std::string const& url) const;\n+ std::set http_seeds () const;\n void add_extension (\n std::function(torrent_handle const&,\n client_data_t)> const& ext\n , client_data_t userdata = client_data_t{});\n bool set_metadata (span metadata) const;\n bool is_valid () const;\n void resume () const;\n void pause (pause_flags_t flags = {}) const;\n void set_flags (torrent_flags_t flags) const;\n void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n- void unset_flags (torrent_flags_t flags) const;\n torrent_flags_t flags () const;\n+ void unset_flags (torrent_flags_t flags) const;\n void flush_cache () const;\n void force_recheck () const;\n void save_resume_data (resume_data_flags_t flags = {}) const;\n bool need_save_resume_data () const;\n- void queue_position_bottom () const;\n- queue_position_t queue_position () const;\n void queue_position_down () const;\n void queue_position_top () const;\n+ queue_position_t queue_position () const;\n+ void queue_position_bottom () const;\n void queue_position_up () const;\n void queue_position_set (queue_position_t p) const;\n+ void set_ssl_certificate_buffer (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params);\n void set_ssl_certificate (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params\n , std::string const& passphrase = \"\");\n- void set_ssl_certificate_buffer (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params);\n- std::shared_ptr torrent_file_with_hashes () const;\n std::shared_ptr torrent_file () const;\n+ std::shared_ptr torrent_file_with_hashes () const;\n std::vector> piece_layers () const;\n void piece_availability (std::vector& avail) const;\n- download_priority_t piece_priority (piece_index_t index) const;\n+ void prioritize_pieces (std::vector const& pieces)\n+const;\n std::vector get_piece_priorities () const;\n void piece_priority (piece_index_t index, download_priority_t priority)\n const;\n- void prioritize_pieces (std::vector const& pieces)\n-const;\n void prioritize_pieces (std::vector> const& pieces) const;\n- download_priority_t file_priority (file_index_t index) const;\n+ download_priority_t piece_priority (piece_index_t index) const;\n void prioritize_files (std::vector const& files) const;\n+ download_priority_t file_priority (file_index_t index) const;\n std::vector get_file_priorities () const;\n void file_priority (file_index_t index, download_priority_t priority) const;\n- void force_lsd_announce () const;\n- void force_dht_announce () const;\n void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t =\n {}) const;\n+ void force_dht_announce () const;\n+ void force_lsd_announce () const;\n void scrape_tracker (int idx = -1) const;\n- int upload_limit () const;\n- void set_upload_limit (int limit) const;\n- void set_download_limit (int limit) const;\n int download_limit () const;\n+ void set_download_limit (int limit) const;\n+ void set_upload_limit (int limit) const;\n+ int upload_limit () const;\n void connect_peer (tcp::endpoint const& adr, peer_source_flags_t source = {}\n , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n void clear_peers ();\n int max_uploads () const;\n void set_max_uploads (int max_uploads) const;\n- void set_max_connections (int max_connections) const;\n int max_connections () const;\n+ void set_max_connections (int max_connections) const;\n void move_storage (std::string const& save_path\n , move_flags_t flags = move_flags_t::always_replace_files\n ) const;\n void rename_file (file_index_t index, std::string const& new_name) const;\n- info_hash_t info_hashes () const;\n sha1_hash info_hash () const;\n- bool operator!= (const torrent_handle& h) const;\n- bool operator== (const torrent_handle& h) const;\n+ info_hash_t info_hashes () const;\n bool operator< (const torrent_handle& h) const;\n+ bool operator== (const torrent_handle& h) const;\n+ bool operator!= (const torrent_handle& h) const;\n std::uint32_t id () const;\n std::shared_ptr native_handle () const;\n client_data_t userdata () const;\n bool in_session () const;\n \n static constexpr add_piece_flags_t overwrite_existing = 0_bit;\n static constexpr status_flags_t query_distributed_copies = 0_bit;\n@@ -7212,16 +6470,16 @@\n returned in the torrent_status. Some information in there is relatively\n expensive to calculate, and if you're not interested in it (and see performance\n issues), you can filter them out.\n By default everything is included. The flags you can use to decide what to\n include are defined in this class.\n [report_issue]\n ***** get_download_queue() *****\n-std::vector get_download_queue () const;\n void get_download_queue (std::vector& queue) const;\n+std::vector get_download_queue () const;\n get_download_queue() returns a vector with information about pieces that are\n partially downloaded or not downloaded but partially requested. See\n partial_piece_info for the fields in the returned vector.\n [report_issue]\n ***** reset_piece_deadline() set_piece_deadline() clear_piece_deadlines() *****\n void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t\n flags = {}) const;\n@@ -7239,18 +6497,18 @@\n deadline is the number of milliseconds until this piece should be completed.\n reset_piece_deadline removes the deadline from the piece. If it hasn't already\n been downloaded, it will no longer be considered a priority.\n clear_piece_deadlines() removes deadlines on all pieces in the torrent. As if\n reset_piece_deadline() was called on all pieces.\n [report_issue]\n ***** file_progress() *****\n-void file_progress (std::vector& progress, file_progress_flags_t\n-flags = {}) const;\n std::vector file_progress (file_progress_flags_t flags = {})\n const;\n+void file_progress (std::vector& progress, file_progress_flags_t\n+flags = {}) const;\n This function fills in the supplied vector, or returns a vector, with the\n number of bytes downloaded of each file in this torrent. The progress values\n are ordered the same as the files in the torrent_info.\n This operation is not very cheap. Its complexity is O(n + mj). Where n is the\n number of files, m is the number of currently downloading pieces and j is the\n number of blocks in a piece.\n The flags parameter can be used to specify the granularity of the file\n@@ -7271,48 +6529,48 @@\n See open_file_state\n [report_issue]\n ***** clear_error() *****\n void clear_error () const;\n If the torrent is in an error state (i.e. torrent_status::error is non-empty),\n this will clear the error and start the torrent again.\n [report_issue]\n-***** trackers() replace_trackers() add_tracker() *****\n-void add_tracker (announce_entry const&) const;\n-std::vector trackers () const;\n+***** trackers() add_tracker() replace_trackers() *****\n void replace_trackers (std::vector const&) const;\n+std::vector trackers () const;\n+void add_tracker (announce_entry const&) const;\n trackers() will return the list of trackers for this torrent. The announce\n entry contains both a string url which specify the announce url for the tracker\n as well as an int tier, which is specifies the order in which this tracker is\n tried. If you want libtorrent to use another list of trackers for this torrent,\n you can use replace_trackers() which takes a list of the same form as the one\n returned from trackers() and will replace it. If you want an immediate effect,\n you have to call force_reannounce(). See announce_entry.\n add_tracker() will look if the specified tracker is already in the set. If it\n is, it doesn't do anything. If it's not in the current set of trackers, it will\n insert it in the tier specified in the announce_entry.\n The updated set of trackers will be saved in the resume data, and when a\n torrent is started with resume data, the trackers from the resume data will\n replace the original ones.\n [report_issue]\n-***** add_url_seed() url_seeds() remove_url_seed() *****\n+***** add_url_seed() remove_url_seed() url_seeds() *****\n std::set url_seeds () const;\n void remove_url_seed (std::string const& url) const;\n void add_url_seed (std::string const& url) const;\n add_url_seed() adds another url to the torrent's list of url seeds. If the\n given url already exists in that list, the call has no effect. The torrent will\n connect to the server and try to download pieces from it, unless it's paused,\n queued, checking or seeding. remove_url_seed() removes the given url if it\n exists already. url_seeds() return a set of the url seeds currently in this\n torrent. Note that URLs that fails may be removed automatically from the list.\n See http_seeding for more information.\n [report_issue]\n-***** add_http_seed() remove_http_seed() http_seeds() *****\n-std::set http_seeds () const;\n+***** http_seeds() add_http_seed() remove_http_seed() *****\n void remove_http_seed (std::string const& url) const;\n void add_http_seed (std::string const& url) const;\n+std::set http_seeds () const;\n These functions are identical as the *_url_seed() variants, but they operate on\n BEP_17 web seeds instead of BEP_19.\n See http_seeding for more information.\n [report_issue]\n ***** add_extension() *****\n void add_extension (\n std::function(torrent_handle const&,\n@@ -7363,16 +6621,16 @@\n make sense to pause an auto-managed torrent without making it not auto-managed\n first. Torrents are auto-managed by default when added to the session. For more\n information, see queuing.\n [report_issue]\n ***** unset_flags() set_flags() flags() *****\n void set_flags (torrent_flags_t flags) const;\n void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n-void unset_flags (torrent_flags_t flags) const;\n torrent_flags_t flags () const;\n+void unset_flags (torrent_flags_t flags) const;\n sets and gets the torrent state flags. See torrent_flags_t. The set_flags\n overload that take a mask will affect all flags part of the mask, and set their\n values to what the flags argument is set to. This allows clearing and setting\n flags in a single function call. The set_flags overload that just takes flags,\n sets all the specified flags and leave any other flags unchanged. unset_flags\n clears the specified flags, while leaving any other flags unchanged.\n Theseed_modeflag is special, it can only be cleared once the torrent has been\n@@ -7492,20 +6750,20 @@\n saving resume data periodically, it makes sense to skip any torrent which\n hasn't downloaded anything since the last time.\n Note\n A torrent's resume data is considered saved as soon as the\n save_resume_data_alert is posted. It is important to make sure this alert is\n received and handled in order for this function to be meaningful.\n [report_issue]\n-***** queue_position_up() queue_position_down() queue_position_bottom()\n-queue_position_top() queue_position() *****\n-void queue_position_bottom () const;\n-queue_position_t queue_position () const;\n+***** queue_position_top() queue_position_up() queue_position()\n+queue_position_bottom() queue_position_down() *****\n void queue_position_down () const;\n void queue_position_top () const;\n+queue_position_t queue_position () const;\n+void queue_position_bottom () const;\n void queue_position_up () const;\n Every torrent that is added is assigned a queue position exactly one greater\n than the greatest queue position of all existing torrents. Torrents that are\n being seeded have -1 as their queue position, since they're no longer in line\n to be downloaded.\n When a torrent is removed or turns into a seed, all torrents with greater queue\n positions have their positions decreased to fill in the space in the sequence.\n@@ -7521,21 +6779,21 @@\n ***** queue_position_set() *****\n void queue_position_set (queue_position_t p) const;\n updates the position in the queue for this torrent. The relative order of all\n other torrents remain intact but their numerical queue position shifts to make\n space for this torrent's new position\n [report_issue]\n ***** set_ssl_certificate() set_ssl_certificate_buffer() *****\n+void set_ssl_certificate_buffer (std::string const& certificate\n+ , std::string const& private_key\n+ , std::string const& dh_params);\n void set_ssl_certificate (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params\n , std::string const& passphrase = \"\");\n-void set_ssl_certificate_buffer (std::string const& certificate\n- , std::string const& private_key\n- , std::string const& dh_params);\n For SSL torrents, use this to specify a path to a .pem file to use as this\n client's certificate. The certificate must be signed by the certificate in the\n .torrent file to be valid.\n The set_ssl_certificate_buffer() overload takes the actual certificate, private\n key and DH params as strings, rather than paths to files.\n cert is a path to the (signed) certificate in .pem format corresponding to this\n torrent.\n@@ -7549,17 +6807,17 @@\n Note that when a torrent first starts up, and it needs a certificate, it will\n suspend connecting to any peers until it has one. It's typically desirable to\n resume the torrent after setting the SSL certificate.\n If you receive a torrent_need_cert_alert, you need to call this to provide a\n valid cert. If you don't have a cert you won't be allowed to connect to any\n peers.\n [report_issue]\n-***** torrent_file_with_hashes() torrent_file() *****\n-std::shared_ptr torrent_file_with_hashes () const;\n+***** torrent_file() torrent_file_with_hashes() *****\n std::shared_ptr torrent_file () const;\n+std::shared_ptr torrent_file_with_hashes () const;\n torrent_file() returns a pointer to the torrent_info object associated with\n this torrent. The torrent_info object may be a copy of the internal object. If\n the torrent doesn't have metadata, the pointer will not be initialized (i.e. a\n nullptr). The torrent may be in a state without metadata only if it was started\n without a .torrent file, e.g. by being added by magnet link.\n Note that the torrent_info object returned here may be a different instance\n than the one added to the session, with different attributes like piece layers,\n@@ -7594,21 +6852,21 @@\n Fills the specified std::vector with the availability for each piece in\n this torrent. libtorrent does not keep track of availability for seeds, so if\n the torrent is seeding the availability for all pieces is reported as 0.\n The piece availability is the number of peers that we are connected that has\n advertised having a particular piece. This is the information that libtorrent\n uses in order to prefer picking rare pieces.\n [report_issue]\n-***** piece_priority() get_piece_priorities() prioritize_pieces() *****\n-download_priority_t piece_priority (piece_index_t index) const;\n+***** prioritize_pieces() piece_priority() get_piece_priorities() *****\n+void prioritize_pieces (std::vector const& pieces) const;\n std::vector get_piece_priorities () const;\n void piece_priority (piece_index_t index, download_priority_t priority) const;\n-void prioritize_pieces (std::vector const& pieces) const;\n void prioritize_pieces (std::vector> const& pieces) const;\n+download_priority_t piece_priority (piece_index_t index) const;\n These functions are used to set and get the priority of individual pieces. By\n default all pieces have priority 4. That means that the random rarest first\n algorithm is effectively active for all pieces. You may however change the\n priority of individual pieces. There are 8 priority levels. 0 means not to\n download the piece at all. Otherwise, lower priority values means less likely\n to be picked. Piece priority takes precedence over piece availability. Every\n piece with priority 7 will be attempted to be picked before a priority 6 piece\n@@ -7628,17 +6886,17 @@\n where the piece index or priority is out of range, are not allowed.\n get_piece_priorities returns a vector with one element for each piece in the\n torrent. Each element is the current priority of that piece.\n It's possible to cancel the effect of file priorities by setting the priorities\n for the affected pieces. Care has to be taken when mixing usage of file- and\n piece priorities.\n [report_issue]\n-***** file_priority() get_file_priorities() prioritize_files() *****\n-download_priority_t file_priority (file_index_t index) const;\n+***** prioritize_files() get_file_priorities() file_priority() *****\n void prioritize_files (std::vector const& files) const;\n+download_priority_t file_priority (file_index_t index) const;\n std::vector get_file_priorities () const;\n void file_priority (file_index_t index, download_priority_t priority) const;\n index must be in the range [0, number_of_files).\n file_priority() queries or sets the priority of file index.\n prioritize_files() takes a vector that has at as many elements as there are\n files in the torrent. Each entry is the priority of that file. The function\n sets the priorities of all the pieces in the torrent based on the vector.\n@@ -7659,19 +6917,19 @@\n When combining file- and piece priorities, the resume file will record both.\n When loading the resume data, the file priorities will be applied first, then\n the piece priorities.\n Moving data from a file into the part file is currently not supported. If a\n file has its priority set to 0 after it has already been created, it will not\n be moved into the partfile.\n [report_issue]\n-***** force_dht_announce() force_reannounce() force_lsd_announce() *****\n-void force_lsd_announce () const;\n-void force_dht_announce () const;\n+***** force_lsd_announce() force_reannounce() force_dht_announce() *****\n void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {})\n const;\n+void force_dht_announce () const;\n+void force_lsd_announce () const;\n force_reannounce() will force this torrent to do another tracker request, to\n receive new peers. The seconds argument specifies how many seconds from now to\n issue the tracker announces.\n If the tracker's min_interval has not passed since the last announce, the\n forced announce will be scheduled to happen immediately as the min_interval\n expires. This is to honor trackers minimum re-announce interval settings.\n The tracker_index argument specifies which tracker to re-announce. If set to -\n@@ -7689,20 +6947,20 @@\n A scrape request queries the tracker for statistics such as total number of\n incomplete peers, complete peers, number of downloads etc.\n This request will specifically update the num_complete and num_incomplete\n fields in the torrent_status struct once it completes. When it completes, it\n will generate a scrape_reply_alert. If it fails, it will generate a\n scrape_failed_alert.\n [report_issue]\n-***** set_upload_limit() set_download_limit() download_limit() upload_limit()\n+***** set_download_limit() upload_limit() set_upload_limit() download_limit()\n *****\n-int upload_limit () const;\n-void set_upload_limit (int limit) const;\n-void set_download_limit (int limit) const;\n int download_limit () const;\n+void set_download_limit (int limit) const;\n+void set_upload_limit (int limit) const;\n+int upload_limit () const;\n set_upload_limit will limit the upload bandwidth used by this particular\n torrent to the limit you set. It is given as the number of bytes per second the\n torrent is allowed to upload. set_download_limit works the same way but for\n download bandwidth instead of upload bandwidth. Note that setting a higher\n limit on a torrent then the global limit (settings_pack::upload_rate_limit)\n will not override the global rate limit. The torrent can never upload more than\n the global rate limit.\n@@ -7734,17 +6992,17 @@\n void set_max_uploads (int max_uploads) const;\n set_max_uploads() sets the maximum number of peers that's unchoked at the same\n time on this torrent. If you set this to -1, there will be no limit. This\n defaults to infinite. The primary setting controlling this is the global\n unchoke slots limit, set by unchoke_slots_limit in settings_pack.\n max_uploads() returns the current settings.\n [report_issue]\n-***** set_max_connections() max_connections() *****\n-void set_max_connections (int max_connections) const;\n+***** max_connections() set_max_connections() *****\n int max_connections () const;\n+void set_max_connections (int max_connections) const;\n set_max_connections() sets the maximum number of connection this torrent will\n open. If all connections are used up, incoming connections may be refused or\n poor connections may be closed. This must be at least 2. The default is\n unlimited number of connections. If -1 is given to the function, it means\n unlimited. There is also a global limit of the number of connections, set by\n connections_limit in settings_pack.\n max_connections() returns the current settings.\n@@ -7794,27 +7052,27 @@\n [report_issue]\n ***** rename_file() *****\n void rename_file (file_index_t index, std::string const& new_name) const;\n Renames the file with the given index asynchronously. The rename operation is\n complete when either a file_renamed_alert or file_rename_failed_alert is\n posted.\n [report_issue]\n-***** info_hashes() info_hash() *****\n-info_hash_t info_hashes () const;\n+***** info_hash() info_hashes() *****\n sha1_hash info_hash () const;\n+info_hash_t info_hashes () const;\n returns the info-hash(es) of the torrent. If this handle is to a torrent that\n hasn't loaded yet (for instance by being added) by a URL, the returned value is\n undefined. The info_hash() returns the SHA-1 info-hash for v1 torrents and a\n truncated hash for v2 torrents. For the full v2 info-hash, use info_hashes()\n instead.\n [report_issue]\n-***** operator==() operator!=() operator<() *****\n-bool operator!= (const torrent_handle& h) const;\n-bool operator== (const torrent_handle& h) const;\n+***** operator<() operator==() operator!=() *****\n bool operator< (const torrent_handle& h) const;\n+bool operator== (const torrent_handle& h) const;\n+bool operator!= (const torrent_handle& h) const;\n comparison operators. The order of the torrents is unspecified but stable.\n [report_issue]\n ***** id() *****\n std::uint32_t id () const;\n returns a unique identifier for this torrent. It's not a dense index. It's not\n preserved across sessions.\n [report_issue]\n@@ -7920,486 +7178,14 @@\n by the tracker. If this flag is set, it will be ignored and the tracker\n is announced immediately.\n [report_issue]\n ****** hash_value() ******\n Declared in \"libtorrent/torrent_handle.hpp\"\n std::size_t hash_value (torrent_handle const& h);\n for std::hash (and to support using this type in unordered_map etc.)\n-[report_issue]\n-****** storage_params ******\n-Declared in \"libtorrent/storage_defs.hpp\"\n-a parameter pack used to construct the storage for a torrent, used in\n-disk_interface\n-struct storage_params\n-{\n- storage_params (file_storage const& f, file_storage const* mf\n- , std::string const& sp, storage_mode_t const sm\n- , aux::vector const& prio\n- , sha1_hash const& ih);\n-\n- file_storage const& files;\n- file_storage const* mapped_files = nullptr;\n- std::string const& path;\n- storage_mode_t mode {storage_mode_sparse};\n- aux::vector const& priorities;\n- sha1_hash info_hash;\n-};\n-[report_issue]\n-****** file_slice ******\n-Declared in \"libtorrent/file_storage.hpp\"\n-represents a window of a file in a torrent.\n-The file_index refers to the index of the file (in the torrent_info). To get\n-the path and filename, use file_path() and give the file_index as argument. The\n-offset is the byte offset in the file where the range starts, and size is the\n-number of bytes this range is. The size + offset will never be greater than the\n-file size.\n-struct file_slice\n-{\n- file_index_t file_index;\n- std::int64_t offset;\n- std::int64_t size;\n-};\n-[report_issue]\n- file_index\n- the index of the file\n-[report_issue]\n- offset\n- the offset from the start of the file, in bytes\n-[report_issue]\n- size\n- the size of the window, in bytes\n-[report_issue]\n-****** file_storage ******\n-Declared in \"libtorrent/file_storage.hpp\"\n-The file_storage class represents a file list and the piece size. Everything\n-necessary to interpret a regular bittorrent storage file structure.\n-class file_storage\n-{\n- bool is_valid () const;\n- void reserve (int num_files);\n- void add_file (std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void add_file (error_code& ec, std::string const& path, std::int64_t\n-file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void add_file_borrow (error_code& ec, string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void add_file_borrow (string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void rename_file (file_index_t index, std::string const& new_filename);\n- std::vector map_block (piece_index_t piece, std::int64_t offset\n- , std::int64_t size) const;\n- peer_request map_file (file_index_t file, std::int64_t offset, int size)\n-const;\n- int num_files () const noexcept;\n- file_index_t end_file () const noexcept;\n- index_range file_range () const noexcept;\n- std::int64_t total_size () const;\n- int num_pieces () const;\n- void set_num_pieces (int n);\n- piece_index_t end_piece () const;\n- piece_index_t last_piece () const;\n- index_range piece_range () const noexcept;\n- void set_piece_length (int l);\n- int piece_length () const;\n- int piece_size (piece_index_t index) const;\n- int piece_size2 (piece_index_t index) const;\n- int blocks_in_piece2 (piece_index_t index) const;\n- std::string const& name () const;\n- void set_name (std::string const& n);\n- void swap (file_storage& ti) noexcept;\n- void canonicalize ();\n- bool pad_file_at (file_index_t index) const;\n- sha1_hash hash (file_index_t index) const;\n- sha256_hash root (file_index_t index) const;\n- std::int64_t file_offset (file_index_t index) const;\n- std::int64_t file_size (file_index_t index) const;\n- std::time_t mtime (file_index_t index) const;\n- std::string file_path (file_index_t index, std::string const& save_path =\n-\"\") const;\n- string_view file_name (file_index_t index) const;\n- std::string symlink (file_index_t index) const;\n- char const* root_ptr (file_index_t const index) const;\n- index_range file_piece_range (file_index_t) const;\n- int file_num_blocks (file_index_t index) const;\n- int file_num_pieces (file_index_t index) const;\n- int file_first_piece_node (file_index_t index) const;\n- int file_first_block_node (file_index_t index) const;\n- std::uint32_t file_path_hash (file_index_t index, std::string const&\n-save_path) const;\n- void all_path_hashes (std::unordered_set& table) const;\n- file_flags_t file_flags (file_index_t index) const;\n- bool file_absolute_path (file_index_t index) const;\n- file_index_t file_index_at_piece (piece_index_t piece) const;\n- file_index_t file_index_at_offset (std::int64_t offset) const;\n- file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n- piece_index_t piece_index_at_file (file_index_t f) const;\n- void sanitize_symlinks ();\n- bool v2 () const;\n-\n- static constexpr file_flags_t flag_pad_file = 0_bit;\n- static constexpr file_flags_t flag_hidden = 1_bit;\n- static constexpr file_flags_t flag_executable = 2_bit;\n- static constexpr file_flags_t flag_symlink = 3_bit;\n-};\n-[report_issue]\n-***** is_valid() *****\n-bool is_valid () const;\n-returns true if the piece length has been initialized on the file_storage. This\n-is typically taken as a proxy of whether the file_storage as a whole is\n-initialized or not.\n-[report_issue]\n-***** reserve() *****\n-void reserve (int num_files);\n-allocates space for num_files in the internal file list. This can be used to\n-avoid reallocating the internal file list when the number of files to be added\n-is known up-front.\n- [report_issue]\n-***** add_file_borrow() add_file() *****\n-void add_file (std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-void add_file_borrow (error_code& ec, string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-void add_file_borrow (string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-Adds a file to the file storage. The add_file_borrow version expects that\n-filename is the file name (without a path) of the file that's being added. This\n-memory is borrowed, i.e. it is the caller's responsibility to make sure it\n-stays valid throughout the lifetime of this file_storage object or any copy of\n-it. The same thing applies to filehash, which is an optional pointer to a 20\n-byte binary SHA-1 hash of the file.\n-if filename is empty, the filename from path is used and not borrowed.\n-The path argument is the full path (in the torrent file) to the file to add.\n-Note that this is not supposed to be an absolute path, but it is expected to\n-include the name of the torrent as the first path element.\n-file_size is the size of the file in bytes.\n-The file_flags argument sets attributes on the file. The file attributes is an\n-extension and may not work in all bittorrent clients.\n-For possible file attributes, see file_storage::flags_t.\n-The mtime argument is optional and can be set to 0. If non-zero, it is the\n-posix time of the last modification time of this file.\n-symlink_path is the path the file is a symlink to. To make this a symlink you\n-also need to set the file_storage::flag_symlink file flag.\n-root_hash is an optional pointer to a 32 byte SHA-256 hash, being the merkle\n-tree root hash for this file. This is only used for v2 torrents. If the root\n-hash is specified for one file, it has to be specified for all, otherwise this\n-function will fail. Note that the buffer root_hash points to must out-live the\n-file_storage object, it will not be copied. This parameter is only used when\n-loading torrents, that already have their file hashes computed. When creating\n-torrents, the file hashes will be computed by the piece hashes.\n-If more files than one are added, certain restrictions to their paths apply. In\n-a multi-file file storage (torrent), all files must share the same root\n-directory.\n-That is, the first path element of all files must be the same. This shared path\n-element is also set to the name of the torrent. It can be changed by calling\n-set_name.\n-The overloads that take anerror_codereference will report failures via that\n-variable, otherwisesystem_erroris thrown.\n-[report_issue]\n-***** rename_file() *****\n-void rename_file (file_index_t index, std::string const& new_filename);\n-renames the file at index to new_filename. Keep in mind that filenames are\n-expected to be UTF-8 encoded.\n-[report_issue]\n-***** map_block() *****\n-std::vector map_block (piece_index_t piece, std::int64_t offset\n- , std::int64_t size) const;\n-returns a list of file_slice objects representing the portions of files the\n-specified piece index, byte offset and size range overlaps. this is the inverse\n-mapping of map_file().\n-Preconditions of this function is that the input range is within the torrents\n-address space. piece may not be negative and\n- piece * piece_size + offset + size\n-may not exceed the total size of the torrent.\n-[report_issue]\n-***** map_file() *****\n-peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n-returns a peer_request representing the piece index, byte offset and size the\n-specified file range overlaps. This is the inverse mapping over map_block().\n-Note that the peer_request return type is meant to hold bittorrent block\n-requests, which may not be larger than 16 kiB. Mapping a range larger than that\n-may return an overflown integer.\n-[report_issue]\n-***** num_files() *****\n-int num_files () const noexcept;\n-returns the number of files in the file_storage\n-[report_issue]\n-***** end_file() *****\n-file_index_t end_file () const noexcept;\n-returns the index of the one-past-end file in the file storage\n-[report_issue]\n-***** file_range() *****\n-index_range file_range () const noexcept;\n-returns an implementation-defined type that can be used as the container in a\n-range-for loop. Where the values are the indices of all files in the\n-file_storage.\n-[report_issue]\n-***** total_size() *****\n-std::int64_t total_size () const;\n-returns the total number of bytes all the files in this torrent spans\n- [report_issue]\n-***** num_pieces() set_num_pieces() *****\n-int num_pieces () const;\n-void set_num_pieces (int n);\n-set and get the number of pieces in the torrent\n-[report_issue]\n-***** end_piece() *****\n-piece_index_t end_piece () const;\n-returns the index of the one-past-end piece in the file storage\n-[report_issue]\n-***** last_piece() *****\n-piece_index_t last_piece () const;\n-returns the index of the last piece in the torrent. The last piece is special\n-in that it may be smaller than the other pieces (and the other pieces are all\n-the same size).\n-[report_issue]\n-***** piece_range() *****\n-index_range piece_range () const noexcept;\n-returns an implementation-defined type that can be used as the container in a\n-range-for loop. Where the values are the indices of all pieces in the\n-file_storage.\n- [report_issue]\n-***** piece_length() set_piece_length() *****\n-void set_piece_length (int l);\n-int piece_length () const;\n-set and get the size of each piece in this torrent. It must be a power of two\n-and at least 16 kiB.\n-[report_issue]\n-***** piece_size() *****\n-int piece_size (piece_index_t index) const;\n-returns the piece size of index. This will be the same as piece_length(),\n-except for the last piece, which may be shorter.\n-[report_issue]\n-***** piece_size2() *****\n-int piece_size2 (piece_index_t index) const;\n-Returns the size of the given piece. If the piece spans multiple files, only\n-the first file is considered part of the piece. This is used for v2 torrents,\n-where all files are piece aligned and padded. i.e. The pad files are not\n-considered part of the piece for this purpose.\n-[report_issue]\n-***** blocks_in_piece2() *****\n-int blocks_in_piece2 (piece_index_t index) const;\n-returns the number of blocks in the specified piece, for v2 torrents.\n- [report_issue]\n-***** name() set_name() *****\n-std::string const& name () const;\n-void set_name (std::string const& n);\n-set and get the name of this torrent. For multi-file torrents, this is also the\n-name of the root directory all the files are stored in.\n-[report_issue]\n-***** swap() *****\n-void swap (file_storage& ti) noexcept;\n-swap all content of this with ti.\n-[report_issue]\n-***** canonicalize() *****\n-void canonicalize ();\n-arrange files and padding to match the canonical form required by BEP 52\n- [report_issue]\n-***** pad_file_at() root() file_size() file_offset() hash() file_path() symlink\n-() mtime() file_name() root_ptr() *****\n-bool pad_file_at (file_index_t index) const;\n-sha1_hash hash (file_index_t index) const;\n-sha256_hash root (file_index_t index) const;\n-std::int64_t file_offset (file_index_t index) const;\n-std::int64_t file_size (file_index_t index) const;\n-std::time_t mtime (file_index_t index) const;\n-std::string file_path (file_index_t index, std::string const& save_path = \"\")\n-const;\n-string_view file_name (file_index_t index) const;\n-std::string symlink (file_index_t index) const;\n-char const* root_ptr (file_index_t const index) const;\n-These functions are used to query attributes of files at a given index.\n-The hash() is a SHA-1 hash of the file, or 0 if none was provided in the\n-torrent file. This can potentially be used to join a bittorrent network with\n-other file sharing networks.\n-root() returns the SHA-256 merkle tree root of the specified file, in case this\n-is a v2 torrent. Otherwise returns zeros. root_ptr() returns a pointer to the\n-SHA-256 merkle tree root hash for the specified file. The pointer points into\n-storage referred to when the file was added, it is not owned by this object.\n-Torrents that are not v2 torrents return nullptr.\n-The mtime() is the modification time is the posix time when a file was last\n-modified when the torrent was created, or 0 if it was not included in the\n-torrent file.\n-file_path() returns the full path to a file.\n-file_size() returns the size of a file.\n-pad_file_at() returns true if the file at the given index is a pad-file.\n-file_name() returns just the name of the file, whereas file_path() returns the\n-path (inside the torrent file) with the filename appended.\n-file_offset() returns the byte offset within the torrent file where this file\n-starts. It can be used to map the file to a piece index (given the piece size).\n- [report_issue]\n-***** file_num_pieces() file_num_blocks() file_piece_range() *****\n-index_range file_piece_range (file_index_t) const;\n-int file_num_blocks (file_index_t index) const;\n-int file_num_pieces (file_index_t index) const;\n-Returns the number of pieces or blocks the file atindexspans, under the\n-assumption that the file is aligned to the start of a piece. This is only\n-meaningful for v2 torrents, where files are guaranteed such alignment. These\n-numbers are used to size and navigate the merkle hash tree for each file.\n- [report_issue]\n-***** file_first_block_node() file_first_piece_node() *****\n-int file_first_piece_node (file_index_t index) const;\n-int file_first_block_node (file_index_t index) const;\n-index of first piece node in the merkle tree\n-[report_issue]\n-***** file_path_hash() *****\n-std::uint32_t file_path_hash (file_index_t index, std::string const& save_path)\n-const;\n-returns the crc32 hash of file_path(index)\n-[report_issue]\n-***** all_path_hashes() *****\n-void all_path_hashes (std::unordered_set& table) const;\n-this will add the CRC32 hash of all directory entries to the table. No filename\n-will be included, just directories. Every depth of directories are added\n-separately to allow test for collisions with files at all levels. i.e. if one\n-path in the torrent is foo/bar/baz, the CRC32 hashes for foo, foo/bar and foo/\n-bar/baz will be added to the set.\n-[report_issue]\n-***** file_flags() *****\n-file_flags_t file_flags (file_index_t index) const;\n-returns a bitmask of flags from file_flags_t that apply to file at index.\n-[report_issue]\n-***** file_absolute_path() *****\n-bool file_absolute_path (file_index_t index) const;\n-returns true if the file at the specified index has been renamed to have an\n-absolute path, i.e. is not anchored in the save path of the torrent.\n- [report_issue]\n-***** file_index_at_piece() file_index_at_offset() *****\n-file_index_t file_index_at_piece (piece_index_t piece) const;\n-file_index_t file_index_at_offset (std::int64_t offset) const;\n-returns the index of the file at the given offset in the torrent\n-[report_issue]\n-***** file_index_for_root() *****\n-file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n-finds the file with the given root hash and returns its index if there is no\n-file with the root hash, file_index_t{-1} is returned\n-[report_issue]\n-***** piece_index_at_file() *****\n-piece_index_t piece_index_at_file (file_index_t f) const;\n-returns the piece index the given file starts at\n-[report_issue]\n-***** sanitize_symlinks() *****\n-void sanitize_symlinks ();\n-validate any symlinks, to ensure they all point to other files or directories\n-inside this storage. Any invalid symlinks are updated to point to themselves.\n-[report_issue]\n-***** v2() *****\n-bool v2 () const;\n-returns true if this torrent contains v2 metadata.\n-[report_issue]\n- flag_pad_file\n- the file is a pad file. It's required to contain zeros at it will not be\n- saved to disk. Its purpose is to make the following file start on a piece\n- boundary.\n-[report_issue]\n- flag_hidden\n- this file has the hidden attribute set. This is primarily a windows\n- attribute\n-[report_issue]\n- flag_executable\n- this file has the executable attribute set.\n-[report_issue]\n- flag_symlink\n- this file is a symbolic link. It should have a link target string\n- associated with it.\n-[report_issue]\n-****** mmap_disk_io_constructor() ******\n-Declared in \"libtorrent/mmap_disk_io.hpp\"\n-std::unique_ptr mmap_disk_io_constructor (\n- io_context& ios, settings_interface const&, counters& cnt);\n-constructs a memory mapped file disk I/O object.\n-[report_issue]\n-****** default_disk_io_constructor() ******\n-Declared in \"libtorrent/session.hpp\"\n-std::unique_ptr default_disk_io_constructor (\n- io_context& ios, settings_interface const&, counters& cnt);\n-the constructor function for the default storage. On systems that support\n-memory mapped files (and a 64 bit address space) the memory mapped storage will\n-be constructed, otherwise the portable posix storage.\n-[report_issue]\n-****** disabled_disk_io_constructor() ******\n-Declared in \"libtorrent/disabled_disk_io.hpp\"\n-std::unique_ptr disabled_disk_io_constructor (\n- io_context& ios, settings_interface const&, counters& cnt);\n-creates a disk io object that discards all data written to it, and only returns\n-zero-buffers when read from. May be useful for testing and benchmarking.\n-[report_issue]\n-****** posix_disk_io_constructor() ******\n-Declared in \"libtorrent/posix_disk_io.hpp\"\n-std::unique_ptr posix_disk_io_constructor (\n- io_context& ios, settings_interface const&, counters& cnt);\n-this is a simple posix disk I/O back-end, used for systems that don't have a 64\n-bit virtual address space or don't support memory mapped files. It's\n-implemented using portable C file functions and is single-threaded.\n-[report_issue]\n-****** enum storage_mode_t ******\n-Declared in \"libtorrent/storage_defs.hpp\"\n- ___________________________________________________________________________\n-|name_________________|value|description____________________________________|\n-| | |All pieces will be written to their final |\n-| | |position, all files will be allocated in full |\n-|storage_mode_allocate|0 |when the torrent is first started. This mode |\n-| | |minimizes fragmentation but could be a costly |\n-|_____________________|_____|operation._____________________________________|\n-| | |All pieces will be written to the place where |\n-|storage_mode_sparse |1 |they belong and sparse files will be used. This|\n-|_____________________|_____|is_the_recommended,_and_default_mode.__________|\n-[report_issue]\n-****** enum status_t ******\n-Declared in \"libtorrent/storage_defs.hpp\"\n- ____________________________________________________________________________\n-|name____________|value|description__________________________________________|\n-|no_error________|0____|\u00a0___________________________________________________|\n-|fatal_disk_error|1____|\u00a0___________________________________________________|\n-|need_full_check_|2____|\u00a0___________________________________________________|\n-|file_exist______|3____|\u00a0___________________________________________________|\n-| | |this is not an enum value, but a flag that can be set|\n-| | |in the return from async_check_files, in case an |\n-|oversized_file |16 |existing file was found larger than specified in the |\n-| | |torrent. i.e. it has garbage at the end the status_t |\n-|________________|_____|field_is_used_for_this_to_preserve_ABI.______________|\n-[report_issue]\n-****** enum move_flags_t ******\n-Declared in \"libtorrent/storage_defs.hpp\"\n- ____________________________________________________________________________\n-|name________________|value|description______________________________________|\n-|always_replace_files|0 |replace any files in the destination when copying|\n-|____________________|_____|or_moving_the_storage____________________________|\n-| | |if any files that we want to copy exist in the |\n-| | |destination exist, fail the whole operation and |\n-| | |don't perform any copy or move. There is an |\n-|fail_if_exist |1 |inherent race condition in this mode. The files |\n-| | |are checked for existence before the operation |\n-| | |starts. In between the check and performing the |\n-| | |copy, the destination files may be created, in |\n-|____________________|_____|which_case_they_are_replaced.____________________|\n-|dont_replace |2 |if any file exist in the target, take those files|\n-|____________________|_____|instead_of_the_ones_we_may_have_in_the_source.___|\n This section describes the functions and classes that are used to create\n torrent files. It is a layered API with low level classes and higher level\n convenience functions. A torrent is created in 4 steps:\n 1. first the files that will be part of the torrent are determined.\n 2. the torrent properties are set, such as tracker url, web seeds, DHT nodes\n etc.\n 3. Read through all the files in the torrent, SHA-1 all the data and set the\n@@ -8436,35 +7222,35 @@\n Declared in \"libtorrent/create_torrent.hpp\"\n This class holds state for creating a torrent. After having added all\n information to it, call create_torrent::generate() to generate the torrent. The\n entry that's returned can then be bencoded into a .torrent file using bencode\n ().\n struct create_torrent\n {\n- explicit create_torrent (torrent_info const& ti);\n explicit create_torrent (file_storage& fs, int piece_size = 0\n , create_flags_t flags = {});\n+ explicit create_torrent (torrent_info const& ti);\n std::vector generate_buf () const;\n entry generate () const;\n file_storage const& files () const;\n void set_comment (char const* str);\n void set_creator (char const* str);\n void set_creation_date (std::time_t timestamp);\n void set_hash (piece_index_t index, sha1_hash const& h);\n void set_hash2 (file_index_t file, piece_index_t::diff_type piece,\n sha256_hash const& h);\n- void add_url_seed (string_view url);\n void add_http_seed (string_view url);\n+ void add_url_seed (string_view url);\n void add_node (std::pair node);\n void add_tracker (string_view url, int tier = 0);\n void set_root_cert (string_view cert);\n bool priv () const;\n void set_priv (bool p);\n- bool is_v1_only () const;\n bool is_v2_only () const;\n+ bool is_v1_only () const;\n int num_pieces () const;\n piece_index_t end_piece () const;\n index_range piece_range () const noexcept;\n file_index_t end_file () const;\n index_range file_range () const noexcept;\n index_range file_piece_range (file_index_t f);\n std::int64_t total_size () const;\n@@ -8479,17 +7265,17 @@\n static constexpr create_flags_t v1_only = 6_bit;\n static constexpr create_flags_t canonical_files = 7_bit;\n static constexpr create_flags_t no_attributes = 8_bit;\n static constexpr create_flags_t canonical_files_no_tail_padding = 9_bit;\n };\n [report_issue]\n ***** create_torrent() *****\n-explicit create_torrent (torrent_info const& ti);\n explicit create_torrent (file_storage& fs, int piece_size = 0\n , create_flags_t flags = {});\n+explicit create_torrent (torrent_info const& ti);\n The piece_size is the size of each piece in bytes. It must be a power of 2 and\n a minimum of 16 kiB. If a piece size of 0 is specified, a piece_size will be\n set automatically.\n The flags arguments specifies options for the torrent creation. It can be any\n combination of the flags defined by create_flags_t.\n The file_storage (fs) parameter defines the files, sizes and their properties\n for the torrent to be created. Set this up first, before passing it to the\n@@ -8500,15 +7286,15 @@\n functions of create_torrent that affects the content of the info dictionary\n (such as set_hash()), will have any affect. Instead of using this overload,\n consider using write_torrent_file() instead.\n Warning\n The file_storage and torrent_info objects must stay alive for the entire\n duration of the create_torrent object.\n [report_issue]\n-***** generate() generate_buf() *****\n+***** generate_buf() generate() *****\n std::vector generate_buf () const;\n entry generate () const;\n This function will generate the .torrent file as a bencode tree, or a bencoded\n into a buffer. In order to encode the entry into a flat file, use the bencode()\n function.\n The function returning an entry may be useful to add custom entries to the\n torrent file before bencoding it and saving it to disk.\n@@ -8568,16 +7354,16 @@\n be powers-of-2, so all per-piece merkle trees are complete. A SHA-256 hash of\n all zeros is internally used to indicate a hash that has not been set. Setting\n such hash will not be considered set when calling generate(). This function\n will throw std::system_error if it is called on an object constructed with the\n v1_only flag.\n [report_issue]\n ***** add_url_seed() add_http_seed() *****\n-void add_url_seed (string_view url);\n void add_http_seed (string_view url);\n+void add_url_seed (string_view url);\n This adds a url seed to the torrent. You can have any number of url seeds. For\n a single file torrent, this should be an HTTP url, pointing to a file with\n identical content as the file of the torrent. For a multi-file torrent, it\n should point to a directory containing a directory with the same name as this\n torrent, and all the files of the torrent in it.\n The second function, add_http_seed() adds an HTTP seed instead.\n [report_issue]\n@@ -8632,15 +7418,15 @@\n for v2 and hybrid torrents only, the pieces in the specified file, specified as\n delta from the first piece in the file. i.e. the first index is 0.\n [report_issue]\n ***** total_size() *****\n std::int64_t total_size () const;\n the total number of bytes of all files and pad files\n [report_issue]\n-***** piece_length() piece_size() *****\n+***** piece_size() piece_length() *****\n int piece_length () const;\n int piece_size (piece_index_t i) const;\n piece_length() returns the piece size of all pieces but the last one.\n piece_size() returns the size of the specified piece. these functions are just\n forwarding to the associated file_storage.\n [report_issue]\n ***** add_similar_torrent() add_collection() *****\n@@ -8717,40 +7503,1868 @@\n directories are traversed.\n The \"..\" directory is never traversed.\n The flags argument should be the same as the flags passed to the create_torrent\n constructor.\n [report_issue]\n ****** set_piece_hashes() ******\n Declared in \"libtorrent/create_torrent.hpp\"\n+inline void set_piece_hashes (create_torrent& t, std::string const& p,\n+error_code& ec);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p\n+ , settings_interface const& settings\n+ , std::function const& f);\n void set_piece_hashes (create_torrent& t, std::string const& p\n , settings_interface const& settings, disk_io_constructor_type disk_io\n , std::function const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p);\n inline void set_piece_hashes (create_torrent& t, std::string const& p\n , std::function const& f);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p);\n void set_piece_hashes (create_torrent& t, std::string const& p\n , std::function const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n- , std::function const& f);\n void set_piece_hashes (create_torrent& t, std::string const& p\n , settings_interface const& settings\n , std::function const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p,\n-error_code& ec);\n This function will assume that the files added to the torrent file exists at\n path p, read those files and hash the content and set the hashes in the\n create_torrent object. The optional function f is called in between every hash\n that is set. f must have the following signature:\n void Fun(piece_index_t);\n The overloads taking a settings_pack may be used to configure the underlying\n disk access. Such as settings_pack::aio_threads.\n The overloads that don't take an error_code& may throw an exception in case of\n a file error, the other overloads sets the error code to reflect the error, if\n any.\n+[report_issue]\n+****** client_data_t ******\n+Declared in \"libtorrent/client_data.hpp\"\n+A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n+passed in to libtorrent and returned on demand. It adds type-safety by\n+requiring the same type be requested out of it as was assigned to it.\n+struct client_data_t\n+{\n+ client_data_t () = default;\n+ explicit client_data_t (T* v);\n+ client_data_t& operator= (T* v);\n+ T* get () const;\n+ explicit operator T () const;\n+ client_data_t& operator= (void const*) = delete;\n+ operator void const* () const = delete;\n+ operator void* () const = delete;\n+ client_data_t& operator= (void*) = delete;\n+\n+ template ::value>::type>\n+};\n+[report_issue]\n+***** client_data_t() *****\n+client_data_t () = default;\n+construct a nullptr client data\n+ [report_issue]\n+***** const*() operator=() void*() *****\n+client_data_t& operator= (void const*) = delete;\n+operator void const* () const = delete;\n+operator void* () const = delete;\n+client_data_t& operator= (void*) = delete;\n+we don't allow type-unsafe operations\n+[report_issue]\n+****** add_torrent_params ******\n+Declared in \"libtorrent/add_torrent_params.hpp\"\n+The add_torrent_params contains all the information in a .torrent file along\n+with all information necessary to add that torrent to a session. The key fields\n+when adding a torrent are:\n+ * ti - the immutable info-dict part of the torrent\n+ * info_hash - when you don't have the metadata (.torrent file). This\n+ uniquely identifies the torrent and can validate the info-dict when\n+ received from the swarm.\n+In order to add a torrent to a session, one of those fields must be set in\n+addition to save_path. The add_torrent_params object can then be passed into\n+one of the session::add_torrent() overloads or session::async_add_torrent().\n+If you only specify the info-hash, the torrent file will be downloaded from\n+peers, which requires them to support the metadata extension. For the metadata\n+extension to work, libtorrent must be built with extensions enabled\n+(TORRENT_DISABLE_EXTENSIONS must not be defined). It also takes an optional\n+name argument. This may be left empty in case no name should be assigned to the\n+torrent. In case it's not, the name is used for the torrent as long as it\n+doesn't have metadata. See torrent_handle::name.\n+The add_torrent_params is also used when requesting resume data for a torrent.\n+It can be saved to and restored from a file and added back to a new session.\n+For serialization and de-serialization of add_torrent_params objects, see\n+read_resume_data() and write_resume_data().\n+The add_torrent_params is also used to represent a parsed .torrent file. It can\n+be loaded via load_torrent_file(), load_torrent_buffer() and\n+load_torrent_parsed(). It can be saved via write_torrent_file().\n+struct add_torrent_params\n+{\n+ int version = LIBTORRENT_VERSION_NUM;\n+ std::shared_ptr ti;\n+ aux::noexcept_movable> trackers;\n+ aux::noexcept_movable> tracker_tiers;\n+ aux::noexcept_movable>> dht_nodes;\n+ std::string name;\n+ std::string save_path;\n+ storage_mode_t storage_mode = storage_mode_sparse;\n+ client_data_t userdata;\n+ aux::noexcept_movable> file_priorities;\n+ std::string trackerid;\n+ torrent_flags_t flags = torrent_flags::default_flags;\n+ info_hash_t info_hashes;\n+ int max_uploads = -1;\n+ int max_connections = -1;\n+ int upload_limit = -1;\n+ int download_limit = -1;\n+ std::int64_t total_uploaded = 0;\n+ std::int64_t total_downloaded = 0;\n+ int active_time = 0;\n+ int finished_time = 0;\n+ int seeding_time = 0;\n+ std::time_t added_time = 0;\n+ std::time_t completed_time = 0;\n+ std::time_t last_seen_complete = 0;\n+ int num_complete = -1;\n+ int num_incomplete = -1;\n+ int num_downloaded = -1;\n+ aux::noexcept_movable> http_seeds;\n+ aux::noexcept_movable> url_seeds;\n+ aux::noexcept_movable> peers;\n+ aux::noexcept_movable> banned_peers;\n+ aux::noexcept_movable> unfinished_pieces;\n+ typed_bitfield have_pieces;\n+ typed_bitfield verified_pieces;\n+ aux::noexcept_movable> piece_priorities;\n+ aux::vector, file_index_t> merkle_trees;\n+ aux::vector, file_index_t> merkle_tree_mask;\n+ aux::vector, file_index_t> verified_leaf_hashes;\n+ aux::noexcept_movable> renamed_files;\n+ std::time_t last_download = 0;\n+ std::time_t last_upload = 0;\n+};\n+[report_issue]\n+ version\n+ filled in by the constructor and should be left untouched. It is used for\n+ forward binary compatibility.\n+[report_issue]\n+ ti\n+ torrent_info object with the torrent to add. Unless the info_hash is set,\n+ this is required to be initialized.\n+[report_issue]\n+ trackers\n+ If the torrent doesn't have a tracker, but relies on the DHT to find\n+ peers, the trackers can specify tracker URLs for the torrent.\n+[report_issue]\n+ tracker_tiers\n+ the tiers the URLs in trackers belong to. Trackers belonging to different\n+ tiers may be treated differently, as defined by the multi tracker\n+ extension. This is optional, if not specified trackers are assumed to be\n+ part of tier 0, or whichever the last tier was as iterating over the\n+ trackers.\n+[report_issue]\n+ dht_nodes\n+ a list of hostname and port pairs, representing DHT nodes to be added to\n+ the session (if DHT is enabled). The hostname may be an IP address.\n+[report_issue]\n+ name\n+ in case there's no other name in this torrent, this name will be used.\n+ The name out of the torrent_info object takes precedence if available.\n+[report_issue]\n+ save_path\n+ the path where the torrent is or will be stored.\n+ Note\n+ On windows this path (and other paths) are interpreted as UNC paths. This\n+ means they must use backslashes as directory separators and may not\n+ contain the special directories \".\" or \"..\".\n+ Setting this to an absolute path performs slightly better than a relative\n+ path.\n+[report_issue]\n+ storage_mode\n+ One of the values from storage_mode_t. For more information, see storage\n+ allocation.\n+[report_issue]\n+ userdata\n+ The userdata parameter is optional and will be passed on to the extension\n+ constructor functions, if any (see torrent_handle::add_extension()). It\n+ will also be stored in the torrent object and can be retrieved by calling\n+ userdata().\n+[report_issue]\n+ file_priorities\n+ can be set to control the initial file priorities when adding a torrent.\n+ The semantics are the same as for torrent_handle::prioritize_files(). The\n+ file priorities specified in here take precedence over those specified in\n+ the resume data, if any. If this vector of file priorities is shorter\n+ than the number of files in the torrent, the remaining files (not covered\n+ by this) will still have the default download priority. This default can\n+ be changed by setting the default_dont_download torrent_flag.\n+[report_issue]\n+ trackerid\n+ the default tracker id to be used when announcing to trackers. By default\n+ this is empty, and no tracker ID is used, since this is an optional\n+ argument. If a tracker returns a tracker ID, that ID is used instead of\n+ this.\n+[report_issue]\n+ flags\n+ flags controlling aspects of this torrent and how it's added. See\n+ torrent_flags_t for details.\n+ Note\n+ The flags field is initialized with default flags by the constructor. In\n+ order to preserve default behavior when clearing or setting other flags,\n+ make sure to bitwise OR or in a flag or bitwise AND the inverse of a flag\n+ to clear it.\n+[report_issue]\n+ info_hashes\n+ set this to the info hash of the torrent to add in case the info-hash is\n+ the only known property of the torrent. i.e. you don't have a .torrent\n+ file nor a magnet link. To add a magnet link, use parse_magnet_uri() to\n+ populate fields in the add_torrent_params object.\n+ [report_issue]\n+ max_uploads max_connections\n+ max_uploads, max_connections, upload_limit, download_limit correspond to\n+ the set_max_uploads(), set_max_connections(), set_upload_limit() and\n+ set_download_limit() functions on torrent_handle. These values let you\n+ initialize these settings when the torrent is added, instead of calling\n+ these functions immediately following adding it.\n+ -1 means unlimited on these settings just like their counterpart\n+ functions on torrent_handle\n+ For fine grained control over rate limits, including making them apply to\n+ local peers, see peer_classes.\n+ [report_issue]\n+ upload_limit download_limit\n+ the upload and download rate limits for this torrent, specified in bytes\n+ per second. -1 means unlimited.\n+ [report_issue]\n+ total_uploaded total_downloaded\n+ the total number of bytes uploaded and downloaded by this torrent so far.\n+ [report_issue]\n+ active_time finished_time seeding_time\n+ the number of seconds this torrent has spent in started, finished and\n+ seeding state so far, respectively.\n+ [report_issue]\n+ added_time completed_time\n+ if set to a non-zero value, this is the posix time of when this torrent\n+ was first added, including previous runs/sessions. If set to zero, the\n+ internal added_time will be set to the time of when add_torrent() is\n+ called.\n+[report_issue]\n+ last_seen_complete\n+ if set to non-zero, initializes the time (expressed in posix time) when\n+ we last saw a seed or peers that together formed a complete copy of the\n+ torrent. If left set to zero, the internal counterpart to this field will\n+ be updated when we see a seed or a distributed copies >= 1.0.\n+ [report_issue]\n+ num_complete num_incomplete num_downloaded\n+ these field can be used to initialize the torrent's cached scrape data.\n+ The scrape data is high level metadata about the current state of the\n+ swarm, as returned by the tracker (either when announcing to it or by\n+ sending a specific scrape request). num_complete is the number of peers\n+ in the swarm that are seeds, or have every piece in the torrent.\n+ num_incomplete is the number of peers in the swarm that do not have every\n+ piece. num_downloaded is the number of times the torrent has been\n+ downloaded (not initiated, but the number of times a download has\n+ completed).\n+ Leaving any of these values set to -1 indicates we don't know, or we have\n+ not received any scrape data.\n+ [report_issue]\n+ http_seeds url_seeds\n+ URLs can be added to these two lists to specify additional web seeds to\n+ be used by the torrent. If the flag_override_web_seeds is set, these will\n+ be the _only_ ones to be used. i.e. any web seeds found in the .torrent\n+ file will be overridden.\n+ http_seeds expects URLs to web servers implementing the original HTTP\n+ seed specification BEP_17.\n+ url_seeds expects URLs to regular web servers, aka \"get right\" style,\n+ specified in BEP_19.\n+[report_issue]\n+ peers\n+ peers to add to the torrent, to be tried to be connected to as bittorrent\n+ peers.\n+[report_issue]\n+ banned_peers\n+ peers banned from this torrent. The will not be connected to\n+[report_issue]\n+ unfinished_pieces\n+ this is a map of partially downloaded piece. The key is the piece index\n+ and the value is a bitfield where each bit represents a 16 kiB block. A\n+ set bit means we have that block.\n+[report_issue]\n+ have_pieces\n+ this is a bitfield indicating which pieces we already have of this\n+ torrent.\n+[report_issue]\n+ verified_pieces\n+ when in seed_mode, pieces with a set bit in this bitfield have been\n+ verified to be valid. Other pieces will be verified the first time a peer\n+ requests it.\n+[report_issue]\n+ piece_priorities\n+ this sets the priorities for each individual piece in the torrent. Each\n+ element in the vector represent the piece with the same index. If you set\n+ both file- and piece priorities, file priorities will take precedence.\n+[report_issue]\n+ merkle_trees\n+ v2 hashes, if known\n+[report_issue]\n+ merkle_tree_mask\n+ if set, indicates which hashes are included in the corresponding vector\n+ of merkle_trees. These bitmasks always cover the full tree, a cleared bit\n+ means the hash is all zeros (i.e. not set) and set bit means the next\n+ hash in the corresponding vector in merkle_trees is the hash for that\n+ node. This is an optimization to avoid storing a lot of zeros.\n+[report_issue]\n+ verified_leaf_hashes\n+ bit-fields indicating which v2 leaf hashes have been verified against the\n+ root hash. If this vector is empty and merkle_trees is non-empty it\n+ implies that all hashes in merkle_trees are verified.\n+[report_issue]\n+ renamed_files\n+ this is a map of file indices in the torrent and new filenames to be\n+ applied before the torrent is added.\n+ [report_issue]\n+ last_download last_upload\n+ the posix time of the last time payload was received or sent for this\n+ torrent, respectively.\n+[report_issue]\n+****** storage_error ******\n+Declared in \"libtorrent/error_code.hpp\"\n+used by storage to return errors also includes which underlying file the error\n+happened on\n+struct storage_error\n+{\n+ explicit operator bool () const;\n+ file_index_t file () const;\n+ void file (file_index_t f);\n+\n+ error_code ec;\n+ operation_t operation;\n+};\n+[report_issue]\n+***** bool() *****\n+explicit operator bool () const;\n+explicitly converts to true if this object represents an error, and false if it\n+does not.\n+[report_issue]\n+***** file() *****\n+file_index_t file () const;\n+void file (file_index_t f);\n+set and query the index (in the torrent) of the file this error occurred on.\n+This may also have special values defined in torrent_status.\n+[report_issue]\n+ ec\n+ the error that occurred\n+[report_issue]\n+ operation\n+ A code from operation_t enum, indicating what kind of operation failed.\n+[report_issue]\n+****** i2p_category() ******\n+Declared in \"libtorrent/i2p_stream.hpp\"\n+boost::system::error_category& i2p_category ();\n+returns the error category for I2P errors\n+[report_issue]\n+****** libtorrent_category() ******\n+Declared in \"libtorrent/error_code.hpp\"\n+boost::system::error_category& libtorrent_category ();\n+return the instance of the libtorrent_error_category which maps libtorrent\n+error codes to human readable error messages.\n+[report_issue]\n+****** http_category() ******\n+Declared in \"libtorrent/error_code.hpp\"\n+boost::system::error_category& http_category ();\n+returns the error_category for HTTP errors\n+[report_issue]\n+****** bdecode_category() ******\n+Declared in \"libtorrent/bdecode.hpp\"\n+boost::system::error_category& bdecode_category ();\n+[report_issue]\n+****** gzip_category() ******\n+Declared in \"libtorrent/gzip.hpp\"\n+boost::system::error_category& gzip_category ();\n+get the error_category for zip errors\n+[report_issue]\n+****** pcp_category() ******\n+Declared in \"libtorrent/natpmp.hpp\"\n+boost::system::error_category& pcp_category ();\n+[report_issue]\n+****** socks_category() ******\n+Declared in \"libtorrent/socks5_stream.hpp\"\n+boost::system::error_category& socks_category ();\n+returns the error_category for SOCKS5 errors\n+[report_issue]\n+****** upnp_category() ******\n+Declared in \"libtorrent/upnp.hpp\"\n+boost::system::error_category& upnp_category ();\n+the boost.system error category for UPnP errors\n+[report_issue]\n+****** enum i2p_error_code ******\n+Declared in \"libtorrent/i2p_stream.hpp\"\n+ _________________________________\n+|name___________|value|description|\n+|no_error_______|0____|\u00a0_________|\n+|parse_failed___|1____|\u00a0_________|\n+|cant_reach_peer|2____|\u00a0_________|\n+|i2p_error______|3____|\u00a0_________|\n+|invalid_key____|4____|\u00a0_________|\n+|invalid_id_____|5____|\u00a0_________|\n+|timeout________|6____|\u00a0_________|\n+|key_not_found__|7____|\u00a0_________|\n+|duplicated_id__|8____|\u00a0_________|\n+|num_errors_____|9____|\u00a0_________|\n+[report_issue]\n+****** enum error_code_enum ******\n+Declared in \"libtorrent/error_code.hpp\"\n+ _____________________________________________________________________________\n+|name________________________________|value|description_______________________|\n+|no_error____________________________|0____|Not_an_error______________________|\n+|file_collision |1 |Two torrents has files which end |\n+|____________________________________|_____|up_overwriting_each_other_________|\n+|failed_hash_check |2 |A piece did not match its piece |\n+|____________________________________|_____|hash______________________________|\n+| | |The .torrent file does not contain|\n+|torrent_is_no_dict |3 |a bencoded dictionary at its top |\n+|____________________________________|_____|level_____________________________|\n+|torrent_missing_info |4 |The .torrent file does not have an|\n+|____________________________________|_____|info_dictionary___________________|\n+|torrent_info_no_dict |5 |The .torrent file's info entry is |\n+|____________________________________|_____|not_a_dictionary__________________|\n+|torrent_missing_piece_length |6 |The .torrent file does not have a |\n+|____________________________________|_____|piece_length_entry________________|\n+|torrent_missing_name |7 |The .torrent file does not have a |\n+|____________________________________|_____|name_entry________________________|\n+|torrent_invalid_name |8 |The .torrent file's name entry is |\n+|____________________________________|_____|invalid___________________________|\n+| | |The length of a file, or of the |\n+|torrent_invalid_length |9 |whole .torrent file is invalid. |\n+|____________________________________|_____|Either_negative_or_not_an_integer_|\n+|torrent_file_parse_failed |10 |Failed to parse a file entry in |\n+|____________________________________|_____|the_.torrent______________________|\n+|torrent_missing_pieces |11 |The pieces field is missing or |\n+|____________________________________|_____|invalid_in_the_.torrent_file______|\n+|torrent_invalid_hashes |12 |The pieces string has incorrect |\n+|____________________________________|_____|length____________________________|\n+|too_many_pieces_in_torrent |13 |The .torrent file has more pieces |\n+|____________________________________|_____|than_is_supported_by_libtorrent___|\n+| | |The metadata (.torrent file) that |\n+|invalid_swarm_metadata |14 |was received from the swarm |\n+| | |matched the info-hash, but failed |\n+|____________________________________|_____|to_be_parsed______________________|\n+|invalid_bencoding |15 |The file or buffer is not |\n+|____________________________________|_____|correctly_bencoded________________|\n+|no_files_in_torrent |16 |The .torrent file does not contain|\n+|____________________________________|_____|any_files_________________________|\n+|invalid_escaped_string |17 |The string was not properly url- |\n+|____________________________________|_____|encoded_as_expected_______________|\n+|session_is_closing |18 |Operation is not permitted since |\n+|____________________________________|_____|the_session_is_shutting_down______|\n+| | |There's already a torrent with |\n+|duplicate_torrent |19 |that info-hash added to the |\n+|____________________________________|_____|session___________________________|\n+|invalid_torrent_handle |20 |The supplied torrent_handle is not|\n+|____________________________________|_____|referring_to_a_valid_torrent______|\n+|invalid_entry_type |21 |The type requested from the entry |\n+|____________________________________|_____|did_not_match_its_type____________|\n+|missing_info_hash_in_uri |22 |The specified URI does not contain|\n+|____________________________________|_____|a_valid_info-hash_________________|\n+| | |One of the files in the torrent |\n+|file_too_short |23 |was unexpectedly small. This might|\n+| | |be caused by files being changed |\n+|____________________________________|_____|by_an_external_process____________|\n+| | |The URL used an unknown protocol. |\n+| | |Currently http and https (if built|\n+|unsupported_url_protocol |24 |with openssl support) are |\n+| | |recognized. For trackers udp is |\n+|____________________________________|_____|recognized_as_well._______________|\n+|url_parse_error |25 |The URL did not conform to URL |\n+|____________________________________|_____|syntax_and_failed_to_be_parsed____|\n+|peer_sent_empty_piece |26 |The peer sent a piece message of |\n+|____________________________________|_____|length_0__________________________|\n+|parse_failed |27 |A bencoded structure was corrupt |\n+|____________________________________|_____|and_failed_to_be_parsed___________|\n+|invalid_file_tag |28 |The fast resume file was missing |\n+|____________________________________|_____|or_had_an_invalid_file_version_tag|\n+|missing_info_hash |29 |The fast resume file was missing |\n+|____________________________________|_____|or_had_an_invalid_info-hash_______|\n+|mismatching_info_hash |30 |The info-hash did not match the |\n+|____________________________________|_____|torrent___________________________|\n+|invalid_hostname |31 |The URL contained an invalid |\n+|____________________________________|_____|hostname__________________________|\n+|invalid_port________________________|32___|The_URL_had_an_invalid_port_______|\n+| | |The port is blocked by the port- |\n+|port_blocked |33 |filter, and prevented the |\n+|____________________________________|_____|connection________________________|\n+|expected_close_bracket_in_address |34 |The IPv6 address was expected to |\n+|____________________________________|_____|end_with_\"]\"______________________|\n+| | |The torrent is being destructed, |\n+|destructing_torrent |35 |preventing the operation to |\n+|____________________________________|_____|succeed___________________________|\n+|timed_out___________________________|36___|The_connection_timed_out__________|\n+| | |The peer is upload only, and we |\n+|upload_upload_connection |37 |are upload only. There's no point |\n+|____________________________________|_____|in_keeping_the_connection_________|\n+| | |The peer is upload only, and we're|\n+|uninteresting_upload_peer |38 |not interested in it. There's no |\n+|____________________________________|_____|point_in_keeping_the_connection___|\n+|invalid_info_hash___________________|39___|The_peer_sent_an_unknown_info-hash|\n+|torrent_paused |40 |The torrent is paused, preventing |\n+|____________________________________|_____|the_operation_from_succeeding_____|\n+| | |The peer sent an invalid have |\n+|invalid_have |41 |message, either wrong size or |\n+| | |referring to a piece that doesn't |\n+|____________________________________|_____|exist_in_the_torrent______________|\n+|invalid_bitfield_size |42 |The bitfield message had the |\n+|____________________________________|_____|incorrect_size____________________|\n+| | |The peer kept requesting pieces |\n+|too_many_requests_when_choked |43 |after it was choked, possible |\n+|____________________________________|_____|abuse_attempt.____________________|\n+| | |The peer sent a piece message that|\n+|invalid_piece |44 |does not correspond to a piece |\n+|____________________________________|_____|request_sent_by_the_client________|\n+|no_memory___________________________|45___|memory_allocation_failed__________|\n+|torrent_aborted |46 |The torrent is aborted, preventing|\n+|____________________________________|_____|the_operation_to_succeed__________|\n+|self_connection |47 |The peer is a connection to |\n+|____________________________________|_____|ourself,_no_point_in_keeping_it___|\n+| | |The peer sent a piece message with|\n+|invalid_piece_size |48 |invalid size, either negative or |\n+|____________________________________|_____|greater_than_one_block____________|\n+| | |The peer has not been interesting |\n+|timed_out_no_interest |49 |or interested in us for too long, |\n+|____________________________________|_____|no_point_in_keeping_it_around_____|\n+|timed_out_inactivity |50 |The peer has not said anything in |\n+|____________________________________|_____|a_long_time,_possibly_dead________|\n+| | |The peer did not send a handshake |\n+|timed_out_no_handshake |51 |within a reasonable amount of |\n+| | |time, it might not be a bittorrent|\n+|____________________________________|_____|peer______________________________|\n+| | |The peer has been unchoked for too|\n+|timed_out_no_request |52 |long without requesting any data. |\n+| | |It might be lying about its |\n+|____________________________________|_____|interest_in_us____________________|\n+|invalid_choke |53 |The peer sent an invalid choke |\n+|____________________________________|_____|message___________________________|\n+|invalid_unchoke |54 |The peer send an invalid unchoke |\n+|____________________________________|_____|message___________________________|\n+|invalid_interested |55 |The peer sent an invalid |\n+|____________________________________|_____|interested_message________________|\n+|invalid_not_interested |56 |The peer sent an invalid not- |\n+|____________________________________|_____|interested_message________________|\n+|invalid_request |57 |The peer sent an invalid piece |\n+|____________________________________|_____|request_message___________________|\n+| | |The peer sent an invalid hash-list|\n+|invalid_hash_list |58 |message (this is part of the |\n+|____________________________________|_____|merkle-torrent_extension)_________|\n+| | |The peer sent an invalid hash- |\n+|invalid_hash_piece |59 |piece message (this is part of the|\n+|____________________________________|_____|merkle-torrent_extension)_________|\n+|invalid_cancel |60 |The peer sent an invalid cancel |\n+|____________________________________|_____|message___________________________|\n+|invalid_dht_port |61 |The peer sent an invalid DHT port-|\n+|____________________________________|_____|message___________________________|\n+|invalid_suggest |62 |The peer sent an invalid suggest |\n+|____________________________________|_____|piece-message_____________________|\n+|invalid_have_all |63 |The peer sent an invalid have all-|\n+|____________________________________|_____|message___________________________|\n+|invalid_have_none |64 |The peer sent an invalid have |\n+|____________________________________|_____|none-message______________________|\n+|invalid_reject |65 |The peer sent an invalid reject |\n+|____________________________________|_____|message___________________________|\n+|invalid_allow_fast |66 |The peer sent an invalid allow |\n+|____________________________________|_____|fast-message______________________|\n+|invalid_extended |67 |The peer sent an invalid extension|\n+|____________________________________|_____|message_ID________________________|\n+|invalid_message |68 |The peer sent an invalid message |\n+|____________________________________|_____|ID________________________________|\n+|sync_hash_not_found |69 |The synchronization hash was not |\n+|____________________________________|_____|found_in_the_encrypted_handshake__|\n+|invalid_encryption_constant |70 |The encryption constant in the |\n+|____________________________________|_____|handshake_is_invalid______________|\n+|no_plaintext_mode |71 |The peer does not support plain |\n+|____________________________________|_____|text,_which_is_the_selected_mode__|\n+|no_rc4_mode |72 |The peer does not support RC4, |\n+|____________________________________|_____|which_is_the_selected_mode________|\n+| | |The peer does not support any of |\n+|unsupported_encryption_mode |73 |the encryption modes that the |\n+|____________________________________|_____|client_supports___________________|\n+| | |The peer selected an encryption |\n+|unsupported_encryption_mode_selected|74 |mode that the client did not |\n+|____________________________________|_____|advertise_and_does_not_support____|\n+| | |The pad size used in the |\n+|invalid_pad_size |75 |encryption handshake is of invalid|\n+|____________________________________|_____|size______________________________|\n+|invalid_encrypt_handshake |76 |The encryption handshake is |\n+|____________________________________|_____|invalid___________________________|\n+| | |The client is set to not support |\n+|no_incoming_encrypted |77 |incoming encrypted connections and|\n+|____________________________________|_____|this_is_an_encrypted_connection___|\n+| | |The client is set to not support |\n+|no_incoming_regular |78 |incoming regular bittorrent |\n+| | |connections, and this is a regular|\n+|____________________________________|_____|connection________________________|\n+|duplicate_peer_id |79 |The client is already connected to|\n+|____________________________________|_____|this_peer-ID______________________|\n+|torrent_removed_____________________|80___|Torrent_was_removed_______________|\n+|packet_too_large |81 |The packet size exceeded the upper|\n+|____________________________________|_____|sanity_check-limit________________|\n+|reserved____________________________|82___|\u00a0________________________________|\n+|http_error |83 |The web server responded with an |\n+|____________________________________|_____|error_____________________________|\n+|missing_location |84 |The web server response is missing|\n+|____________________________________|_____|a_location_header_________________|\n+| | |The web seed redirected to a path |\n+|invalid_redirection |85 |that no longer matches the |\n+|____________________________________|_____|.torrent_directory_structure______|\n+|redirecting |86 |The connection was closed because |\n+|____________________________________|_____|it_redirected_to_a_different_URL__|\n+|invalid_range_______________________|87___|The_HTTP_range_header_is_invalid__|\n+|no_content_length |88 |The HTTP response did not have a |\n+|____________________________________|_____|content_length____________________|\n+|banned_by_ip_filter_________________|89___|The_IP_is_blocked_by_the_IP_filter|\n+|too_many_connections________________|90___|At_the_connection_limit___________|\n+|peer_banned_________________________|91___|The_peer_is_marked_as_banned______|\n+|stopping_torrent |92 |The torrent is stopping, causing |\n+|____________________________________|_____|the_operation_to_fail_____________|\n+|too_many_corrupt_pieces |93 |The peer has sent too many corrupt|\n+|____________________________________|_____|pieces_and_is_banned______________|\n+|torrent_not_ready |94 |The torrent is not ready to |\n+|____________________________________|_____|receive_peers_____________________|\n+|peer_not_constructed |95 |The peer is not completely |\n+|____________________________________|_____|constructed_yet___________________|\n+|session_closing |96 |The session is closing, causing |\n+|____________________________________|_____|the_operation_to_fail_____________|\n+| | |The peer was disconnected in order|\n+|optimistic_disconnect |97 |to leave room for a potentially |\n+|____________________________________|_____|better_peer_______________________|\n+|torrent_finished____________________|98___|The_torrent_is_finished___________|\n+|no_router___________________________|99___|No_UPnP_router_found______________|\n+|metadata_too_large |100 |The metadata message says the |\n+|____________________________________|_____|metadata_exceeds_the_limit________|\n+|invalid_metadata_request |101 |The peer sent an invalid metadata |\n+|____________________________________|_____|request_message___________________|\n+|invalid_metadata_size |102 |The peer advertised an invalid |\n+|____________________________________|_____|metadata_size_____________________|\n+|invalid_metadata_offset |103 |The peer sent a message with an |\n+|____________________________________|_____|invalid_metadata_offset___________|\n+|invalid_metadata_message |104 |The peer sent an invalid metadata |\n+|____________________________________|_____|message___________________________|\n+|pex_message_too_large |105 |The peer sent a peer exchange |\n+|____________________________________|_____|message_that_was_too_large________|\n+|invalid_pex_message |106 |The peer sent an invalid peer |\n+|____________________________________|_____|exchange_message__________________|\n+|invalid_lt_tracker_message |107 |The peer sent an invalid tracker |\n+|____________________________________|_____|exchange_message__________________|\n+| | |The peer sent an pex messages too |\n+|too_frequent_pex |108 |often. This is a possible attempt |\n+|____________________________________|_____|of_and_attack_____________________|\n+| | |The operation failed because it |\n+| | |requires the torrent to have the |\n+| | |metadata (.torrent file) and it |\n+|no_metadata |109 |doesn't have it yet. This happens |\n+| | |for magnet links before they have |\n+| | |downloaded the metadata, and also |\n+|____________________________________|_____|torrents_added_by_URL.____________|\n+| | |The peer sent an invalid dont_have|\n+| | |message. The don't have message is|\n+|invalid_dont_have |110 |an extension to allow peers to |\n+| | |advertise that the no longer has a|\n+|____________________________________|_____|piece_they_previously_had.________|\n+| | |The peer tried to connect to an |\n+|requires_ssl_connection |111 |SSL torrent without connecting |\n+|____________________________________|_____|over_SSL._________________________|\n+| | |The peer tried to connect to a |\n+|invalid_ssl_cert |112 |torrent with a certificate for a |\n+|____________________________________|_____|different_torrent.________________|\n+| | |the torrent is not an SSL torrent,|\n+|not_an_ssl_torrent |113 |and the operation requires an SSL |\n+|____________________________________|_____|torrent___________________________|\n+| | |peer was banned because its listen|\n+|banned_by_port_filter |114 |port is within a banned port |\n+| | |range, as specified by the |\n+|____________________________________|_____|port_filter.______________________|\n+|invalid_session_handle |115 |The session_handle is not |\n+|____________________________________|_____|referring_to_a_valid_session_impl_|\n+|invalid_listen_socket |116 |the listen socket associated with |\n+|____________________________________|_____|this_request_was_closed___________|\n+|invalid_hash_request________________|117__|\u00a0________________________________|\n+|invalid_hashes______________________|118__|\u00a0________________________________|\n+|invalid_hash_reject_________________|119__|\u00a0________________________________|\n+|deprecated_120______________________|120__|\u00a0________________________________|\n+|deprecated_121______________________|121__|\u00a0________________________________|\n+|deprecated_122______________________|122__|\u00a0________________________________|\n+|deprecated_123______________________|123__|\u00a0________________________________|\n+|deprecated_124______________________|124__|\u00a0________________________________|\n+|missing_file_sizes |130 |The resume data file is missing |\n+|____________________________________|_____|the_file_sizes_entry______________|\n+|no_files_in_resume_data |131 |The resume data file file sizes |\n+|____________________________________|_____|entry_is_empty____________________|\n+|missing_pieces |132 |The resume data file is missing |\n+|____________________________________|_____|the_pieces_and_slots_entry________|\n+| | |The number of files in the resume |\n+|mismatching_number_of_files |133 |data does not match the number of |\n+|____________________________________|_____|files_in_the_torrent______________|\n+| | |One of the files on disk has a |\n+|mismatching_file_size |134 |different size than in the fast |\n+|____________________________________|_____|resume_file_______________________|\n+| | |One of the files on disk has a |\n+|mismatching_file_timestamp |135 |different timestamp than in the |\n+|____________________________________|_____|fast_resume_file__________________|\n+|not_a_dictionary |136 |The resume data file is not a |\n+|____________________________________|_____|dictionary________________________|\n+|invalid_blocks_per_piece |137 |The blocks per piece entry is |\n+|____________________________________|_____|invalid_in_the_resume_data_file___|\n+| | |The resume file is missing the |\n+|missing_slots |138 |slots entry, which is required for|\n+| | |torrents with compact allocation. |\n+|____________________________________|_____|DEPRECATED________________________|\n+|too_many_slots |139 |The resume file contains more |\n+|____________________________________|_____|slots_than_the_torrent____________|\n+|invalid_slot_list |140 |The slot entry is invalid in the |\n+|____________________________________|_____|resume_data_______________________|\n+|invalid_piece_index |141 |One index in the slot list is |\n+|____________________________________|_____|invalid___________________________|\n+| | |The pieces on disk needs to be re-|\n+| | |ordered for the specified |\n+| | |allocation mode. This happens if |\n+|pieces_need_reorder |142 |you specify sparse allocation and |\n+| | |the files on disk are using |\n+| | |compact storage. The pieces needs |\n+| | |to be moved to their right |\n+|____________________________________|_____|position._DEPRECATED______________|\n+| | |this error is returned when asking|\n+| | |to save resume data and specifying|\n+|resume_data_not_modified |143 |the flag to only save when there's|\n+| | |anything new to save |\n+| | |(torrent_handle::only_if_modified)|\n+|____________________________________|_____|and_there_wasn't_anything_changed.|\n+|http_parse_error |150 |The HTTP header was not correctly |\n+|____________________________________|_____|formatted_________________________|\n+| | |The HTTP response was in the 300- |\n+|http_missing_location |151 |399 range but lacked a location |\n+|____________________________________|_____|header____________________________|\n+| | |The HTTP response was encoded with|\n+|http_failed_decompress |152 |gzip or deflate but decompressing |\n+|____________________________________|_____|it_failed_________________________|\n+|no_i2p_router |160 |The URL specified an i2p address, |\n+|____________________________________|_____|but_no_i2p_router_is_configured___|\n+|no_i2p_endpoint |161 |i2p acceptor is not available yet,|\n+|____________________________________|_____|can't_announce_without_endpoint___|\n+| | |The tracker URL doesn't support |\n+|scrape_not_available |170 |transforming it into a scrape URL.|\n+|____________________________________|_____|i.e._it_doesn't_contain_\"announce.|\n+|invalid_tracker_response____________|171__|invalid_tracker_response__________|\n+|invalid_peer_dict |172 |invalid peer dictionary entry. Not|\n+|____________________________________|_____|a_dictionary______________________|\n+|tracker_failure_____________________|173__|tracker_sent_a_failure_message____|\n+|invalid_files_entry_________________|174__|missing_or_invalid_files_entry____|\n+|invalid_hash_entry__________________|175__|missing_or_invalid_hash_entry_____|\n+|invalid_peers_entry |176 |missing or invalid peers and |\n+|____________________________________|_____|peers6_entry______________________|\n+|invalid_tracker_response_length |177 |UDP tracker response packet has |\n+|____________________________________|_____|invalid_size______________________|\n+|invalid_tracker_transaction_id |178 |invalid transaction id in UDP |\n+|____________________________________|_____|tracker_response__________________|\n+|invalid_tracker_action |179 |invalid action field in UDP |\n+|____________________________________|_____|tracker_response__________________|\n+| | |skipped announce (because it's |\n+|announce_skipped |180 |assumed to be unreachable over the|\n+|____________________________________|_____|given_source_network_interface)___|\n+|no_entropy__________________________|200__|random_number_generation_failed___|\n+|ssrf_mitigation_____________________|201__|blocked_by_SSRF_mitigation________|\n+|blocked_by_idna |202 |blocked because IDNA host names |\n+|____________________________________|_____|are_banned________________________|\n+|torrent_unknown_version |210 |the torrent file has an unknown |\n+|____________________________________|_____|meta_version______________________|\n+|torrent_missing_file_tree |211 |the v2 torrent file has no file |\n+|____________________________________|_____|tree______________________________|\n+|torrent_missing_meta_version |212 |the torrent contains v2 keys but |\n+|____________________________________|_____|does_not_specify_meta_version_2___|\n+|torrent_inconsistent_files |213 |the v1 and v2 file metadata does |\n+|____________________________________|_____|not_match_________________________|\n+|torrent_missing_piece_layer |214 |one or more files are missing |\n+|____________________________________|_____|piece_layer_hashes________________|\n+|torrent_invalid_piece_layer |215 |a piece layer has the wrong size |\n+|____________________________________|_____|or_failed_hash_check______________|\n+|torrent_missing_pieces_root_________|216__|a_v2_file_entry_has_no_root_hash__|\n+|torrent_inconsistent_hashes |217 |the v1 and v2 hashes do not |\n+|____________________________________|_____|describe_the_same_data____________|\n+|torrent_invalid_pad_file |218 |a file in the v2 metadata has the |\n+|____________________________________|_____|pad_attribute_set_________________|\n+|error_code_max______________________|219__|the_number_of_error_codes_________|\n+[report_issue]\n+****** enum http_errors ******\n+Declared in \"libtorrent/error_code.hpp\"\n+ _______________________________________\n+|name_________________|value|description|\n+|cont_________________|100__|\u00a0_________|\n+|ok___________________|200__|\u00a0_________|\n+|created______________|201__|\u00a0_________|\n+|accepted_____________|202__|\u00a0_________|\n+|no_content___________|204__|\u00a0_________|\n+|multiple_choices_____|300__|\u00a0_________|\n+|moved_permanently____|301__|\u00a0_________|\n+|moved_temporarily____|302__|\u00a0_________|\n+|not_modified_________|304__|\u00a0_________|\n+|bad_request__________|400__|\u00a0_________|\n+|unauthorized_________|401__|\u00a0_________|\n+|forbidden____________|403__|\u00a0_________|\n+|not_found____________|404__|\u00a0_________|\n+|internal_server_error|500__|\u00a0_________|\n+|not_implemented______|501__|\u00a0_________|\n+|bad_gateway__________|502__|\u00a0_________|\n+|service_unavailable__|503__|\u00a0_________|\n+[report_issue]\n+****** enum error_code_enum ******\n+Declared in \"libtorrent/bdecode.hpp\"\n+ ___________________________________________________________________________\n+|name__________|value|description___________________________________________|\n+|no_error______|0____|Not_an_error__________________________________________|\n+|expected_digit|1____|expected_digit_in_bencoded_string_____________________|\n+|expected_colon|2____|expected_colon_in_bencoded_string_____________________|\n+|unexpected_eof|3____|unexpected_end_of_file_in_bencoded_string_____________|\n+|expected_value|4 |expected value (list, dict, int or string) in bencoded|\n+|______________|_____|string________________________________________________|\n+|depth_exceeded|5____|bencoded_recursion_depth_limit_exceeded_______________|\n+|limit_exceeded|6____|bencoded_item_count_limit_exceeded____________________|\n+|overflow______|7____|integer_overflow______________________________________|\n+|error_code_max|8____|the_number_of_error_codes_____________________________|\n+[report_issue]\n+****** enum error_code_enum ******\n+Declared in \"libtorrent/gzip.hpp\"\n+ _____________________________________________________________________________\n+|name_______________________________|value|description________________________|\n+|no_error___________________________|0____|Not_an_error_______________________|\n+|invalid_gzip_header |1 |the supplied gzip buffer has |\n+|___________________________________|_____|invalid_header_____________________|\n+| | |the gzip buffer would inflate to |\n+|inflated_data_too_large |2 |more bytes than the specified |\n+|___________________________________|_____|maximum_size,_and_was_rejected.____|\n+|data_did_not_terminate |3 |available inflate data did not |\n+|___________________________________|_____|terminate__________________________|\n+|space_exhausted |4 |output space exhausted before |\n+|___________________________________|_____|completing_inflate_________________|\n+|invalid_block_type_________________|5____|invalid_block_type_(type_==_3)_____|\n+|invalid_stored_block_length |6 |stored block length did not match |\n+|___________________________________|_____|one's_complement___________________|\n+|too_many_length_or_distance_codes |7 |dynamic block code description: too|\n+|___________________________________|_____|many_length_or_distance_codes______|\n+|code_lengths_codes_incomplete |8 |dynamic block code description: |\n+|___________________________________|_____|code_lengths_codes_incomplete______|\n+|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\n+|___________________________________|_____|repeat_lengths_with_no_first_length|\n+|repeat_more_than_specified_lengths |10 |dynamic block code description: |\n+|___________________________________|_____|repeat_more_than_specified_lengths_|\n+|invalid_literal_length_code_lengths|11 |dynamic block code description: |\n+|___________________________________|_____|invalid_literal/length_code_lengths|\n+|invalid_distance_code_lengths |12 |dynamic block code description: |\n+|___________________________________|_____|invalid_distance_code_lengths______|\n+|invalid_literal_code_in_block |13 |invalid literal/length or distance |\n+|___________________________________|_____|code_in_fixed_or_dynamic_block_____|\n+|distance_too_far_back_in_block |14 |distance is too far back in fixed |\n+|___________________________________|_____|or_dynamic_block___________________|\n+|unknown_gzip_error |15 |an unknown error occurred during |\n+|___________________________________|_____|gzip_inflation_____________________|\n+|error_code_max_____________________|16___|the_number_of_error_codes__________|\n+[report_issue]\n+****** enum pcp_errors ******\n+Declared in \"libtorrent/natpmp.hpp\"\n+ _____________________________________________\n+|name_______________________|value|description|\n+|pcp_success________________|0____|\u00a0_________|\n+|pcp_unsupp_version_________|1____|\u00a0_________|\n+|pcp_not_authorized_________|2____|\u00a0_________|\n+|pcp_malformed_request______|3____|\u00a0_________|\n+|pcp_unsupp_opcode__________|4____|\u00a0_________|\n+|pcp_unsupp_option__________|5____|\u00a0_________|\n+|pcp_malformed_option_______|6____|\u00a0_________|\n+|pcp_network_failure________|7____|\u00a0_________|\n+|pcp_no_resources___________|8____|\u00a0_________|\n+|pcp_unsupp_protocol________|9____|\u00a0_________|\n+|pcp_user_ex_quota__________|10___|\u00a0_________|\n+|pcp_cannot_provide_external|11___|\u00a0_________|\n+|pcp_address_mismatch_______|12___|\u00a0_________|\n+|pcp_excessive_remote_peers_|13___|\u00a0_________|\n+[report_issue]\n+****** enum socks_error_code ******\n+Declared in \"libtorrent/socks5_stream.hpp\"\n+ ____________________________________________________\n+|name______________________________|value|description|\n+|no_error__________________________|0____|\u00a0_________|\n+|unsupported_version_______________|1____|\u00a0_________|\n+|unsupported_authentication_method_|2____|\u00a0_________|\n+|unsupported_authentication_version|3____|\u00a0_________|\n+|authentication_error______________|4____|\u00a0_________|\n+|username_required_________________|5____|\u00a0_________|\n+|general_failure___________________|6____|\u00a0_________|\n+|command_not_supported_____________|7____|\u00a0_________|\n+|no_identd_________________________|8____|\u00a0_________|\n+|identd_error______________________|9____|\u00a0_________|\n+|num_errors________________________|10___|\u00a0_________|\n+[report_issue]\n+****** enum error_code_enum ******\n+Declared in \"libtorrent/upnp.hpp\"\n+ _____________________________________________________________________________\n+|name______________________________|value|description_________________________|\n+|no_error__________________________|0____|No_error____________________________|\n+|invalid_argument |402 |One of the arguments in the request |\n+|__________________________________|_____|is_invalid__________________________|\n+|action_failed_____________________|501__|The_request_failed__________________|\n+|value_not_in_array |714 |The specified value does not exist |\n+|__________________________________|_____|in_the_array________________________|\n+| | |The source IP address cannot be |\n+|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |\n+|__________________________________|_____|specified___________________________|\n+|external_port_cannot_be_wildcarded|716 |The external port cannot be a |\n+|__________________________________|_____|wildcard,_but_must_be_specified_____|\n+| | |The port mapping entry specified |\n+|port_mapping_conflict |718 |conflicts with a mapping assigned |\n+|__________________________________|_____|previously_to_another_client________|\n+|internal_port_must_match_external |724 |Internal and external port value |\n+|__________________________________|_____|must_be_the_same____________________|\n+| | |The NAT implementation only supports|\n+|only_permanent_leases_supported |725 |permanent lease times on port |\n+|__________________________________|_____|mappings____________________________|\n+| | |RemoteHost must be a wildcard and |\n+|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |\n+|__________________________________|_____|DNS_name____________________________|\n+|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |\n+|__________________________________|_____|cannot_be_a_specific_port___________|\n+[report_issue]\n+****** web_seed_entry ******\n+Declared in \"libtorrent/torrent_info.hpp\"\n+the web_seed_entry holds information about a web seed (also known as URL seed\n+or HTTP seed). It is essentially a URL with some state associated with it. For\n+more information, see BEP_17 and BEP_19.\n+struct web_seed_entry\n+{\n+ bool operator== (web_seed_entry const& e) const;\n+ bool operator< (web_seed_entry const& e) const;\n+\n+ enum type_t\n+ {\n+ url_seed,\n+ http_seed,\n+ };\n+\n+ std::string url;\n+ std::string auth;\n+ headers_t extra_headers;\n+ std::uint8_t type;\n+};\n+[report_issue]\n+***** operator==() *****\n+bool operator== (web_seed_entry const& e) const;\n+URL and type comparison\n+[report_issue]\n+***** operator<() *****\n+bool operator< (web_seed_entry const& e) const;\n+URL and type less-than comparison\n+[report_issue]\n+***** enum type_t *****\n+Declared in \"libtorrent/torrent_info.hpp\"\n+ ___________________________\n+|name_____|value|description|\n+|url_seed_|0____|\u00a0_________|\n+|http_seed|1____|\u00a0_________|\n+[report_issue]\n+ url\n+ The URL of the web seed\n+[report_issue]\n+ auth\n+ Optional authentication. If this is set, it's passed in as HTTP basic\n+ auth to the web seed. The format is: username:password.\n+[report_issue]\n+ extra_headers\n+ Any extra HTTP headers that need to be passed to the web seed\n+[report_issue]\n+ type\n+ The type of web seed (see type_t)\n+[report_issue]\n+****** load_torrent_limits ******\n+Declared in \"libtorrent/torrent_info.hpp\"\n+this object holds configuration options for limits to use when loading\n+torrents. They are meant to prevent loading potentially malicious torrents that\n+cause excessive memory allocations.\n+struct load_torrent_limits\n+{\n+ int max_buffer_size = 10000000;\n+ int max_pieces = 0x200000;\n+ int max_decode_depth = 100;\n+ int max_decode_tokens = 3000000;\n+};\n+[report_issue]\n+ max_buffer_size\n+ the max size of a .torrent file to load into RAM\n+[report_issue]\n+ max_pieces\n+ the max number of pieces allowed in the torrent\n+[report_issue]\n+ max_decode_depth\n+ the max recursion depth in the bdecoded structure\n+[report_issue]\n+ max_decode_tokens\n+ the max number of bdecode tokens\n+[report_issue]\n+****** torrent_info ******\n+Declared in \"libtorrent/torrent_info.hpp\"\n+the torrent_info class holds the information found in a .torrent file.\n+class torrent_info\n+{\n+ torrent_info (char const* buffer, int size, error_code& ec);\n+ torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n+ torrent_info (torrent_info const& t);\n+ torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+ torrent_info (std::string const& filename, error_code& ec);\n+ torrent_info (span buffer, error_code& ec, from_span_t);\n+ torrent_info (span buffer, load_torrent_limits const& cfg,\n+from_span_t);\n+ explicit torrent_info (bdecode_node const& torrent_file);\n+ torrent_info (bdecode_node const& torrent_file, load_torrent_limits const&\n+cfg);\n+ explicit torrent_info (info_hash_t const& info_hash);\n+ explicit torrent_info (span buffer, from_span_t);\n+ torrent_info (char const* buffer, int size);\n+ explicit torrent_info (std::string const& filename);\n+ ~torrent_info ();\n+ file_storage const& orig_files () const;\n+ file_storage const& files () const;\n+ void rename_file (file_index_t index, std::string const& new_filename);\n+ void remap_files (file_storage const& f);\n+ void clear_trackers ();\n+ void add_tracker (std::string const& url, int tier\n+ , announce_entry::tracker_source source);\n+ void add_tracker (std::string const& url, int tier = 0);\n+ std::vector const& trackers () const;\n+ std::vector collections () const;\n+ std::vector similar_torrents () const;\n+ std::vector const& web_seeds () const;\n+ void add_url_seed (std::string const& url\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n+headers_t());\n+ void add_http_seed (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n+headers_t());\n+ void set_web_seeds (std::vector seeds);\n+ std::int64_t total_size () const;\n+ int piece_length () const;\n+ int num_pieces () const;\n+ piece_index_t end_piece () const;\n+ piece_index_t last_piece () const;\n+ index_range piece_range () const;\n+ info_hash_t const& info_hashes () const;\n+ sha1_hash info_hash () const noexcept;\n+ bool v2 () const;\n+ bool v1 () const;\n+ int num_files () const;\n+ std::vector map_block (piece_index_t const piece\n+ , std::int64_t offset, int size) const;\n+ peer_request map_file (file_index_t const file, std::int64_t offset, int\n+size) const;\n+ string_view ssl_cert () const;\n+ bool is_valid () const;\n+ bool priv () const;\n+ bool is_i2p () const;\n+ int piece_size (piece_index_t index) const;\n+ sha1_hash hash_for_piece (piece_index_t index) const;\n+ char const* hash_for_piece_ptr (piece_index_t const index) const;\n+ bool is_loaded () const;\n+ const std::string& name () const;\n+ std::time_t creation_date () const;\n+ const std::string& creator () const;\n+ const std::string& comment () const;\n+ std::vector> const& nodes () const;\n+ void add_node (std::pair const& node);\n+ bool parse_info_section (bdecode_node const& info, error_code& ec, int\n+max_pieces);\n+ bdecode_node info (char const* key) const;\n+ span info_section () const;\n+ span piece_layer (file_index_t) const;\n+ void free_piece_layers ();\n+};\n+[report_issue]\n+***** torrent_info() *****\n+torrent_info (char const* buffer, int size, error_code& ec);\n+torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n+torrent_info (torrent_info const& t);\n+torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+torrent_info (std::string const& filename, error_code& ec);\n+torrent_info (span buffer, error_code& ec, from_span_t);\n+torrent_info (span buffer, load_torrent_limits const& cfg,\n+from_span_t);\n+explicit torrent_info (bdecode_node const& torrent_file);\n+torrent_info (bdecode_node const& torrent_file, load_torrent_limits const&\n+cfg);\n+explicit torrent_info (info_hash_t const& info_hash);\n+explicit torrent_info (span buffer, from_span_t);\n+torrent_info (char const* buffer, int size);\n+explicit torrent_info (std::string const& filename);\n+The constructor that takes an info-hash will initialize the info-hash to the\n+given value, but leave all other fields empty. This is used internally when\n+downloading torrents without the metadata. The metadata will be created by\n+libtorrent as soon as it has been downloaded from the swarm.\n+The constructor that takes a bdecode_node will create a torrent_info object\n+from the information found in the given torrent_file. The bdecode_node\n+represents a tree node in an bencoded file. To load an ordinary .torrent file\n+into a bdecode_node, use bdecode().\n+The version that takes a buffer pointer and a size will decode it as a .torrent\n+file and initialize the torrent_info object for you.\n+The version that takes a filename will simply load the torrent file and decode\n+it inside the constructor, for convenience. This might not be the most suitable\n+for applications that want to be able to report detailed errors on what might\n+go wrong.\n+There is an upper limit on the size of the torrent file that will be loaded by\n+the overload taking a filename. If it's important that even very large torrent\n+files are loaded, use one of the other overloads.\n+The overloads that takes an error_code const& never throws if an error occur,\n+they will simply set the error code to describe what went wrong and not fully\n+initialize the torrent_info object. The overloads that do not take the extra\n+error_code parameter will always throw if an error occurs. These overloads are\n+not available when building without exception support.\n+The overload that takes a span also needs an extra parameter of type\n+from_span_t to disambiguate the std::string overload for string literals. There\n+is an object in the libtorrent namespace of this type called from_span.\n+[report_issue]\n+***** ~torrent_info() *****\n+~torrent_info ();\n+frees all storage associated with this torrent_info object\n+ [report_issue]\n+***** files() orig_files() *****\n+file_storage const& orig_files () const;\n+file_storage const& files () const;\n+The file_storage object contains the information on how to map the pieces to\n+files. It is separated from the torrent_info object because when creating\n+torrents a storage object needs to be created without having a torrent file.\n+When renaming files in a storage, the storage needs to make its own copy of the\n+file_storage in order to make its mapping differ from the one in the torrent\n+file.\n+orig_files() returns the original (unmodified) file storage for this torrent.\n+This is used by the web server connection, which needs to request files with\n+the original names. Filename may be changed using torrent_info::rename_file().\n+For more information on the file_storage object, see the separate document on\n+how to create torrents.\n+[report_issue]\n+***** rename_file() *****\n+void rename_file (file_index_t index, std::string const& new_filename);\n+Renames the file with the specified index to the new name. The new filename is\n+reflected by the file_storage returned by files() but not by the one returned\n+by orig_files().\n+If you want to rename the base name of the torrent (for a multi file torrent),\n+you can copy the file_storage (see files() and orig_files() ), change the name,\n+and then use remap_files().\n+The new_filename can both be a relative path, in which case the file name is\n+relative to the save_path of the torrent. If the new_filename is an absolute\n+path (i.e. is_complete(new_filename) == true), then the file is detached from\n+the save_path of the torrent. In this case the file is not moved when\n+move_storage() is invoked.\n+[report_issue]\n+***** remap_files() *****\n+void remap_files (file_storage const& f);\n+Warning\n+Usingremap_files()is discouraged as it's incompatible with v2 torrents. This is\n+because the piece boundaries and piece hashes in v2 torrents are intimately\n+tied to the file boundaries. Instead, just rename individual files, or\n+implement a custom disk_interface to customize how to store files.\n+Remaps the file storage to a new file layout. This can be used to, for\n+instance, download all data in a torrent to a single file, or to a number of\n+fixed size sector aligned files, regardless of the number and sizes of the\n+files in the torrent.\n+The new specified file_storage must have the exact same size as the current\n+one.\n+ [report_issue]\n+***** add_tracker() clear_trackers() trackers() *****\n+void clear_trackers ();\n+void add_tracker (std::string const& url, int tier\n+ , announce_entry::tracker_source source);\n+void add_tracker (std::string const& url, int tier = 0);\n+std::vector const& trackers () const;\n+add_tracker() adds a tracker to the announce-list. The tier determines the\n+order in which the trackers are to be tried. The trackers() function will\n+return a sorted vector of announce_entry. Each announce entry contains a\n+string, which is the tracker url, and a tier index. The tier index is the high-\n+level priority. No matter which trackers that works or not, the ones with lower\n+tier will always be tried before the one with higher tier number. For more\n+information, see announce_entry.\n+trackers() returns all entries from announce-list.\n+clear_trackers() removes all trackers from announce-list.\n+ [report_issue]\n+***** similar_torrents() collections() *****\n+std::vector collections () const;\n+std::vector similar_torrents () const;\n+These two functions are related to BEP_38 (mutable torrents). The vectors\n+returned from these correspond to the \"similar\" and \"collections\" keys in the\n+.torrent file. Both info-hashes and collections from within the info-dict and\n+from outside of it are included.\n+ [report_issue]\n+***** add_url_seed() set_web_seeds() add_http_seed() web_seeds() *****\n+std::vector const& web_seeds () const;\n+void add_url_seed (std::string const& url\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n+headers_t());\n+void add_http_seed (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n+headers_t());\n+void set_web_seeds (std::vector seeds);\n+web_seeds() returns all url seeds and http seeds in the torrent. Each entry is\n+a web_seed_entry and may refer to either a url seed or http seed.\n+add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n+set_web_seeds() replaces all web seeds with the ones specified in the seeds\n+vector.\n+The extern_auth argument can be used for other authorization schemes than basic\n+HTTP authorization. If set, it will override any username and password found in\n+the URL itself. The string will be sent as the HTTP authorization header's\n+value (without specifying \"Basic\").\n+The extra_headers argument defaults to an empty list, but can be used to insert\n+custom HTTP headers in the requests to a specific web seed.\n+See http_seeding for more information.\n+[report_issue]\n+***** total_size() *****\n+std::int64_t total_size () const;\n+total_size() returns the total number of bytes the torrent-file represents.\n+Note that this is the number of pieces times the piece size (modulo the last\n+piece possibly being smaller). With pad files, the total size will be larger\n+than the sum of all (regular) file sizes.\n+ [report_issue]\n+***** num_pieces() piece_length() *****\n+int piece_length () const;\n+int num_pieces () const;\n+piece_length() and num_pieces() returns the number of byte for each piece and\n+the total number of pieces, respectively. The difference between piece_size()\n+and piece_length() is that piece_size() takes the piece index as argument and\n+gives you the exact size of that piece. It will always be the same as\n+piece_length() except in the case of the last piece, which may be smaller.\n+ [report_issue]\n+***** piece_range() end_piece() last_piece() *****\n+piece_index_t end_piece () const;\n+piece_index_t last_piece () const;\n+index_range piece_range () const;\n+last_piece() returns the index to the last piece in the torrent and end_piece()\n+returns the index to the one-past-end piece in the torrent piece_range()\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all pieces in the\n+file_storage.\n+ [report_issue]\n+***** info_hash() info_hashes() *****\n+info_hash_t const& info_hashes () const;\n+sha1_hash info_hash () const noexcept;\n+returns the info-hash of the torrent. For BitTorrent v2 support, use\n+info_hashes() to get an object that may hold both a v1 and v2 info-hash\n+ [report_issue]\n+***** v2() v1() *****\n+bool v2 () const;\n+bool v1 () const;\n+returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n+torrents have both. These are shortcuts for info_hashes().has_v1() and\n+info_hashes().has_v2() calls.\n+[report_issue]\n+***** num_files() *****\n+int num_files () const;\n+If you need index-access to files you can use the num_files() along with the\n+file_path(), file_size()-family of functions to access files using indices.\n+[report_issue]\n+***** map_block() *****\n+std::vector map_block (piece_index_t const piece\n+ , std::int64_t offset, int size) const;\n+This function will map a piece index, a byte offset within that piece and a\n+size (in bytes) into the corresponding files with offsets where that data for\n+that piece is supposed to be stored. See file_slice.\n+[report_issue]\n+***** map_file() *****\n+peer_request map_file (file_index_t const file, std::int64_t offset, int size)\n+const;\n+This function will map a range in a specific file into a range in the torrent.\n+The file_offset parameter is the offset in the file, given in bytes, where 0 is\n+the start of the file. See peer_request.\n+The input range is assumed to be valid within the torrent. file_offset + size\n+is not allowed to be greater than the file size. file_index must refer to a\n+valid file, i.e. it cannot be >= num_files().\n+[report_issue]\n+***** ssl_cert() *****\n+string_view ssl_cert () const;\n+Returns the SSL root certificate for the torrent, if it is an SSL torrent.\n+Otherwise returns an empty string. The certificate is the public certificate in\n+x509 format.\n+[report_issue]\n+***** is_valid() *****\n+bool is_valid () const;\n+returns true if this torrent_info object has a torrent loaded. This is\n+primarily used to determine if a magnet link has had its metadata resolved yet\n+or not.\n+[report_issue]\n+***** priv() *****\n+bool priv () const;\n+returns true if this torrent is private. i.e., the client should not advertise\n+itself on the trackerless network (the Kademlia DHT) for this torrent.\n+[report_issue]\n+***** is_i2p() *****\n+bool is_i2p () const;\n+returns true if this is an i2p torrent. This is determined by whether or not it\n+has a tracker whose URL domain name ends with \".i2p\". i2p torrents disable the\n+DHT and local peer discovery as well as talking to peers over anything other\n+than the i2p network.\n+[report_issue]\n+***** piece_size() *****\n+int piece_size (piece_index_t index) const;\n+returns the piece size of file with index. This will be the same as\n+piece_length(), except for the last piece, which may be shorter.\n+ [report_issue]\n+***** hash_for_piece() hash_for_piece_ptr() *****\n+sha1_hash hash_for_piece (piece_index_t index) const;\n+char const* hash_for_piece_ptr (piece_index_t const index) const;\n+hash_for_piece() takes a piece-index and returns the 20-bytes sha1-hash for\n+that piece and info_hash() returns the 20-bytes sha1-hash for the info-section\n+of the torrent file. hash_for_piece_ptr() returns a pointer to the 20 byte sha1\n+digest for the piece. Note that the string is not 0-terminated.\n+[report_issue]\n+***** name() *****\n+const std::string& name () const;\n+name() returns the name of the torrent. name contains UTF-8 encoded string.\n+[report_issue]\n+***** creation_date() *****\n+std::time_t creation_date () const;\n+creation_date() returns the creation date of the torrent as time_t (posix\n+time). If there's no time stamp in the torrent file, 0 is returned. .. posix\n+time: http://www.opengroup.org/onlinepubs/009695399/functions/time.html\n+[report_issue]\n+***** creator() *****\n+const std::string& creator () const;\n+creator() returns the creator string in the torrent. If there is no creator\n+string it will return an empty string.\n+[report_issue]\n+***** comment() *****\n+const std::string& comment () const;\n+comment() returns the comment associated with the torrent. If there's no\n+comment, it will return an empty string. comment contains UTF-8 encoded string.\n+[report_issue]\n+***** nodes() *****\n+std::vector> const& nodes () const;\n+If this torrent contains any DHT nodes, they are put in this vector in their\n+original form (host name and port number).\n+[report_issue]\n+***** add_node() *****\n+void add_node (std::pair const& node);\n+This is used when creating torrent. Use this to add a known DHT node. It may be\n+used, by the client, to bootstrap into the DHT network.\n+[report_issue]\n+***** parse_info_section() *****\n+bool parse_info_section (bdecode_node const& info, error_code& ec, int\n+max_pieces);\n+populates the torrent_info by providing just the info-dict buffer. This is used\n+when loading a torrent from a magnet link for instance, where we only have the\n+info-dict. The bdecode_node e points to a parsed info-dictionary. ec returns an\n+error code if something fails (typically if the info dictionary is malformed).\n+Themax_piecesparameter allows limiting the amount of memory dedicated to\n+loading the torrent, and fails for torrents that exceed the limit. To load\n+large torrents, this limit may also need to be raised in settings_pack::\n+max_piece_count and in calls to read_resume_data().\n+[report_issue]\n+***** info() *****\n+bdecode_node info (char const* key) const;\n+This function looks up keys from the info-dictionary of the loaded torrent\n+file. It can be used to access extension values put in the .torrent file. If\n+the specified key cannot be found, it returns nullptr.\n+[report_issue]\n+***** info_section() *****\n+span info_section () const;\n+returns a the raw info section of the torrent file. The underlying buffer is\n+still owned by the torrent_info object\n+[report_issue]\n+***** piece_layer() *****\n+span piece_layer (file_index_t) const;\n+return the bytes of the piece layer hashes for the specified file. If the file\n+doesn't have a piece layer, an empty span is returned. The span size is\n+divisible by 32, the size of a SHA-256 hash. If the size of the file is smaller\n+than or equal to the piece size, the files \"root hash\" is the hash of the file\n+and is not saved separately in the \"piece layers\" field, but this function\n+still returns the root hash of the file in that case.\n+[report_issue]\n+***** free_piece_layers() *****\n+void free_piece_layers ();\n+clears the piece layers from the torrent_info. This is done by the session when\n+a torrent is added, to avoid storing it twice. The piece layer (or other hashes\n+part of the merkle tree) are stored in the internal torrent object.\n+Bencoding is a common representation in bittorrent used for dictionary, list,\n+int and string hierarchies. It's used to encode .torrent files and some\n+messages in the network protocol. libtorrent also uses it to store settings,\n+resume data and other session state.\n+Strings in bencoded structures do not necessarily represent text. Strings are\n+raw byte buffers of a certain length. If a string is meant to be interpreted as\n+text, it is required to be UTF-8 encoded. See BEP_3.\n+The function for decoding bencoded data bdecode(), returning a bdecode_node.\n+This function builds a tree that points back into the original buffer. The\n+returned bdecode_node will not be valid once the buffer it was parsed out of is\n+discarded.\n+It's possible to construct an entry from a bdecode_node, if a structure needs\n+to be altered and re-encoded.\n+[report_issue]\n+****** entry ******\n+Declared in \"libtorrent/entry.hpp\"\n+The entry class represents one node in a bencoded hierarchy. It works as a\n+variant type, it can be either a list, a dictionary (std::map), an integer or a\n+string.\n+class entry\n+{\n+ data_type type () const;\n+ entry (preformatted_type);\n+ entry (dictionary_type);\n+ entry (list_type);\n+ entry (span);\n+ entry (integer_type);\n+ entry (U v);\n+ entry (data_type t);\n+ entry (bdecode_node const& n);\n+ entry& operator= (bdecode_node const&) &;\n+ entry& operator= (dictionary_type) &;\n+ entry& operator= (entry&&) & noexcept;\n+ entry& operator= (span) &;\n+ entry& operator= (list_type) &;\n+ entry& operator= (entry const&) &;\n+ entry& operator= (integer_type) &;\n+ entry& operator= (preformatted_type) &;\n+ entry& operator= (U v) &;\n+ list_type const& list () const;\n+ list_type& list ();\n+ preformatted_type const& preformatted () const;\n+ integer_type& integer ();\n+ integer_type const& integer () const;\n+ dictionary_type const& dict () const;\n+ preformatted_type& preformatted ();\n+ dictionary_type& dict ();\n+ string_type& string ();\n+ string_type const& string () const;\n+ void swap (entry& e);\n+ entry& operator[] (string_view key);\n+ entry const& operator[] (string_view key) const;\n+ entry* find_key (string_view key);\n+ entry const* find_key (string_view key) const;\n+ std::string to_string (bool single_line = false) const;\n+\n+ enum data_type\n+ {\n+ int_t,\n+ string_t,\n+ list_t,\n+ dictionary_t,\n+ undefined_t,\n+ preformatted_t,\n+ };\n+};\n+[report_issue]\n+***** type() *****\n+data_type type () const;\n+returns the concrete type of the entry\n+[report_issue]\n+***** entry() *****\n+entry (preformatted_type);\n+entry (dictionary_type);\n+entry (list_type);\n+entry (span);\n+entry (integer_type);\n+constructors directly from a specific type. The content of the argument is\n+copied into the newly constructed entry\n+[report_issue]\n+***** entry() *****\n+entry (data_type t);\n+construct an empty entry of the specified type. see data_type enum.\n+[report_issue]\n+***** entry() *****\n+entry (bdecode_node const& n);\n+construct from bdecode_node parsed form (see bdecode())\n+[report_issue]\n+***** operator=() *****\n+entry& operator= (bdecode_node const&) &;\n+entry& operator= (dictionary_type) &;\n+entry& operator= (entry&&) & noexcept;\n+entry& operator= (span) &;\n+entry& operator= (list_type) &;\n+entry& operator= (entry const&) &;\n+entry& operator= (integer_type) &;\n+entry& operator= (preformatted_type) &;\n+copies the structure of the right hand side into this entry.\n+ [report_issue]\n+***** string() dict() preformatted() list() integer() *****\n+list_type const& list () const;\n+list_type& list ();\n+preformatted_type const& preformatted () const;\n+integer_type& integer ();\n+integer_type const& integer () const;\n+dictionary_type const& dict () const;\n+preformatted_type& preformatted ();\n+dictionary_type& dict ();\n+string_type& string ();\n+string_type const& string () const;\n+The integer(), string(), list() and dict() functions are accessors that return\n+the respective type. If the entry object isn't of the type you request, the\n+accessor will throw system_error. You can ask an entry for its type through the\n+type() function.\n+If you want to create an entry you give it the type you want it to have in its\n+constructor, and then use one of the non-const accessors to get a reference\n+which you then can assign the value you want it to have.\n+The typical code to get info from a torrent file will then look like this:\n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+entry::dictionary_type const& dict = torrent_file.dict();\n+entry::dictionary_type::const_iterator i;\n+i = dict.find(\"announce\");\n+if (i != dict.end())\n+{\n+ std::string tracker_url = i->second.string();\n+ std::cout << tracker_url << \"\\n\";\n+}\n+The following code is equivalent, but a little bit shorter:\n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+if (entry* i = torrent_file.find_key(\"announce\"))\n+{\n+ std::string tracker_url = i->string();\n+ std::cout << tracker_url << \"\\n\";\n+}\n+To make it easier to extract information from a torrent file, the class\n+torrent_info exists.\n+[report_issue]\n+***** swap() *****\n+void swap (entry& e);\n+swaps the content of this with e.\n+[report_issue]\n+***** operator[]() *****\n+entry& operator[] (string_view key);\n+entry const& operator[] (string_view key) const;\n+All of these functions requires the entry to be a dictionary, if it isn't they\n+will throw system_error.\n+The non-const versions of the operator[] will return a reference to either the\n+existing element at the given key or, if there is no element with the given\n+key, a reference to a newly inserted element at that key.\n+The const version of operator[] will only return a reference to an existing\n+element at the given key. If the key is not found, it will throw system_error.\n+[report_issue]\n+***** find_key() *****\n+entry* find_key (string_view key);\n+entry const* find_key (string_view key) const;\n+These functions requires the entry to be a dictionary, if it isn't they will\n+throw system_error.\n+They will look for an element at the given key in the dictionary, if the\n+element cannot be found, they will return nullptr. If an element with the given\n+key is found, the return a pointer to it.\n+[report_issue]\n+***** to_string() *****\n+std::string to_string (bool single_line = false) const;\n+returns a pretty-printed string representation of the bencoded structure, with\n+JSON-style syntax\n+[report_issue]\n+***** enum data_type *****\n+Declared in \"libtorrent/entry.hpp\"\n+ ________________________________\n+|name__________|value|description|\n+|int_t_________|0____|\u00a0_________|\n+|string_t______|1____|\u00a0_________|\n+|list_t________|2____|\u00a0_________|\n+|dictionary_t__|3____|\u00a0_________|\n+|undefined_t___|4____|\u00a0_________|\n+|preformatted_t|5____|\u00a0_________|\n+[report_issue]\n+****** bencode() ******\n+Declared in \"libtorrent/bencode.hpp\"\n+template int bencode (OutIt out, const entry& e);\n+This function will encode data to bencoded form.\n+The entry class is the internal representation of the bencoded data and it can\n+be used to retrieve information, an entry can also be build by the program and\n+given to bencode() to encode it into the OutIt iterator.\n+OutIt is an OutputIterator. It's a template and usually instantiated as\n+ostream_iterator or back_insert_iterator. This function assumes the value_type\n+of the iterator is a char. In order to encode entry e into a buffer, do:\n+std::vector buffer;\n+bencode(std::back_inserter(buf), e);\n+[report_issue]\n+****** operator<<() ******\n+Declared in \"libtorrent/entry.hpp\"\n+inline std::ostream& operator<< (std::ostream& os, const entry& e);\n+prints the bencoded structure to the ostream as a JSON-style structure.\n+[report_issue]\n+****** bdecode_node ******\n+Declared in \"libtorrent/bdecode.hpp\"\n+Sometimes it's important to get a non-owning reference to the root node ( to be\n+able to copy it as a reference for instance). For that, use the non_owning()\n+member function.\n+There are 5 different types of nodes, see type_t.\n+struct bdecode_node\n+{\n+ bdecode_node () = default;\n+ bdecode_node& operator= (bdecode_node const&) &;\n+ bdecode_node (bdecode_node const&);\n+ bdecode_node& operator= (bdecode_node&&) & = default;\n+ bdecode_node (bdecode_node&&) noexcept;\n+ type_t type () const noexcept;\n+ explicit operator bool () const noexcept;\n+ bdecode_node non_owning () const;\n+ span data_section () const noexcept;\n+ std::ptrdiff_t data_offset () const noexcept;\n+ int list_size () const;\n+ string_view list_string_value_at (int i\n+ , string_view default_val = string_view()) const;\n+ std::int64_t list_int_value_at (int i\n+ , std::int64_t default_val = 0) const;\n+ bdecode_node list_at (int i) const;\n+ bdecode_node dict_find_string (string_view key) const;\n+ std::int64_t dict_find_int_value (string_view key\n+ , std::int64_t default_val = 0) const;\n+ std::pair dict_at_node (int i) const;\n+ bdecode_node dict_find (string_view key) const;\n+ bdecode_node dict_find_int (string_view key) const;\n+ bdecode_node dict_find_dict (string_view key) const;\n+ bdecode_node dict_find_list (string_view key) const;\n+ string_view dict_find_string_value (string_view key\n+ , string_view default_value = string_view()) const;\n+ int dict_size () const;\n+ std::pair dict_at (int i) const;\n+ std::int64_t int_value () const;\n+ int string_length () const;\n+ string_view string_value () const;\n+ char const* string_ptr () const;\n+ std::ptrdiff_t string_offset () const;\n+ void clear ();\n+ void swap (bdecode_node& n);\n+ void reserve (int tokens);\n+ void switch_underlying_buffer (char const* buf) noexcept;\n+ bool has_soft_error (span error) const;\n+\n+ enum type_t\n+ {\n+ none_t,\n+ dict_t,\n+ list_t,\n+ string_t,\n+ int_t,\n+ };\n+};\n+[report_issue]\n+***** bdecode_node() *****\n+bdecode_node () = default;\n+creates a default constructed node, it will have the type none_t.\n+ [report_issue]\n+***** bdecode_node() operator=() *****\n+bdecode_node& operator= (bdecode_node const&) &;\n+bdecode_node (bdecode_node const&);\n+bdecode_node& operator= (bdecode_node&&) & = default;\n+bdecode_node (bdecode_node&&) noexcept;\n+For owning nodes, the copy will create a copy of the tree, but the underlying\n+buffer remains the same.\n+[report_issue]\n+***** type() *****\n+type_t type () const noexcept;\n+the type of this node. See type_t.\n+[report_issue]\n+***** bool() *****\n+explicit operator bool () const noexcept;\n+returns true if type() != none_t.\n+[report_issue]\n+***** non_owning() *****\n+bdecode_node non_owning () const;\n+return a non-owning reference to this node. This is useful to refer to the root\n+node without copying it in assignments.\n+ [report_issue]\n+***** data_section() data_offset() *****\n+span data_section () const noexcept;\n+std::ptrdiff_t data_offset () const noexcept;\n+returns the buffer and length of the section in the original bencoded buffer\n+where this node is defined. For a dictionary for instance, this starts with d\n+and ends with e, and has all the content of the dictionary in between. the\n+data_offset() function returns the byte-offset to this node in, starting from\n+the beginning of the buffer that was parsed.\n+ [report_issue]\n+***** list_size() list_at() list_int_value_at() list_string_value_at() *****\n+int list_size () const;\n+string_view list_string_value_at (int i\n+ , string_view default_val = string_view()) const;\n+std::int64_t list_int_value_at (int i\n+ , std::int64_t default_val = 0) const;\n+bdecode_node list_at (int i) const;\n+functions with the list_ prefix operate on lists. These functions are only\n+valid if type() == list_t. list_at() returns the item in the list at index i. i\n+may not be greater than or equal to the size of the list. size() returns the\n+size of the list.\n+ [report_issue]\n+***** dict_find() dict_find_int_value() dict_find_string()\n+dict_find_string_value() dict_at() dict_find_dict() dict_at_node()\n+dict_find_list() dict_find_int() dict_size() *****\n+bdecode_node dict_find_string (string_view key) const;\n+std::int64_t dict_find_int_value (string_view key\n+ , std::int64_t default_val = 0) const;\n+std::pair dict_at_node (int i) const;\n+bdecode_node dict_find (string_view key) const;\n+bdecode_node dict_find_int (string_view key) const;\n+bdecode_node dict_find_dict (string_view key) const;\n+bdecode_node dict_find_list (string_view key) const;\n+string_view dict_find_string_value (string_view key\n+ , string_view default_value = string_view()) const;\n+int dict_size () const;\n+std::pair dict_at (int i) const;\n+Functions with the dict_ prefix operates on dictionaries. They are only valid\n+if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n+cannot use the 0-terminated string overloads, but have to use string_view\n+instead. dict_find_list will return a valid bdecode_node if the key is found\n+_and_ it is a list. Otherwise it will return a default-constructed\n+bdecode_node.\n+Functions with the _value suffix return the value of the node directly, rather\n+than the nodes. In case the node is not found, or it has a different type, a\n+default value is returned (which can be specified).\n+dict_at() returns the (key, value)-pair at the specified index in a dictionary.\n+Keys are only allowed to be strings. dict_at_node() also returns the (key,\n+value)-pair, but the key is returned as a bdecode_node (and it will always be a\n+string).\n+[report_issue]\n+***** int_value() *****\n+std::int64_t int_value () const;\n+this function is only valid if type() == int_t. It returns the value of the\n+integer.\n+ [report_issue]\n+***** string_value() string_length() string_ptr() string_offset() *****\n+int string_length () const;\n+string_view string_value () const;\n+char const* string_ptr () const;\n+std::ptrdiff_t string_offset () const;\n+these functions are only valid if type() == string_t. They return the string\n+values. Note that string_ptr() is not 0-terminated. string_length() returns the\n+number of bytes in the string. string_offset() returns the byte offset from the\n+start of the parsed bencoded buffer this string can be found.\n+[report_issue]\n+***** clear() *****\n+void clear ();\n+resets the bdecoded_node to a default constructed state. If this is an owning\n+node, the tree is freed and all child nodes are invalidated.\n+[report_issue]\n+***** swap() *****\n+void swap (bdecode_node& n);\n+Swap contents.\n+[report_issue]\n+***** reserve() *****\n+void reserve (int tokens);\n+preallocate memory for the specified numbers of tokens. This is useful if you\n+know approximately how many tokens are in the file you are about to parse.\n+Doing so will save realloc operations while parsing. You should only call this\n+on the root node, before passing it in to bdecode().\n+[report_issue]\n+***** switch_underlying_buffer() *****\n+void switch_underlying_buffer (char const* buf) noexcept;\n+this buffer MUST be identical to the one originally parsed. This operation is\n+only defined on owning root nodes, i.e. the one passed in to decode().\n+[report_issue]\n+***** has_soft_error() *****\n+bool has_soft_error (span error) const;\n+returns true if there is a non-fatal error in the bencoding of this node or its\n+children\n+[report_issue]\n+***** enum type_t *****\n+Declared in \"libtorrent/bdecode.hpp\"\n+ _________________________________________________________________________\n+|name____|value|description_______________________________________________|\n+|none_t |0 |uninitialized or default constructed. This is also used to|\n+|________|_____|indicate_that_a_node_was_not_found_in_some_cases._________|\n+|dict_t__|1____|a_dictionary_node._The_dict_find__functions_are_valid.____|\n+|list_t__|2____|a_list_node._The_list__functions_are_valid._______________|\n+|string_t|3____|a_string_node,_the_string__functions_are_valid.___________|\n+|int_t___|4____|an_integer_node._The_int__functions_are_valid.____________|\n+[report_issue]\n+****** print_entry() ******\n+Declared in \"libtorrent/bdecode.hpp\"\n+std::string print_entry (bdecode_node const& e\n+ , bool single_line = false, int indent = 0);\n+print the bencoded structure in a human-readable format to a string that's\n+returned.\n+[report_issue]\n+****** bdecode() ******\n+Declared in \"libtorrent/bdecode.hpp\"\n+bdecode_node bdecode (span buffer\n+ , int depth_limit = 100, int token_limit = 2000000);\n+bdecode_node bdecode (span buffer\n+ , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+ , int token_limit = 2000000);\n+int bdecode (char const* start, char const* end, bdecode_node& ret\n+ , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+ , int token_limit = 2000000);\n+This function decodes/parses bdecoded data (for example a .torrent file). The\n+data structure is returned in the ret argument. the buffer to parse is\n+specified by the start of the buffer as well as the end, i.e. one byte past the\n+end. If the buffer fails to parse, the function returns a non-zero value and\n+fills in ec with the error code. The optional argument error_pos, if set to\n+non-nullptr, will be set to the byte offset into the buffer where the parse\n+failure occurred.\n+depth_limit specifies the max number of nested lists or dictionaries are\n+allowed in the data structure. (This affects the stack usage of the function,\n+be careful not to set it too high).\n+token_limit is the max number of tokens allowed to be parsed from the buffer.\n+This is simply a sanity check to not have unbounded memory usage.\n+The resulting bdecode_node is an owning node. That means it will be holding the\n+whole parsed tree. When iterating lists and dictionaries, those bdecode_node\n+objects will simply have references to the root or owning bdecode_node. If the\n+root node is destructed, all other nodes that refer to anything in that tree\n+become invalid.\n+However, the underlying buffer passed in to this function (start, end) must\n+also remain valid while the bdecoded tree is used. The parsed tree produced by\n+this function does not copy any data out of the buffer, but simply produces\n+references back into it.\n+[report_issue]\n+****** stats_metric ******\n+Declared in \"libtorrent/session_stats.hpp\"\n+describes one statistics metric from the session. For more information, see the\n+session_statistics section.\n+struct stats_metric\n+{\n+ char const* name;\n+ int value_index;\n+ metric_type_t type;\n+};\n+[report_issue]\n+ name\n+ the name of the counter or gauge\n+ [report_issue]\n+ value_index type\n+ the index into the session stats array, where the underlying value of\n+ this counter or gauge is found. The session stats array is part of the\n+ session_stats_alert object.\n+[report_issue]\n+****** counters ******\n+Declared in \"libtorrent/performance_counters.hpp\"\n+struct counters\n+{\n+ counters () ;\n+ counters& operator= (counters const&) & ;\n+ counters (counters const&) ;\n+ std::int64_t operator[] (int i) const ;\n+ std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+ void blend_stats_counter (int c, std::int64_t value, int ratio) ;\n+ void set_value (int c, std::int64_t value) ;\n+};\n+ [report_issue]\n+***** operator[]() inc_stats_counter() *****\n+std::int64_t operator[] (int i) const ;\n+std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+returns the new value\n+[report_issue]\n+****** session_stats_metrics() ******\n+Declared in \"libtorrent/session_stats.hpp\"\n+std::vector session_stats_metrics ();\n+This free function returns the list of available metrics exposed by\n+libtorrent's statistics API. Each metric has a name and a value index. The\n+value index is the index into the array in session_stats_alert where this\n+metric's value can be found when the session stats is sampled (by calling\n+post_session_stats()).\n+[report_issue]\n+****** find_metric_idx() ******\n+Declared in \"libtorrent/session_stats.hpp\"\n+int find_metric_idx (string_view name);\n+given a name of a metric, this function returns the counter index of it, or -\n+1 if it could not be found. The counter index is the index into the values\n+array returned by session_stats_alert.\n+[report_issue]\n+****** enum metric_type_t ******\n+Declared in \"libtorrent/session_stats.hpp\"\n+ _________________________\n+|name___|value|description|\n+|counter|0____|\u00a0_________|\n+|gauge__|1____|\u00a0_________|\n The pop_alerts() function on session is the main interface for retrieving\n alerts (warnings, messages and errors from libtorrent). If no alerts have been\n posted by libtorrent pop_alerts() will return an empty list.\n By default, only errors are reported. settings_pack::alert_mask can be used to\n specify which kinds of events should be reported. The alert mask is a\n combination of the alert_category_t flags in the alert class.\n Every alert belongs to one or more category. There is a cost associated with\n@@ -9001,25 +9615,25 @@\n ****** file_renamed_alert ******\n Declared in \"libtorrent/alert_types.hpp\"\n This is posted as a response to a torrent_handle::rename_file() call, if the\n rename operation succeeds.\n struct file_renamed_alert final : torrent_alert\n {\n std::string message () const override;\n- char const* old_name () const;\n char const* new_name () const;\n+ char const* old_name () const;\n \n static constexpr alert_category_t static_category = alert_category::\n storage;\n file_index_t const index;\n };\n [report_issue]\n ***** new_name() old_name() *****\n-char const* old_name () const;\n char const* new_name () const;\n+char const* old_name () const;\n returns the new and previous file name, respectively.\n [report_issue]\n index\n refers to the index of the file that was renamed,\n [report_issue]\n ****** file_rename_failed_alert ******\n Declared in \"libtorrent/alert_types.hpp\"\n@@ -9636,24 +10250,24 @@\n The storage_moved_alert is generated when all the disk IO has completed and the\n files have been moved, as an effect of a call to torrent_handle::move_storage.\n This is useful to synchronize with the actual disk. The storage_path() member\n return the new path of the storage.\n struct storage_moved_alert final : torrent_alert\n {\n std::string message () const override;\n- char const* old_path () const;\n char const* storage_path () const;\n+ char const* old_path () const;\n \n static constexpr alert_category_t static_category = alert_category::\n storage;\n };\n [report_issue]\n ***** storage_path() old_path() *****\n-char const* old_path () const;\n char const* storage_path () const;\n+char const* old_path () const;\n the path the torrent was moved to and from, respectively.\n [report_issue]\n ****** storage_moved_failed_alert ******\n Declared in \"libtorrent/alert_types.hpp\"\n The storage_moved_failed_alert is generated when an attempt to move the\n storage, via torrent_handle::move_storage(), fails.\n struct storage_moved_failed_alert final : torrent_alert\n@@ -10889,24 +11503,24 @@\n ****** dht_live_nodes_alert ******\n Declared in \"libtorrent/alert_types.hpp\"\n posted in response to a call to session::dht_live_nodes(). It contains the live\n nodes from the DHT routing table of one of the DHT nodes running locally.\n struct dht_live_nodes_alert final : alert\n {\n std::string message () const override;\n- std::vector> nodes () const;\n int num_nodes () const;\n+ std::vector> nodes () const;\n \n static constexpr alert_category_t static_category = alert_category::dht;\n sha1_hash node_id;\n };\n [report_issue]\n ***** nodes() num_nodes() *****\n-std::vector> nodes () const;\n int num_nodes () const;\n+std::vector> nodes () const;\n the number of nodes in the routing table and the actual nodes.\n [report_issue]\n node_id\n the local DHT node's node-ID this routing table belongs to\n [report_issue]\n ****** session_stats_header_alert ******\n Declared in \"libtorrent/alert_types.hpp\"\n@@ -10940,15 +11554,15 @@\n dht_operation;\n sha1_hash node_id;\n aux::noexcept_movable endpoint;\n time_duration const interval;\n int const num_infohashes;\n };\n [report_issue]\n-***** samples() num_samples() *****\n+***** num_samples() samples() *****\n std::vector samples () const;\n int num_samples () const;\n returns the number of info-hashes returned by the node, as well as the actual\n info-hashes. num_samples() is more efficient than samples().size().\n [report_issue]\n ***** num_nodes() *****\n int num_nodes () const;\n@@ -11097,29 +11711,29 @@\n collided with this swarm's info-hash.\n [report_issue]\n metadata\n the metadata that was received by one of the torrents in conflict. One\n way to resolve the conflict is to remove both failing torrents and re-add\n it using this metadata\n [report_issue]\n+****** operation_name() ******\n+Declared in \"libtorrent/operations.hpp\"\n+char const* operation_name (operation_t op);\n+maps an operation id (from peer_error_alert and peer_disconnected_alert) to its\n+name. See operation_t for the constants\n+[report_issue]\n ****** alert_cast() ******\n Declared in \"libtorrent/alert.hpp\"\n template T const* alert_cast (alert const* a);\n template T* alert_cast (alert* a);\n When you get an alert, you can use alert_cast<> to attempt to cast the pointer\n to a specific alert type, in order to query it for more information.\n Note\n alert_cast<> can only cast to an exact alert type, not a base class\n [report_issue]\n-****** operation_name() ******\n-Declared in \"libtorrent/operations.hpp\"\n-char const* operation_name (operation_t op);\n-maps an operation id (from peer_error_alert and peer_disconnected_alert) to its\n-name. See operation_t for the constants\n-[report_issue]\n ****** enum operation_t ******\n Declared in \"libtorrent/operations.hpp\"\n _____________________________________________________________________________\n |name_______________|value|description________________________________________|\n |unknown |0 |the error was unexpected and it is unknown which |\n |___________________|_____|operation_caused_it________________________________|\n |bittorrent |1 |this is used when the bittorrent logic determines |\n@@ -11258,733 +11872,14 @@\n rejected, time-out and cancelled. This is likely to post alerts at a high\n rate.\n all\n The full bitmask, representing all available categories.\n since the enum is signed, make sure this isn't interpreted as -1. For\n instance, boost.python does that and fails when assigning it to an\n unsigned parameter.\n-Bencoding is a common representation in bittorrent used for dictionary, list,\n-int and string hierarchies. It's used to encode .torrent files and some\n-messages in the network protocol. libtorrent also uses it to store settings,\n-resume data and other session state.\n-Strings in bencoded structures do not necessarily represent text. Strings are\n-raw byte buffers of a certain length. If a string is meant to be interpreted as\n-text, it is required to be UTF-8 encoded. See BEP_3.\n-The function for decoding bencoded data bdecode(), returning a bdecode_node.\n-This function builds a tree that points back into the original buffer. The\n-returned bdecode_node will not be valid once the buffer it was parsed out of is\n-discarded.\n-It's possible to construct an entry from a bdecode_node, if a structure needs\n-to be altered and re-encoded.\n-[report_issue]\n-****** entry ******\n-Declared in \"libtorrent/entry.hpp\"\n-The entry class represents one node in a bencoded hierarchy. It works as a\n-variant type, it can be either a list, a dictionary (std::map), an integer or a\n-string.\n-class entry\n-{\n- data_type type () const;\n- entry (dictionary_type);\n- entry (list_type);\n- entry (span);\n- entry (preformatted_type);\n- entry (integer_type);\n- entry (U v);\n- entry (data_type t);\n- entry (bdecode_node const& n);\n- entry& operator= (preformatted_type) &;\n- entry& operator= (dictionary_type) &;\n- entry& operator= (entry const&) &;\n- entry& operator= (span) &;\n- entry& operator= (entry&&) & noexcept;\n- entry& operator= (integer_type) &;\n- entry& operator= (list_type) &;\n- entry& operator= (bdecode_node const&) &;\n- entry& operator= (U v) &;\n- string_type const& string () const;\n- string_type& string ();\n- list_type const& list () const;\n- dictionary_type const& dict () const;\n- preformatted_type& preformatted ();\n- preformatted_type const& preformatted () const;\n- integer_type const& integer () const;\n- integer_type& integer ();\n- list_type& list ();\n- dictionary_type& dict ();\n- void swap (entry& e);\n- entry const& operator[] (string_view key) const;\n- entry& operator[] (string_view key);\n- entry* find_key (string_view key);\n- entry const* find_key (string_view key) const;\n- std::string to_string (bool single_line = false) const;\n-\n- enum data_type\n- {\n- int_t,\n- string_t,\n- list_t,\n- dictionary_t,\n- undefined_t,\n- preformatted_t,\n- };\n-};\n-[report_issue]\n-***** type() *****\n-data_type type () const;\n-returns the concrete type of the entry\n-[report_issue]\n-***** entry() *****\n-entry (dictionary_type);\n-entry (list_type);\n-entry (span);\n-entry (preformatted_type);\n-entry (integer_type);\n-constructors directly from a specific type. The content of the argument is\n-copied into the newly constructed entry\n-[report_issue]\n-***** entry() *****\n-entry (data_type t);\n-construct an empty entry of the specified type. see data_type enum.\n-[report_issue]\n-***** entry() *****\n-entry (bdecode_node const& n);\n-construct from bdecode_node parsed form (see bdecode())\n-[report_issue]\n-***** operator=() *****\n-entry& operator= (preformatted_type) &;\n-entry& operator= (dictionary_type) &;\n-entry& operator= (entry const&) &;\n-entry& operator= (span) &;\n-entry& operator= (entry&&) & noexcept;\n-entry& operator= (integer_type) &;\n-entry& operator= (list_type) &;\n-entry& operator= (bdecode_node const&) &;\n-copies the structure of the right hand side into this entry.\n- [report_issue]\n-***** string() list() integer() dict() preformatted() *****\n-string_type const& string () const;\n-string_type& string ();\n-list_type const& list () const;\n-dictionary_type const& dict () const;\n-preformatted_type& preformatted ();\n-preformatted_type const& preformatted () const;\n-integer_type const& integer () const;\n-integer_type& integer ();\n-list_type& list ();\n-dictionary_type& dict ();\n-The integer(), string(), list() and dict() functions are accessors that return\n-the respective type. If the entry object isn't of the type you request, the\n-accessor will throw system_error. You can ask an entry for its type through the\n-type() function.\n-If you want to create an entry you give it the type you want it to have in its\n-constructor, and then use one of the non-const accessors to get a reference\n-which you then can assign the value you want it to have.\n-The typical code to get info from a torrent file will then look like this:\n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-entry::dictionary_type const& dict = torrent_file.dict();\n-entry::dictionary_type::const_iterator i;\n-i = dict.find(\"announce\");\n-if (i != dict.end())\n-{\n- std::string tracker_url = i->second.string();\n- std::cout << tracker_url << \"\\n\";\n-}\n-The following code is equivalent, but a little bit shorter:\n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-if (entry* i = torrent_file.find_key(\"announce\"))\n-{\n- std::string tracker_url = i->string();\n- std::cout << tracker_url << \"\\n\";\n-}\n-To make it easier to extract information from a torrent file, the class\n-torrent_info exists.\n-[report_issue]\n-***** swap() *****\n-void swap (entry& e);\n-swaps the content of this with e.\n-[report_issue]\n-***** operator[]() *****\n-entry const& operator[] (string_view key) const;\n-entry& operator[] (string_view key);\n-All of these functions requires the entry to be a dictionary, if it isn't they\n-will throw system_error.\n-The non-const versions of the operator[] will return a reference to either the\n-existing element at the given key or, if there is no element with the given\n-key, a reference to a newly inserted element at that key.\n-The const version of operator[] will only return a reference to an existing\n-element at the given key. If the key is not found, it will throw system_error.\n-[report_issue]\n-***** find_key() *****\n-entry* find_key (string_view key);\n-entry const* find_key (string_view key) const;\n-These functions requires the entry to be a dictionary, if it isn't they will\n-throw system_error.\n-They will look for an element at the given key in the dictionary, if the\n-element cannot be found, they will return nullptr. If an element with the given\n-key is found, the return a pointer to it.\n-[report_issue]\n-***** to_string() *****\n-std::string to_string (bool single_line = false) const;\n-returns a pretty-printed string representation of the bencoded structure, with\n-JSON-style syntax\n-[report_issue]\n-***** enum data_type *****\n-Declared in \"libtorrent/entry.hpp\"\n- ________________________________\n-|name__________|value|description|\n-|int_t_________|0____|\u00a0_________|\n-|string_t______|1____|\u00a0_________|\n-|list_t________|2____|\u00a0_________|\n-|dictionary_t__|3____|\u00a0_________|\n-|undefined_t___|4____|\u00a0_________|\n-|preformatted_t|5____|\u00a0_________|\n-[report_issue]\n-****** bencode() ******\n-Declared in \"libtorrent/bencode.hpp\"\n-template int bencode (OutIt out, const entry& e);\n-This function will encode data to bencoded form.\n-The entry class is the internal representation of the bencoded data and it can\n-be used to retrieve information, an entry can also be build by the program and\n-given to bencode() to encode it into the OutIt iterator.\n-OutIt is an OutputIterator. It's a template and usually instantiated as\n-ostream_iterator or back_insert_iterator. This function assumes the value_type\n-of the iterator is a char. In order to encode entry e into a buffer, do:\n-std::vector buffer;\n-bencode(std::back_inserter(buf), e);\n-[report_issue]\n-****** operator<<() ******\n-Declared in \"libtorrent/entry.hpp\"\n-inline std::ostream& operator<< (std::ostream& os, const entry& e);\n-prints the bencoded structure to the ostream as a JSON-style structure.\n-[report_issue]\n-****** ip_filter ******\n-Declared in \"libtorrent/ip_filter.hpp\"\n-The ip_filter class is a set of rules that uniquely categorizes all ip\n-addresses as allowed or disallowed. The default constructor creates a single\n-rule that allows all addresses (0.0.0.0 - 255.255.255.255 for the IPv4 range,\n-and the equivalent range covering all addresses for the IPv6 range).\n-A default constructed ip_filter does not filter any address.\n-struct ip_filter\n-{\n- ip_filter& operator= (ip_filter&&);\n- ip_filter& operator= (ip_filter const&);\n- ~ip_filter ();\n- ip_filter (ip_filter&&);\n- ip_filter ();\n- ip_filter (ip_filter const&);\n- bool empty () const;\n- void add_rule (address const& first, address const& last, std::uint32_t\n-flags);\n- std::uint32_t access (address const& addr) const;\n- filter_tuple_t export_filter () const;\n-\n- enum access_flags\n- {\n- blocked,\n- };\n-};\n-[report_issue]\n-***** empty() *****\n-bool empty () const;\n-returns true if the filter does not contain any rules\n-[report_issue]\n-***** add_rule() *****\n-void add_rule (address const& first, address const& last, std::uint32_t flags);\n-Adds a rule to the filter. first and last defines a range of ip addresses that\n-will be marked with the given flags. The flags can currently be 0, which means\n-allowed, or ip_filter::blocked, which means disallowed.\n-precondition: first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()\n-postcondition: access(x) == flags for every x in the range [first, last]\n-This means that in a case of overlapping ranges, the last one applied takes\n-precedence.\n-[report_issue]\n-***** access() *****\n-std::uint32_t access (address const& addr) const;\n-Returns the access permissions for the given address (addr). The permission can\n-currently be 0 or ip_filter::blocked. The complexity of this operation is O(log\n-n), where n is the minimum number of non-overlapping ranges to describe the\n-current filter.\n-[report_issue]\n-***** export_filter() *****\n-filter_tuple_t export_filter () const;\n-This function will return the current state of the filter in the minimum number\n-of ranges possible. They are sorted from ranges in low addresses to high\n-addresses. Each entry in the returned vector is a range with the access control\n-specified in its flags field.\n-The return value is a tuple containing two range-lists. One for IPv4 addresses\n-and one for IPv6 addresses.\n-[report_issue]\n-***** enum access_flags *****\n-Declared in \"libtorrent/ip_filter.hpp\"\n- _____________________________________________________________________________\n-|name___|value|description____________________________________________________|\n-|blocked|1 |indicates that IPs in this range should not be connected to nor|\n-|_______|_____|accepted_as_incoming_connections_______________________________|\n-[report_issue]\n-****** port_filter ******\n-Declared in \"libtorrent/ip_filter.hpp\"\n-the port filter maps non-overlapping port ranges to flags. This is primarily\n-used to indicate whether a range of ports should be connected to or not. The\n-default is to have the full port range (0-65535) set to flag 0.\n-class port_filter\n-{\n- port_filter& operator= (port_filter&&);\n- port_filter& operator= (port_filter const&);\n- port_filter ();\n- port_filter (port_filter&&);\n- ~port_filter ();\n- port_filter (port_filter const&);\n- void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t\n-flags);\n- std::uint32_t access (std::uint16_t port) const;\n-\n- enum access_flags\n- {\n- blocked,\n- };\n-};\n-[report_issue]\n-***** add_rule() *****\n-void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n-set the flags for the specified port range (first, last) to flags overwriting\n-any existing rule for those ports. The range is inclusive, i.e. the port last\n-also has the flag set on it.\n-[report_issue]\n-***** access() *****\n-std::uint32_t access (std::uint16_t port) const;\n-test the specified port (port) for whether it is blocked or not. The returned\n-value is the flags set for this port. see access_flags.\n-[report_issue]\n-***** enum access_flags *****\n-Declared in \"libtorrent/ip_filter.hpp\"\n- ____________________________________________________________________________\n-|name___|value|description___________________________________________________|\n-|blocked|1 |this flag indicates that destination ports in the range should|\n-|_______|_____|not_be_connected_to___________________________________________|\n-[report_issue]\n-****** hasher ******\n-Declared in \"libtorrent/hasher.hpp\"\n-this is a SHA-1 hash class.\n-You use it by first instantiating it, then call update() to feed it with data.\n-i.e. you don't have to keep the entire buffer of which you want to create the\n-hash in memory. You can feed the hasher parts of it at a time. When You have\n-fed the hasher with all the data, you call final() and it will return the sha1-\n-hash of the data.\n-The constructor that takes a char const* and an integer will construct the sha1\n-context and feed it the data passed in.\n-If you want to reuse the hasher object once you have created a hash, you have\n-to call reset() to reinitialize it.\n-The built-in software version of sha1-algorithm was implemented by Steve Reid\n-and released as public domain. For more info, see src/sha1.cpp.\n-class hasher\n-{\n- hasher ();\n- hasher& operator= (hasher const&) &;\n- explicit hasher (span data);\n- hasher (char const* data, int len);\n- hasher (hasher const&);\n- hasher& update (char const* data, int len);\n- hasher& update (span data);\n- sha1_hash final ();\n- void reset ();\n-};\n- [report_issue]\n-***** operator=() hasher() *****\n-hasher& operator= (hasher const&) &;\n-explicit hasher (span data);\n-hasher (char const* data, int len);\n-hasher (hasher const&);\n-this is the same as default constructing followed by a call to update(data,\n-len).\n-[report_issue]\n-***** update() *****\n-hasher& update (char const* data, int len);\n-hasher& update (span data);\n-append the following bytes to what is being hashed\n-[report_issue]\n-***** final() *****\n-sha1_hash final ();\n-returns the SHA-1 digest of the buffers previously passed to update() and the\n-hasher constructor.\n-[report_issue]\n-***** reset() *****\n-void reset ();\n-restore the hasher state to be as if the hasher has just been default\n-constructed.\n-[report_issue]\n-****** hasher256 ******\n-Declared in \"libtorrent/hasher.hpp\"\n-class hasher256\n-{\n- hasher256 ();\n- explicit hasher256 (span data);\n- hasher256 (hasher256 const&);\n- hasher256& operator= (hasher256 const&) &;\n- hasher256 (char const* data, int len);\n- hasher256& update (char const* data, int len);\n- hasher256& update (span data);\n- sha256_hash final ();\n- void reset ();\n- ~hasher256 ();\n-};\n- [report_issue]\n-***** hasher256() operator=() *****\n-explicit hasher256 (span data);\n-hasher256 (hasher256 const&);\n-hasher256& operator= (hasher256 const&) &;\n-hasher256 (char const* data, int len);\n-this is the same as default constructing followed by a call to update(data,\n-len).\n-[report_issue]\n-***** update() *****\n-hasher256& update (char const* data, int len);\n-hasher256& update (span data);\n-append the following bytes to what is being hashed\n-[report_issue]\n-***** final() *****\n-sha256_hash final ();\n-returns the SHA-1 digest of the buffers previously passed to update() and the\n-hasher constructor.\n-[report_issue]\n-***** reset() *****\n-void reset ();\n-restore the hasher state to be as if the hasher has just been default\n-constructed.\n-[report_issue]\n-****** bitfield ******\n-Declared in \"libtorrent/bitfield.hpp\"\n-The bitfield type stores any number of bits as a bitfield in a heap allocated\n-array.\n-struct bitfield\n-{\n- bitfield (int bits, bool val);\n- bitfield (char const* b, int bits);\n- explicit bitfield (int bits);\n- bitfield (bitfield&& rhs) noexcept = default;\n- bitfield (bitfield const& rhs);\n- bitfield () noexcept = default;\n- void assign (char const* b, int const bits);\n- bool get_bit (int index) const noexcept;\n- bool operator[] (int index) const noexcept;\n- void set_bit (int index) noexcept;\n- void clear_bit (int index) noexcept;\n- bool all_set () const noexcept;\n- bool none_set () const noexcept;\n- int size () const noexcept;\n- int num_words () const noexcept;\n- bool empty () const noexcept;\n- char const* data () const noexcept;\n- char* data () noexcept;\n- void swap (bitfield& rhs) noexcept;\n- int count () const noexcept;\n- int find_first_set () const noexcept;\n- int find_last_clear () const noexcept;\n-};\n-[report_issue]\n-***** bitfield() *****\n-bitfield (int bits, bool val);\n-bitfield (char const* b, int bits);\n-explicit bitfield (int bits);\n-bitfield (bitfield&& rhs) noexcept = default;\n-bitfield (bitfield const& rhs);\n-bitfield () noexcept = default;\n-constructs a new bitfield. The default constructor creates an empty bitfield.\n-bits is the size of the bitfield (specified in bits). val is the value to\n-initialize the bits to. If not specified all bits are initialized to 0.\n-The constructor taking a pointer b and bits copies a bitfield from the\n-specified buffer, and bits number of bits (rounded up to the nearest byte\n-boundary).\n-[report_issue]\n-***** assign() *****\n-void assign (char const* b, int const bits);\n-copy bitfield from buffer b of bits number of bits, rounded up to the nearest\n-byte boundary.\n- [report_issue]\n-***** get_bit() operator[]() *****\n-bool get_bit (int index) const noexcept;\n-bool operator[] (int index) const noexcept;\n-query bit at index. Returns true if bit is 1, otherwise false.\n- [report_issue]\n-***** set_bit() clear_bit() *****\n-void set_bit (int index) noexcept;\n-void clear_bit (int index) noexcept;\n-set bit at index to 0 (clear_bit) or 1 (set_bit).\n-[report_issue]\n-***** all_set() *****\n-bool all_set () const noexcept;\n-returns true if all bits in the bitfield are set\n-[report_issue]\n-***** none_set() *****\n-bool none_set () const noexcept;\n-returns true if no bit in the bitfield is set\n-[report_issue]\n-***** size() *****\n-int size () const noexcept;\n-returns the size of the bitfield in bits.\n-[report_issue]\n-***** num_words() *****\n-int num_words () const noexcept;\n-returns the number of 32 bit words are needed to represent all bits in this\n-bitfield.\n-[report_issue]\n-***** empty() *****\n-bool empty () const noexcept;\n-returns true if the bitfield has zero size.\n-[report_issue]\n-***** data() *****\n-char const* data () const noexcept;\n-char* data () noexcept;\n-returns a pointer to the internal buffer of the bitfield, or nullptr if it's\n-empty.\n-[report_issue]\n-***** swap() *****\n-void swap (bitfield& rhs) noexcept;\n-swaps the bit-fields two variables refer to\n-[report_issue]\n-***** count() *****\n-int count () const noexcept;\n-count the number of bits in the bitfield that are set to 1.\n-[report_issue]\n-***** find_first_set() *****\n-int find_first_set () const noexcept;\n-returns the index of the first set bit in the bitfield, i.e. 1 bit.\n-[report_issue]\n-***** find_last_clear() *****\n-int find_last_clear () const noexcept;\n-returns the index to the last cleared bit in the bitfield, i.e. 0 bit.\n-[report_issue]\n-****** bdecode_node ******\n-Declared in \"libtorrent/bdecode.hpp\"\n-Sometimes it's important to get a non-owning reference to the root node ( to be\n-able to copy it as a reference for instance). For that, use the non_owning()\n-member function.\n-There are 5 different types of nodes, see type_t.\n-struct bdecode_node\n-{\n- bdecode_node () = default;\n- bdecode_node& operator= (bdecode_node const&) &;\n- bdecode_node (bdecode_node&&) noexcept;\n- bdecode_node& operator= (bdecode_node&&) & = default;\n- bdecode_node (bdecode_node const&);\n- type_t type () const noexcept;\n- explicit operator bool () const noexcept;\n- bdecode_node non_owning () const;\n- span data_section () const noexcept;\n- std::ptrdiff_t data_offset () const noexcept;\n- bdecode_node list_at (int i) const;\n- string_view list_string_value_at (int i\n- , string_view default_val = string_view()) const;\n- int list_size () const;\n- std::int64_t list_int_value_at (int i\n- , std::int64_t default_val = 0) const;\n- std::pair dict_at (int i) const;\n- bdecode_node dict_find_dict (string_view key) const;\n- bdecode_node dict_find (string_view key) const;\n- std::int64_t dict_find_int_value (string_view key\n- , std::int64_t default_val = 0) const;\n- bdecode_node dict_find_list (string_view key) const;\n- bdecode_node dict_find_int (string_view key) const;\n- string_view dict_find_string_value (string_view key\n- , string_view default_value = string_view()) const;\n- int dict_size () const;\n- std::pair dict_at_node (int i) const;\n- bdecode_node dict_find_string (string_view key) const;\n- std::int64_t int_value () const;\n- string_view string_value () const;\n- int string_length () const;\n- char const* string_ptr () const;\n- std::ptrdiff_t string_offset () const;\n- void clear ();\n- void swap (bdecode_node& n);\n- void reserve (int tokens);\n- void switch_underlying_buffer (char const* buf) noexcept;\n- bool has_soft_error (span error) const;\n-\n- enum type_t\n- {\n- none_t,\n- dict_t,\n- list_t,\n- string_t,\n- int_t,\n- };\n-};\n-[report_issue]\n-***** bdecode_node() *****\n-bdecode_node () = default;\n-creates a default constructed node, it will have the type none_t.\n- [report_issue]\n-***** operator=() bdecode_node() *****\n-bdecode_node& operator= (bdecode_node const&) &;\n-bdecode_node (bdecode_node&&) noexcept;\n-bdecode_node& operator= (bdecode_node&&) & = default;\n-bdecode_node (bdecode_node const&);\n-For owning nodes, the copy will create a copy of the tree, but the underlying\n-buffer remains the same.\n-[report_issue]\n-***** type() *****\n-type_t type () const noexcept;\n-the type of this node. See type_t.\n-[report_issue]\n-***** bool() *****\n-explicit operator bool () const noexcept;\n-returns true if type() != none_t.\n-[report_issue]\n-***** non_owning() *****\n-bdecode_node non_owning () const;\n-return a non-owning reference to this node. This is useful to refer to the root\n-node without copying it in assignments.\n- [report_issue]\n-***** data_offset() data_section() *****\n-span data_section () const noexcept;\n-std::ptrdiff_t data_offset () const noexcept;\n-returns the buffer and length of the section in the original bencoded buffer\n-where this node is defined. For a dictionary for instance, this starts with d\n-and ends with e, and has all the content of the dictionary in between. the\n-data_offset() function returns the byte-offset to this node in, starting from\n-the beginning of the buffer that was parsed.\n- [report_issue]\n-***** list_string_value_at() list_size() list_int_value_at() list_at() *****\n-bdecode_node list_at (int i) const;\n-string_view list_string_value_at (int i\n- , string_view default_val = string_view()) const;\n-int list_size () const;\n-std::int64_t list_int_value_at (int i\n- , std::int64_t default_val = 0) const;\n-functions with the list_ prefix operate on lists. These functions are only\n-valid if type() == list_t. list_at() returns the item in the list at index i. i\n-may not be greater than or equal to the size of the list. size() returns the\n-size of the list.\n- [report_issue]\n-***** dict_find() dict_find_list() dict_find_string() dict_size()\n-dict_find_dict() dict_find_int_value() dict_at() dict_find_int()\n-dict_find_string_value() dict_at_node() *****\n-std::pair dict_at (int i) const;\n-bdecode_node dict_find_dict (string_view key) const;\n-bdecode_node dict_find (string_view key) const;\n-std::int64_t dict_find_int_value (string_view key\n- , std::int64_t default_val = 0) const;\n-bdecode_node dict_find_list (string_view key) const;\n-bdecode_node dict_find_int (string_view key) const;\n-string_view dict_find_string_value (string_view key\n- , string_view default_value = string_view()) const;\n-int dict_size () const;\n-std::pair dict_at_node (int i) const;\n-bdecode_node dict_find_string (string_view key) const;\n-Functions with the dict_ prefix operates on dictionaries. They are only valid\n-if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n-cannot use the 0-terminated string overloads, but have to use string_view\n-instead. dict_find_list will return a valid bdecode_node if the key is found\n-_and_ it is a list. Otherwise it will return a default-constructed\n-bdecode_node.\n-Functions with the _value suffix return the value of the node directly, rather\n-than the nodes. In case the node is not found, or it has a different type, a\n-default value is returned (which can be specified).\n-dict_at() returns the (key, value)-pair at the specified index in a dictionary.\n-Keys are only allowed to be strings. dict_at_node() also returns the (key,\n-value)-pair, but the key is returned as a bdecode_node (and it will always be a\n-string).\n-[report_issue]\n-***** int_value() *****\n-std::int64_t int_value () const;\n-this function is only valid if type() == int_t. It returns the value of the\n-integer.\n- [report_issue]\n-***** string_length() string_ptr() string_offset() string_value() *****\n-string_view string_value () const;\n-int string_length () const;\n-char const* string_ptr () const;\n-std::ptrdiff_t string_offset () const;\n-these functions are only valid if type() == string_t. They return the string\n-values. Note that string_ptr() is not 0-terminated. string_length() returns the\n-number of bytes in the string. string_offset() returns the byte offset from the\n-start of the parsed bencoded buffer this string can be found.\n-[report_issue]\n-***** clear() *****\n-void clear ();\n-resets the bdecoded_node to a default constructed state. If this is an owning\n-node, the tree is freed and all child nodes are invalidated.\n-[report_issue]\n-***** swap() *****\n-void swap (bdecode_node& n);\n-Swap contents.\n-[report_issue]\n-***** reserve() *****\n-void reserve (int tokens);\n-preallocate memory for the specified numbers of tokens. This is useful if you\n-know approximately how many tokens are in the file you are about to parse.\n-Doing so will save realloc operations while parsing. You should only call this\n-on the root node, before passing it in to bdecode().\n-[report_issue]\n-***** switch_underlying_buffer() *****\n-void switch_underlying_buffer (char const* buf) noexcept;\n-this buffer MUST be identical to the one originally parsed. This operation is\n-only defined on owning root nodes, i.e. the one passed in to decode().\n-[report_issue]\n-***** has_soft_error() *****\n-bool has_soft_error (span error) const;\n-returns true if there is a non-fatal error in the bencoding of this node or its\n-children\n-[report_issue]\n-***** enum type_t *****\n-Declared in \"libtorrent/bdecode.hpp\"\n- _________________________________________________________________________\n-|name____|value|description_______________________________________________|\n-|none_t |0 |uninitialized or default constructed. This is also used to|\n-|________|_____|indicate_that_a_node_was_not_found_in_some_cases._________|\n-|dict_t__|1____|a_dictionary_node._The_dict_find__functions_are_valid.____|\n-|list_t__|2____|a_list_node._The_list__functions_are_valid._______________|\n-|string_t|3____|a_string_node,_the_string__functions_are_valid.___________|\n-|int_t___|4____|an_integer_node._The_int__functions_are_valid.____________|\n-[report_issue]\n-****** print_entry() ******\n-Declared in \"libtorrent/bdecode.hpp\"\n-std::string print_entry (bdecode_node const& e\n- , bool single_line = false, int indent = 0);\n-print the bencoded structure in a human-readable format to a string that's\n-returned.\n-[report_issue]\n-****** bdecode() ******\n-Declared in \"libtorrent/bdecode.hpp\"\n-bdecode_node bdecode (span buffer\n- , int depth_limit = 100, int token_limit = 2000000);\n-bdecode_node bdecode (span buffer\n- , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n- , int token_limit = 2000000);\n-int bdecode (char const* start, char const* end, bdecode_node& ret\n- , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n- , int token_limit = 2000000);\n-This function decodes/parses bdecoded data (for example a .torrent file). The\n-data structure is returned in the ret argument. the buffer to parse is\n-specified by the start of the buffer as well as the end, i.e. one byte past the\n-end. If the buffer fails to parse, the function returns a non-zero value and\n-fills in ec with the error code. The optional argument error_pos, if set to\n-non-nullptr, will be set to the byte offset into the buffer where the parse\n-failure occurred.\n-depth_limit specifies the max number of nested lists or dictionaries are\n-allowed in the data structure. (This affects the stack usage of the function,\n-be careful not to set it too high).\n-token_limit is the max number of tokens allowed to be parsed from the buffer.\n-This is simply a sanity check to not have unbounded memory usage.\n-The resulting bdecode_node is an owning node. That means it will be holding the\n-whole parsed tree. When iterating lists and dictionaries, those bdecode_node\n-objects will simply have references to the root or owning bdecode_node. If the\n-root node is destructed, all other nodes that refer to anything in that tree\n-become invalid.\n-However, the underlying buffer passed in to this function (start, end) must\n-also remain valid while the bdecoded tree is used. The parsed tree produced by\n-this function does not copy any data out of the buffer, but simply produces\n-references back into it.\n [report_issue]\n ****** torrent_status ******\n Declared in \"libtorrent/torrent_status.hpp\"\n holds a snapshot of the status of a torrent, as queried by torrent_handle::\n status().\n struct torrent_status\n {\n@@ -12455,14 +12350,119 @@\n downloaded and available to peers. Being available to peers does not\n imply there are other peers asking for the payload.\n [report_issue]\n flags\n reflects several of the torrent's flags. For more information, see\n torrent_handle::flags().\n [report_issue]\n+****** ip_filter ******\n+Declared in \"libtorrent/ip_filter.hpp\"\n+The ip_filter class is a set of rules that uniquely categorizes all ip\n+addresses as allowed or disallowed. The default constructor creates a single\n+rule that allows all addresses (0.0.0.0 - 255.255.255.255 for the IPv4 range,\n+and the equivalent range covering all addresses for the IPv6 range).\n+A default constructed ip_filter does not filter any address.\n+struct ip_filter\n+{\n+ ip_filter& operator= (ip_filter&&);\n+ ip_filter (ip_filter&&);\n+ ip_filter& operator= (ip_filter const&);\n+ ip_filter (ip_filter const&);\n+ ip_filter ();\n+ ~ip_filter ();\n+ bool empty () const;\n+ void add_rule (address const& first, address const& last, std::uint32_t\n+flags);\n+ std::uint32_t access (address const& addr) const;\n+ filter_tuple_t export_filter () const;\n+\n+ enum access_flags\n+ {\n+ blocked,\n+ };\n+};\n+[report_issue]\n+***** empty() *****\n+bool empty () const;\n+returns true if the filter does not contain any rules\n+[report_issue]\n+***** add_rule() *****\n+void add_rule (address const& first, address const& last, std::uint32_t flags);\n+Adds a rule to the filter. first and last defines a range of ip addresses that\n+will be marked with the given flags. The flags can currently be 0, which means\n+allowed, or ip_filter::blocked, which means disallowed.\n+precondition: first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()\n+postcondition: access(x) == flags for every x in the range [first, last]\n+This means that in a case of overlapping ranges, the last one applied takes\n+precedence.\n+[report_issue]\n+***** access() *****\n+std::uint32_t access (address const& addr) const;\n+Returns the access permissions for the given address (addr). The permission can\n+currently be 0 or ip_filter::blocked. The complexity of this operation is O(log\n+n), where n is the minimum number of non-overlapping ranges to describe the\n+current filter.\n+[report_issue]\n+***** export_filter() *****\n+filter_tuple_t export_filter () const;\n+This function will return the current state of the filter in the minimum number\n+of ranges possible. They are sorted from ranges in low addresses to high\n+addresses. Each entry in the returned vector is a range with the access control\n+specified in its flags field.\n+The return value is a tuple containing two range-lists. One for IPv4 addresses\n+and one for IPv6 addresses.\n+[report_issue]\n+***** enum access_flags *****\n+Declared in \"libtorrent/ip_filter.hpp\"\n+ _____________________________________________________________________________\n+|name___|value|description____________________________________________________|\n+|blocked|1 |indicates that IPs in this range should not be connected to nor|\n+|_______|_____|accepted_as_incoming_connections_______________________________|\n+[report_issue]\n+****** port_filter ******\n+Declared in \"libtorrent/ip_filter.hpp\"\n+the port filter maps non-overlapping port ranges to flags. This is primarily\n+used to indicate whether a range of ports should be connected to or not. The\n+default is to have the full port range (0-65535) set to flag 0.\n+class port_filter\n+{\n+ port_filter (port_filter&&);\n+ ~port_filter ();\n+ port_filter& operator= (port_filter const&);\n+ port_filter ();\n+ port_filter& operator= (port_filter&&);\n+ port_filter (port_filter const&);\n+ void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t\n+flags);\n+ std::uint32_t access (std::uint16_t port) const;\n+\n+ enum access_flags\n+ {\n+ blocked,\n+ };\n+};\n+[report_issue]\n+***** add_rule() *****\n+void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n+set the flags for the specified port range (first, last) to flags overwriting\n+any existing rule for those ports. The range is inclusive, i.e. the port last\n+also has the flag set on it.\n+[report_issue]\n+***** access() *****\n+std::uint32_t access (std::uint16_t port) const;\n+test the specified port (port) for whether it is blocked or not. The returned\n+value is the flags set for this port. see access_flags.\n+[report_issue]\n+***** enum access_flags *****\n+Declared in \"libtorrent/ip_filter.hpp\"\n+ ____________________________________________________________________________\n+|name___|value|description___________________________________________________|\n+|blocked|1 |this flag indicates that destination ports in the range should|\n+|_______|_____|not_be_connected_to___________________________________________|\n+[report_issue]\n ****** dht_storage_counters ******\n Declared in \"libtorrent/kademlia/dht_storage.hpp\"\n This structure hold the relevant counters for the storage\n struct dht_storage_counters\n {\n void reset ();\n \n@@ -12647,56 +12647,56 @@\n [report_issue]\n nodes\n the bootstrap nodes saved from the buckets node\n [report_issue]\n nodes6\n the bootstrap nodes saved from the IPv6 buckets node\n [report_issue]\n-****** dht_default_storage_constructor() ******\n-Declared in \"libtorrent/kademlia/dht_storage.hpp\"\n-std::unique_ptr dht_default_storage_constructor (\n- settings_interface const& settings);\n-constructor for the default DHT storage. The DHT storage is responsible for\n-maintaining peers and mutable and immutable items announced and stored/put to\n-the DHT node.\n-[report_issue]\n ****** sign_mutable_item() ******\n Declared in \"libtorrent/kademlia/item.hpp\"\n signature sign_mutable_item (\n span v\n , span salt\n , sequence_number seq\n , public_key const& pk\n , secret_key const& sk);\n given a byte range v and an optional byte range salt, a sequence number, public\n key pk (must be 32 bytes) and a secret key sk (must be 64 bytes), this function\n produces a signature which is written into a 64 byte buffer pointed to by sig.\n The caller is responsible for allocating the destination buffer that's passed\n in as the sig argument. Typically it would be allocated on the stack.\n [report_issue]\n+****** dht_default_storage_constructor() ******\n+Declared in \"libtorrent/kademlia/dht_storage.hpp\"\n+std::unique_ptr dht_default_storage_constructor (\n+ settings_interface const& settings);\n+constructor for the default DHT storage. The DHT storage is responsible for\n+maintaining peers and mutable and immutable items announced and stored/put to\n+the DHT node.\n+[report_issue]\n ****** announce_flags_t ******\n Declared in \"libtorrent/kademlia/announce_flags.hpp\"\n seed\n announce to DHT as a seed\n implied_port\n announce to DHT with the implied-port flag set. This tells the network to\n use your source UDP port as your listen port, rather than the one\n specified in the message. This may improve the chances of traversing NATs\n when using uTP.\n ssl_torrent\n Specify the port number for the SSL listen socket in the DHT announce.\n [report_issue]\n ****** write_resume_data() write_resume_data_buf() ******\n Declared in \"libtorrent/write_resume_data.hpp\"\n-std::vector write_resume_data_buf (add_torrent_params const& atp);\n entry write_resume_data (add_torrent_params const& atp);\n+std::vector write_resume_data_buf (add_torrent_params const& atp);\n this function turns the resume data in an add_torrent_params object into a\n bencoded structure\n [report_issue]\n-****** write_torrent_file() write_torrent_file_buf() ******\n+****** write_torrent_file_buf() write_torrent_file() ******\n Declared in \"libtorrent/write_resume_data.hpp\"\n entry write_torrent_file (add_torrent_params const& atp, write_torrent_flags_t\n flags);\n std::vector write_torrent_file_buf (add_torrent_params const& atp\n , write_torrent_flags_t flags);\n entry write_torrent_file (add_torrent_params const& atp);\n writes only the fields to create a .torrent file. This function may fail with a\n@@ -12711,17 +12711,17 @@\n ****** read_resume_data() ******\n Declared in \"libtorrent/read_resume_data.hpp\"\n add_torrent_params read_resume_data (span buffer\n , error_code& ec, load_torrent_limits const& cfg = {});\n add_torrent_params read_resume_data (span buffer\n , load_torrent_limits const& cfg = {});\n add_torrent_params read_resume_data (bdecode_node const& rd\n- , int piece_limit = 0x200000);\n-add_torrent_params read_resume_data (bdecode_node const& rd\n , error_code& ec, int piece_limit = 0x200000);\n+add_torrent_params read_resume_data (bdecode_node const& rd\n+ , int piece_limit = 0x200000);\n these functions are used to parse resume data and populate the appropriate\n fields in an add_torrent_params object. This object can then be used to add the\n actual torrent_info object to and pass to session::add_torrent() or session::\n async_add_torrent().\n If the client wants to override any field that was loaded from the resume data,\n e.g. save_path, those fields must be changed after loading resume data but\n before adding the torrent.\n"}]}]}]}]}, {"source1": "python3-libtorrent_2.0.8-1_armhf.deb", "source2": "python3-libtorrent_2.0.8-1_armhf.deb", "unified_diff": null, "details": [{"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,15 +1,15 @@\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./usr/\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./usr/lib/\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./usr/lib/python3/\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./usr/lib/python3/dist-packages/\n -rw-r--r-- 0 root (0) root (0) 3929608 2022-10-23 15:10:21.000000 ./usr/lib/python3/dist-packages/libtorrent.cpython-311-arm-linux-gnueabihf.so\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/\n--rw-r--r-- 0 root (0) root (0) 272 2022-10-23 15:10:21.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/PKG-INFO\n+-rw-r--r-- 0 root (0) root (0) 273 2022-10-23 15:10:21.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/PKG-INFO\n -rw-r--r-- 0 root (0) root (0) 1 2022-10-23 15:10:21.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/dependency_links.txt\n -rw-r--r-- 0 root (0) root (0) 17 2022-10-23 15:10:21.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/top_level.txt\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./usr/share/\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./usr/share/doc/\n drwxr-xr-x 0 root (0) root (0) 0 2022-10-23 15:10:21.000000 ./usr/share/doc/python3-libtorrent/\n -rw-r--r-- 0 root (0) root (0) 2045 2022-10-23 15:10:21.000000 ./usr/share/doc/python3-libtorrent/changelog.Debian.gz\n -rw-r--r-- 0 root (0) root (0) 32554 2022-10-23 11:28:40.000000 ./usr/share/doc/python3-libtorrent/changelog.gz\n"}, {"source1": "./usr/lib/python3/dist-packages/libtorrent.egg-info/PKG-INFO", "source2": "./usr/lib/python3/dist-packages/libtorrent.egg-info/PKG-INFO", "unified_diff": "@@ -2,10 +2,10 @@\n Name: libtorrent\n Version: 2.0.8\n Summary: Python bindings for libtorrent-rasterbar\n Home-page: http://libtorrent.org\n Author: Arvid Norberg\n Author-email: arvid@libtorrent.org\n License: BSD\n-Platform: Linux-armv7l\n+Platform: Linux-aarch64\n \n Python bindings for libtorrent-rasterbar\n"}]}]}]}]}