--- /srv/rebuilderd/tmp/rebuilderdg8kohs/inputs/libtorrent-rasterbar-doc_2.0.11-1_all.deb +++ /srv/rebuilderd/tmp/rebuilderdg8kohs/out/libtorrent-rasterbar-doc_2.0.11-1_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2025-01-28 14:33:12.000000 debian-binary │ --rw-r--r-- 0 0 0 3628 2025-01-28 14:33:12.000000 control.tar.xz │ --rw-r--r-- 0 0 0 1666144 2025-01-28 14:33:12.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 3624 2025-01-28 14:33:12.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 1669440 2025-01-28 14:33:12.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./control │ │ │ @@ -1,13 +1,13 @@ │ │ │ Package: libtorrent-rasterbar-doc │ │ │ Source: libtorrent-rasterbar │ │ │ Version: 2.0.11-1 │ │ │ Architecture: all │ │ │ Maintainer: Christian Marillat │ │ │ -Installed-Size: 5773 │ │ │ +Installed-Size: 5941 │ │ │ Section: doc │ │ │ Priority: optional │ │ │ Multi-Arch: foreign │ │ │ Homepage: https://libtorrent.org/ │ │ │ Description: Documentation for libtorrent-rasterbar │ │ │ Bittorrent library by Rasterbar Software (Arvid Norberg). │ │ │ libtorrent-rasterbar is a C++ library that aims to be a good alternative to │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -82,34 +82,34 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 22814 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/python_binding.html │ │ │ -rw-r--r-- 0 root (0) root (0) 33687 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Add_Torrent.html │ │ │ -rw-r--r-- 0 root (0) root (0) 256772 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Alerts.html │ │ │ -rw-r--r-- 0 root (0) root (0) 27437 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25856 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html │ │ │ -rw-r--r-- 0 root (0) root (0) 88949 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html │ │ │ -rw-r--r-- 0 root (0) root (0) 43859 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Create_Torrents.html │ │ │ --rw-r--r-- 0 root (0) root (0) 50915 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 137008 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html │ │ │ -rw-r--r-- 0 root (0) root (0) 24960 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html │ │ │ -rw-r--r-- 0 root (0) root (0) 48763 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 13261 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Filter.html │ │ │ -rw-r--r-- 0 root (0) root (0) 12804 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-PeerClass.html │ │ │ -rw-r--r-- 0 root (0) root (0) 68487 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9618 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html │ │ │ -rw-r--r-- 0 root (0) root (0) 102455 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html │ │ │ -rw-r--r-- 0 root (0) root (0) 169276 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9742 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html │ │ │ --rw-r--r-- 0 root (0) root (0) 56856 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 56848 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html │ │ │ -rw-r--r-- 0 root (0) root (0) 129801 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html │ │ │ --rw-r--r-- 0 root (0) root (0) 55640 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 55632 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html │ │ │ -rw-r--r-- 0 root (0) root (0) 48385 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html │ │ │ -rw-r--r-- 0 root (0) root (0) 16462 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25530 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html │ │ │ -rw-r--r-- 0 root (0) root (0) 9129 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-ed25519.html │ │ │ -rw-r--r-- 0 root (0) root (0) 34353 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html │ │ │ -rw-r--r-- 0 root (0) root (0) 29242 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/security-audit.html │ │ │ --rw-r--r-- 0 root (0) root (0) 1274764 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 1360841 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html │ │ │ -rw-r--r-- 0 root (0) root (0) 10121 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/streaming.html │ │ │ -rw-r--r-- 0 root (0) root (0) 8807 2025-01-28 10:57:42.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/style.css │ │ │ -rw-r--r-- 0 root (0) root (0) 522888 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html │ │ │ -rw-r--r-- 0 root (0) root (0) 3023 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/troubleshooting.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25162 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tuning-ref.html │ │ │ -rw-r--r-- 0 root (0) root (0) 132630 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tutorial-ref.html │ │ │ -rw-r--r-- 0 root (0) root (0) 16383 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/udp_tracker_protocol.html │ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html │ │ │ @@ -100,15 +100,15 @@ │ │ │ the session, it contains the main loop that serves all torrents.

│ │ │

The basic usage is as follows:

│ │ │ │ │ │ │ │ │
  • add_files()
  • │ │ │
  • set_piece_hashes()
  • │ │ │ │ │ │ │ │ │

    This section describes the functions and classes that are used │ │ │ @@ -105,19 +105,19 @@ │ │ │

    This class holds state for creating a torrent. After having added │ │ │ all information to it, call create_torrent::generate() to generate │ │ │ the torrent. The entry that's returned can then be bencoded into a │ │ │ .torrent file using bencode().

    │ │ │
    │ │ │  struct create_torrent
    │ │ │  {
    │ │ │ +   explicit create_torrent (torrent_info const& ti);
    │ │ │     explicit create_torrent (file_storage& fs, int piece_size = 0
    │ │ │        , create_flags_t flags = {});
    │ │ │ -   explicit create_torrent (torrent_info const& ti);
    │ │ │ -   entry generate () const;
    │ │ │     std::vector<char> generate_buf () const;
    │ │ │ +   entry generate () const;
    │ │ │     file_storage const& files () const;
    │ │ │     void set_comment (char const* str);
    │ │ │     void set_creator (char const* str);
    │ │ │     void set_creation_date (std::time_t timestamp);
    │ │ │     void set_hash (piece_index_t index, sha1_hash const& h);
    │ │ │     void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);
    │ │ │     void add_url_seed (string_view url);
    │ │ │ @@ -132,34 +132,34 @@
    │ │ │     int num_pieces () const;
    │ │ │     piece_index_t end_piece () const;
    │ │ │     index_range<piece_index_t> piece_range () const noexcept;
    │ │ │     file_index_t end_file () const;
    │ │ │     index_range<file_index_t> file_range () const noexcept;
    │ │ │     index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);
    │ │ │     std::int64_t total_size () const;
    │ │ │ -   int piece_length () const;
    │ │ │     int piece_size (piece_index_t i) const;
    │ │ │ -   void add_collection (string_view c);
    │ │ │ +   int piece_length () const;
    │ │ │     void add_similar_torrent (sha1_hash ih);
    │ │ │ +   void add_collection (string_view c);
    │ │ │  
    │ │ │     static constexpr create_flags_t modification_time  = 2_bit;
    │ │ │     static constexpr create_flags_t symlinks  = 3_bit;
    │ │ │     static constexpr create_flags_t v2_only  = 5_bit;
    │ │ │     static constexpr create_flags_t v1_only  = 6_bit;
    │ │ │     static constexpr create_flags_t canonical_files  = 7_bit;
    │ │ │     static constexpr create_flags_t no_attributes  = 8_bit;
    │ │ │     static constexpr create_flags_t canonical_files_no_tail_padding  = 9_bit;
    │ │ │  };
    │ │ │  
    │ │ │ [report issue]
    │ │ │

    create_torrent()

    │ │ │
    │ │ │ +explicit create_torrent (torrent_info const& ti);
    │ │ │  explicit create_torrent (file_storage& fs, int piece_size = 0
    │ │ │        , create_flags_t flags = {});
    │ │ │ -explicit create_torrent (torrent_info const& ti);
    │ │ │  
    │ │ │

    The piece_size is the size of each piece in bytes. It must be a │ │ │ power of 2 and a minimum of 16 kiB. If a piece size of 0 is │ │ │ specified, a piece_size will be set automatically. │ │ │ Piece sizes greater than 128 MiB are considered unreasonable and will │ │ │ be rejected (with an lt::system_error exception).

    │ │ │

    The flags arguments specifies options for the torrent creation. It can │ │ │ @@ -180,16 +180,16 @@ │ │ │ entire duration of the create_torrent object.

    │ │ │
    │ │ │ │ │ │ [report issue] │ │ │
    │ │ │

    generate() generate_buf()

    │ │ │
    │ │ │ -entry generate () const;
    │ │ │  std::vector<char> generate_buf () const;
    │ │ │ +entry generate () const;
    │ │ │  
    │ │ │

    This function will generate the .torrent file as a bencode tree, or a │ │ │ bencoded into a buffer. │ │ │ In order to encode the entry into a flat file, use the bencode() function.

    │ │ │

    The function returning an entry may be useful to add custom entries │ │ │ to the torrent file before bencoding it and saving it to disk.

    │ │ │

    Whether the resulting torrent object is v1, v2 or hybrid depends on │ │ │ @@ -369,32 +369,32 @@ │ │ │ [report issue]

    │ │ │
    │ │ │

    total_size()

    │ │ │
    │ │ │  std::int64_t total_size () const;
    │ │ │  
    │ │ │

    the total number of bytes of all files and pad files

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    piece_length() piece_size()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    piece_size() piece_length()

    │ │ │
    │ │ │ -int piece_length () const;
    │ │ │  int piece_size (piece_index_t i) const;
    │ │ │ +int piece_length () const;
    │ │ │  
    │ │ │

    piece_length() returns the piece size of all pieces but the │ │ │ last one. piece_size() returns the size of the specified piece. │ │ │ these functions are just forwarding to the associated file_storage.

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    add_similar_torrent() add_collection()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    add_collection() add_similar_torrent()

    │ │ │
    │ │ │ -void add_collection (string_view c);
    │ │ │  void add_similar_torrent (sha1_hash ih);
    │ │ │ +void add_collection (string_view c);
    │ │ │  
    │ │ │

    Add similar torrents (by info-hash) or collections of similar torrents. │ │ │ Similar torrents are expected to share some files with this torrent. │ │ │ Torrents sharing a collection name with this torrent are also expected │ │ │ to share files with this torrent. A torrent may have more than one │ │ │ collection and more than one similar torrents. For more information, │ │ │ see BEP 38.

    │ │ │ @@ -459,17 +459,17 @@ │ │ │ [report issue]
    │ │ │ │ │ │
    │ │ │

    add_files()

    │ │ │

    Declared in "libtorrent/create_torrent.hpp"

    │ │ │
    │ │ │  void add_files (file_storage& fs, std::string const& file
    │ │ │ -   , create_flags_t flags = {});
    │ │ │ -void add_files (file_storage& fs, std::string const& file
    │ │ │     , std::function<bool(std::string)> p, create_flags_t flags = {});
    │ │ │ +void add_files (file_storage& fs, std::string const& file
    │ │ │ +   , create_flags_t flags = {});
    │ │ │  
    │ │ │

    Adds the file specified by path to the file_storage object. In case path │ │ │ refers to a directory, files will be added recursively from the directory.

    │ │ │

    If specified, the predicate p is called once for every file and directory that │ │ │ is encountered. Files for which p returns true are added, and directories for │ │ │ which p returns true are traversed. p must have the following signature:

    │ │ │
    │ │ │ @@ -482,29 +482,29 @@
    │ │ │  

    The flags argument should be the same as the flags passed to the create_torrent │ │ │ constructor.

    │ │ │ [report issue]
    │ │ │
    │ │ │

    set_piece_hashes()

    │ │ │

    Declared in "libtorrent/create_torrent.hpp"

    │ │ │
    │ │ │ -void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │ +inline void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │ +   , std::function<void(piece_index_t)> const& f);
    │ │ │ +inline void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │     , settings_interface const& settings
    │ │ │ -   , std::function<void(piece_index_t)> const& f, error_code& ec);
    │ │ │ +   , std::function<void(piece_index_t)> const& f);
    │ │ │  void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │     , std::function<void(piece_index_t)> const& f, error_code& ec);
    │ │ │ -inline void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │ -   , std::function<void(piece_index_t)> const& f);
    │ │ │ +inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);
    │ │ │  void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │     , settings_interface const& settings, disk_io_constructor_type disk_io
    │ │ │     , std::function<void(piece_index_t)> const& f, error_code& ec);
    │ │ │ -inline void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │ +void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │     , settings_interface const& settings
    │ │ │ -   , std::function<void(piece_index_t)> const& f);
    │ │ │ +   , std::function<void(piece_index_t)> const& f, error_code& ec);
    │ │ │  inline void set_piece_hashes (create_torrent& t, std::string const& p);
    │ │ │ -inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);
    │ │ │  
    │ │ │

    This function will assume that the files added to the torrent file exists at path │ │ │ p, read those files and hash the content and set the hashes in the create_torrent │ │ │ object. The optional function f is called in between every hash that is set. f │ │ │ must have the following signature:

    │ │ │
    │ │ │  void Fun(piece_index_t);
    │ │ │ ├── html2text {}
    │ │ │ │ @@ -18,16 +18,16 @@
    │ │ │ │            o _s_e_t___r_o_o_t___c_e_r_t_(_)
    │ │ │ │            o _s_e_t___p_r_i_v_(_)_ _p_r_i_v_(_)
    │ │ │ │            o _n_u_m___p_i_e_c_e_s_(_)
    │ │ │ │            o _p_i_e_c_e___r_a_n_g_e_(_)
    │ │ │ │            o _f_i_l_e___r_a_n_g_e_(_)
    │ │ │ │            o _f_i_l_e___p_i_e_c_e___r_a_n_g_e_(_)
    │ │ │ │            o _t_o_t_a_l___s_i_z_e_(_)
    │ │ │ │ -          o _p_i_e_c_e___l_e_n_g_t_h_(_)_ _p_i_e_c_e___s_i_z_e_(_)
    │ │ │ │ -          o _a_d_d___s_i_m_i_l_a_r___t_o_r_r_e_n_t_(_)_ _a_d_d___c_o_l_l_e_c_t_i_o_n_(_)
    │ │ │ │ +          o _p_i_e_c_e___s_i_z_e_(_)_ _p_i_e_c_e___l_e_n_g_t_h_(_)
    │ │ │ │ +          o _a_d_d___c_o_l_l_e_c_t_i_o_n_(_)_ _a_d_d___s_i_m_i_l_a_r___t_o_r_r_e_n_t_(_)
    │ │ │ │      * _a_d_d___f_i_l_e_s_(_)
    │ │ │ │      * _s_e_t___p_i_e_c_e___h_a_s_h_e_s_(_)
    │ │ │ │  This section describes the functions and classes that are used to create
    │ │ │ │  torrent files. It is a layered API with low level classes and higher level
    │ │ │ │  convenience functions. A torrent is created in 4 steps:
    │ │ │ │     1. first the files that will be part of the torrent are determined.
    │ │ │ │     2. the torrent properties are set, such as tracker url, web seeds, DHT nodes
    │ │ │ │ @@ -66,19 +66,19 @@
    │ │ │ │  Declared in "_l_i_b_t_o_r_r_e_n_t_/_c_r_e_a_t_e___t_o_r_r_e_n_t_._h_p_p"
    │ │ │ │  This class holds state for creating a torrent. After having added all
    │ │ │ │  information to it, call _c_r_e_a_t_e___t_o_r_r_e_n_t_:_:_g_e_n_e_r_a_t_e_(_) to generate the torrent. The
    │ │ │ │  _e_n_t_r_y that's returned can then be bencoded into a .torrent file using _b_e_n_c_o_d_e
    │ │ │ │  _(_).
    │ │ │ │  struct create_torrent
    │ │ │ │  {
    │ │ │ │ +   explicit ccrreeaattee__ttoorrrreenntt (torrent_info const& ti);
    │ │ │ │     explicit ccrreeaattee__ttoorrrreenntt (file_storage& fs, int piece_size = 0
    │ │ │ │        , create_flags_t flags = {});
    │ │ │ │ -   explicit ccrreeaattee__ttoorrrreenntt (torrent_info const& ti);
    │ │ │ │ -   entry ggeenneerraattee () const;
    │ │ │ │     std::vector ggeenneerraattee__bbuuff () const;
    │ │ │ │ +   entry ggeenneerraattee () const;
    │ │ │ │     file_storage const& ffiilleess () const;
    │ │ │ │     void sseett__ccoommmmeenntt (char const* str);
    │ │ │ │     void sseett__ccrreeaattoorr (char const* str);
    │ │ │ │     void sseett__ccrreeaattiioonn__ddaattee (std::time_t timestamp);
    │ │ │ │     void sseett__hhaasshh (piece_index_t index, sha1_hash const& h);
    │ │ │ │     void sseett__hhaasshh22 (file_index_t file, piece_index_t::diff_type piece,
    │ │ │ │  sha256_hash const& h);
    │ │ │ │ @@ -94,32 +94,32 @@
    │ │ │ │     int nnuumm__ppiieecceess () const;
    │ │ │ │     piece_index_t eenndd__ppiieeccee () const;
    │ │ │ │     index_range ppiieeccee__rraannggee () const noexcept;
    │ │ │ │     file_index_t eenndd__ffiillee () const;
    │ │ │ │     index_range ffiillee__rraannggee () const noexcept;
    │ │ │ │     index_range ffiillee__ppiieeccee__rraannggee (file_index_t f);
    │ │ │ │     std::int64_t ttoottaall__ssiizzee () const;
    │ │ │ │ -   int ppiieeccee__lleennggtthh () const;
    │ │ │ │     int ppiieeccee__ssiizzee (piece_index_t i) const;
    │ │ │ │ -   void aadddd__ccoolllleeccttiioonn (string_view c);
    │ │ │ │ +   int ppiieeccee__lleennggtthh () const;
    │ │ │ │     void aadddd__ssiimmiillaarr__ttoorrrreenntt (sha1_hash ih);
    │ │ │ │ +   void aadddd__ccoolllleeccttiioonn (string_view c);
    │ │ │ │  
    │ │ │ │     static constexpr create_flags_t mmooddiiffiiccaattiioonn__ttiimmee  = 2_bit;
    │ │ │ │     static constexpr create_flags_t ssyymmlliinnkkss  = 3_bit;
    │ │ │ │     static constexpr create_flags_t vv22__oonnllyy  = 5_bit;
    │ │ │ │     static constexpr create_flags_t vv11__oonnllyy  = 6_bit;
    │ │ │ │     static constexpr create_flags_t ccaannoonniiccaall__ffiilleess  = 7_bit;
    │ │ │ │     static constexpr create_flags_t nnoo__aattttrriibbuutteess  = 8_bit;
    │ │ │ │     static constexpr create_flags_t ccaannoonniiccaall__ffiilleess__nnoo__ttaaiill__ppaaddddiinngg  = 9_bit;
    │ │ │ │  };
    │ │ │ │  [_r_e_p_o_r_t_ _i_s_s_u_e]
    │ │ │ │  ********** ccrreeaattee__ttoorrrreenntt(()) **********
    │ │ │ │ +explicit ccrreeaattee__ttoorrrreenntt (torrent_info const& ti);
    │ │ │ │  explicit ccrreeaattee__ttoorrrreenntt (file_storage& fs, int piece_size = 0
    │ │ │ │        , create_flags_t flags = {});
    │ │ │ │ -explicit ccrreeaattee__ttoorrrreenntt (torrent_info const& ti);
    │ │ │ │  The piece_size is the size of each piece in bytes. It must be a power of 2 and
    │ │ │ │  a minimum of 16 kiB. If a piece size of 0 is specified, a piece_size will be
    │ │ │ │  set automatically. Piece sizes greater than 128 MiB are considered unreasonable
    │ │ │ │  and will be rejected (with an lt::system_error exception).
    │ │ │ │  The flags arguments specifies options for the torrent creation. It can be any
    │ │ │ │  combination of the flags defined by create_flags_t.
    │ │ │ │  The _f_i_l_e___s_t_o_r_a_g_e (fs) parameter defines the files, sizes and their properties
    │ │ │ │ @@ -132,16 +132,16 @@
    │ │ │ │  (such as _s_e_t___h_a_s_h_(_)), will have any affect. Instead of using this overload,
    │ │ │ │  consider using _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_) instead.
    │ │ │ │  Warning
    │ │ │ │  The _f_i_l_e___s_t_o_r_a_g_e and _t_o_r_r_e_n_t___i_n_f_o objects must stay alive for the entire
    │ │ │ │  duration of the _c_r_e_a_t_e___t_o_r_r_e_n_t object.
    │ │ │ │  [_r_e_p_o_r_t_ _i_s_s_u_e]
    │ │ │ │  ********** ggeenneerraattee(()) ggeenneerraattee__bbuuff(()) **********
    │ │ │ │ -entry ggeenneerraattee () const;
    │ │ │ │  std::vector ggeenneerraattee__bbuuff () const;
    │ │ │ │ +entry ggeenneerraattee () const;
    │ │ │ │  This function will generate the .torrent file as a bencode tree, or a bencoded
    │ │ │ │  into a buffer. In order to encode the _e_n_t_r_y into a flat file, use the _b_e_n_c_o_d_e_(_)
    │ │ │ │  function.
    │ │ │ │  The function returning an _e_n_t_r_y may be useful to add custom entries to the
    │ │ │ │  torrent file before bencoding it and saving it to disk.
    │ │ │ │  Whether the resulting torrent object is v1, v2 or hybrid depends on whether any
    │ │ │ │  of the v1_only or v2_only flags were set on the constructor. If neither were
    │ │ │ │ @@ -263,24 +263,24 @@
    │ │ │ │  for v2 and hybrid torrents only, the pieces in the specified file, specified as
    │ │ │ │  delta from the first piece in the file. i.e. the first index is 0.
    │ │ │ │  [_r_e_p_o_r_t_ _i_s_s_u_e]
    │ │ │ │  ********** ttoottaall__ssiizzee(()) **********
    │ │ │ │  std::int64_t ttoottaall__ssiizzee () const;
    │ │ │ │  the total number of bytes of all files and pad files
    │ │ │ │  [_r_e_p_o_r_t_ _i_s_s_u_e]
    │ │ │ │ -********** ppiieeccee__lleennggtthh(()) ppiieeccee__ssiizzee(()) **********
    │ │ │ │ -int ppiieeccee__lleennggtthh () const;
    │ │ │ │ +********** ppiieeccee__ssiizzee(()) ppiieeccee__lleennggtthh(()) **********
    │ │ │ │  int ppiieeccee__ssiizzee (piece_index_t i) const;
    │ │ │ │ +int ppiieeccee__lleennggtthh () const;
    │ │ │ │  piece_length() returns the piece size of all pieces but the last one.
    │ │ │ │  piece_size() returns the size of the specified piece. these functions are just
    │ │ │ │  forwarding to the associated _f_i_l_e___s_t_o_r_a_g_e.
    │ │ │ │  [_r_e_p_o_r_t_ _i_s_s_u_e]
    │ │ │ │ -********** aadddd__ssiimmiillaarr__ttoorrrreenntt(()) aadddd__ccoolllleeccttiioonn(()) **********
    │ │ │ │ -void aadddd__ccoolllleeccttiioonn (string_view c);
    │ │ │ │ +********** aadddd__ccoolllleeccttiioonn(()) aadddd__ssiimmiillaarr__ttoorrrreenntt(()) **********
    │ │ │ │  void aadddd__ssiimmiillaarr__ttoorrrreenntt (sha1_hash ih);
    │ │ │ │ +void aadddd__ccoolllleeccttiioonn (string_view c);
    │ │ │ │  Add similar torrents (by info-hash) or collections of similar torrents. Similar
    │ │ │ │  torrents are expected to share some files with this torrent. Torrents sharing a
    │ │ │ │  collection name with this torrent are also expected to share files with this
    │ │ │ │  torrent. A torrent may have more than one collection and more than one similar
    │ │ │ │  torrents. For more information, see _B_E_P_ _3_8.
    │ │ │ │  [_r_e_p_o_r_t_ _i_s_s_u_e]
    │ │ │ │    modification_time
    │ │ │ │ @@ -330,17 +330,17 @@
    │ │ │ │        behavior deviates from the specification but was the way libtorrent
    │ │ │ │        created torrents in version up to and including 2.0.7. This flag is here
    │ │ │ │        for backwards compatibility.
    │ │ │ │  [_r_e_p_o_r_t_ _i_s_s_u_e]
    │ │ │ │  ************ aadddd__ffiilleess(()) ************
    │ │ │ │  Declared in "_l_i_b_t_o_r_r_e_n_t_/_c_r_e_a_t_e___t_o_r_r_e_n_t_._h_p_p"
    │ │ │ │  void aadddd__ffiilleess (file_storage& fs, std::string const& file
    │ │ │ │ -   , create_flags_t flags = {});
    │ │ │ │ -void aadddd__ffiilleess (file_storage& fs, std::string const& file
    │ │ │ │     , std::function p, create_flags_t flags = {});
    │ │ │ │ +void aadddd__ffiilleess (file_storage& fs, std::string const& file
    │ │ │ │ +   , create_flags_t flags = {});
    │ │ │ │  Adds the file specified by path to the _f_i_l_e___s_t_o_r_a_g_e object. In case path refers
    │ │ │ │  to a directory, files will be added recursively from the directory.
    │ │ │ │  If specified, the predicate p is called once for every file and directory that
    │ │ │ │  is encountered. Files for which p returns true are added, and directories for
    │ │ │ │  which p returns true are traversed. p must have the following signature:
    │ │ │ │  bool Pred(std::string const& p);
    │ │ │ │  The path that is passed in to the predicate is the full path of the file or
    │ │ │ │ @@ -348,30 +348,30 @@
    │ │ │ │  directories are traversed.
    │ │ │ │  The ".." directory is never traversed.
    │ │ │ │  The flags argument should be the same as the flags passed to the _c_r_e_a_t_e___t_o_r_r_e_n_t
    │ │ │ │  constructor.
    │ │ │ │  [_r_e_p_o_r_t_ _i_s_s_u_e]
    │ │ │ │  ************ sseett__ppiieeccee__hhaasshheess(()) ************
    │ │ │ │  Declared in "_l_i_b_t_o_r_r_e_n_t_/_c_r_e_a_t_e___t_o_r_r_e_n_t_._h_p_p"
    │ │ │ │ -void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p
    │ │ │ │ +inline void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p
    │ │ │ │ +   , std::function const& f);
    │ │ │ │ +inline void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p
    │ │ │ │     , settings_interface const& settings
    │ │ │ │ -   , std::function const& f, error_code& ec);
    │ │ │ │ +   , std::function const& f);
    │ │ │ │  void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p
    │ │ │ │     , std::function const& f, error_code& ec);
    │ │ │ │ -inline void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p
    │ │ │ │ -   , std::function const& f);
    │ │ │ │ +inline void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p,
    │ │ │ │ +error_code& ec);
    │ │ │ │  void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p
    │ │ │ │     , settings_interface const& settings, disk_io_constructor_type disk_io
    │ │ │ │     , std::function const& f, error_code& ec);
    │ │ │ │ -inline void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p
    │ │ │ │ +void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p
    │ │ │ │     , settings_interface const& settings
    │ │ │ │ -   , std::function const& f);
    │ │ │ │ +   , std::function const& f, error_code& ec);
    │ │ │ │  inline void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p);
    │ │ │ │ -inline void sseett__ppiieeccee__hhaasshheess (create_torrent& t, std::string const& p,
    │ │ │ │ -error_code& ec);
    │ │ │ │  This function will assume that the files added to the torrent file exists at
    │ │ │ │  path p, read those files and hash the content and set the hashes in the
    │ │ │ │  create_torrent object. The optional function f is called in between every hash
    │ │ │ │  that is set. f must have the following signature:
    │ │ │ │  void Fun(piece_index_t);
    │ │ │ │  The overloads taking a _s_e_t_t_i_n_g_s___p_a_c_k may be used to configure the underlying
    │ │ │ │  disk access. Such as settings_pack::aio_threads.
    │ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html
    │ │ │ @@ -28,69 +28,345 @@
    │ │ │  2.0.11
    │ │ │  
    │ │ │  
    │ │ │  

    home

    │ │ │
    │ │ │

    Table of contents

    │ │ │
    │ │ │ -

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

    │ │ │ -

    The settings_pack object is a collection of settings updates that are applied │ │ │ -to the session when passed to session::apply_settings(). It's empty when │ │ │ -constructed.

    │ │ │ -

    You have control over proxy and authorization settings and also the user-agent │ │ │ -that will be sent to the tracker. The user-agent will also be used to identify the │ │ │ -client with other peers.

    │ │ │ -

    Each configuration option is named with an enum value inside the │ │ │ -settings_pack class. These are the available settings:

    │ │ │ -[report issue]
    │ │ │ +

    The disk I/O can be customized in libtorrent. In previous versions, the │ │ │ +customization was at the level of each torrent. Now, the customization point │ │ │ +is at the session level. All torrents added to a session will use the same │ │ │ +disk I/O subsystem, as determined by the disk_io_constructor (in │ │ │ +session_params).

    │ │ │ +

    This allows the disk subsystem to also customize threading and disk job │ │ │ +management.

    │ │ │ +

    To customize the disk subsystem, implement disk_interface and provide a │ │ │ +factory function to the session constructor (via session_params).

    │ │ │ +

    Example use:

    │ │ │ +
    │ │ │ +struct temp_storage
    │ │ │ +{
    │ │ │ +  explicit temp_storage(lt::file_storage const& fs) : m_files(fs) {}
    │ │ │ +
    │ │ │ +  lt::span<char const> readv(lt::peer_request const r, lt::storage_error& ec) const
    │ │ │ +  {
    │ │ │ +    auto const i = m_file_data.find(r.piece);
    │ │ │ +    if (i == m_file_data.end())
    │ │ │ +    {
    │ │ │ +      ec.operation = lt::operation_t::file_read;
    │ │ │ +      ec.ec = boost::asio::error::eof;
    │ │ │ +      return {};
    │ │ │ +    }
    │ │ │ +    if (int(i->second.size()) <= r.start)
    │ │ │ +    {
    │ │ │ +      ec.operation = lt::operation_t::file_read;
    │ │ │ +      ec.ec = boost::asio::error::eof;
    │ │ │ +      return {};
    │ │ │ +    }
    │ │ │ +    return { i->second.data() + r.start, std::min(r.length, int(i->second.size()) - r.start) };
    │ │ │ +  }
    │ │ │ +  void writev(lt::span<char const> const b, lt::piece_index_t const piece, int const offset)
    │ │ │ +  {
    │ │ │ +    auto& data = m_file_data[piece];
    │ │ │ +    if (data.empty())
    │ │ │ +    {
    │ │ │ +      // allocate the whole piece, otherwise we'll invalidate the pointers
    │ │ │ +      // we have returned back to libtorrent
    │ │ │ +      int const size = piece_size(piece);
    │ │ │ +      data.resize(std::size_t(size));
    │ │ │ +    }
    │ │ │ +    TORRENT_ASSERT(offset + b.size() <= int(data.size()));
    │ │ │ +    std::memcpy(data.data() + offset, b.data(), std::size_t(b.size()));
    │ │ │ +  }
    │ │ │ +  lt::sha1_hash hash(lt::piece_index_t const piece
    │ │ │ +    , lt::span<lt::sha256_hash> const block_hashes, lt::storage_error& ec) const
    │ │ │ +  {
    │ │ │ +    auto const i = m_file_data.find(piece);
    │ │ │ +    if (i == m_file_data.end())
    │ │ │ +    {
    │ │ │ +      ec.operation = lt::operation_t::file_read;
    │ │ │ +      ec.ec = boost::asio::error::eof;
    │ │ │ +      return {};
    │ │ │ +    }
    │ │ │ +    if (!block_hashes.empty())
    │ │ │ +    {
    │ │ │ +      int const piece_size2 = m_files.piece_size2(piece);
    │ │ │ +      int const blocks_in_piece2 = m_files.blocks_in_piece2(piece);
    │ │ │ +      char const* buf = i->second.data();
    │ │ │ +      std::int64_t offset = 0;
    │ │ │ +      for (int k = 0; k < blocks_in_piece2; ++k)
    │ │ │ +      {
    │ │ │ +        lt::hasher256 h2;
    │ │ │ +        std::ptrdiff_t const len2 = std::min(lt::default_block_size, int(piece_size2 - offset));
    │ │ │ +        h2.update({ buf, len2 });
    │ │ │ +        buf += len2;
    │ │ │ +        offset += len2;
    │ │ │ +        block_hashes[k] = h2.final();
    │ │ │ +      }
    │ │ │ +    }
    │ │ │ +    return lt::hasher(i->second).final();
    │ │ │ +  }
    │ │ │ +  lt::sha256_hash hash2(lt::piece_index_t const piece, int const offset, lt::storage_error& ec)
    │ │ │ +  {
    │ │ │ +    auto const i = m_file_data.find(piece);
    │ │ │ +    if (i == m_file_data.end())
    │ │ │ +    {
    │ │ │ +      ec.operation = lt::operation_t::file_read;
    │ │ │ +      ec.ec = boost::asio::error::eof;
    │ │ │ +      return {};
    │ │ │ +    }
    │ │ │ +
    │ │ │ +    int const piece_size = m_files.piece_size2(piece);
    │ │ │ +
    │ │ │ +    std::ptrdiff_t const len = std::min(lt::default_block_size, piece_size - offset);
    │ │ │ +
    │ │ │ +    lt::span<char const> b = {i->second.data() + offset, len};
    │ │ │ +    return lt::hasher256(b).final();
    │ │ │ +  }
    │ │ │ +
    │ │ │ +private:
    │ │ │ +  int piece_size(lt::piece_index_t piece) const
    │ │ │ +  {
    │ │ │ +    int const num_pieces = static_cast<int>((m_files.total_size() + m_files.piece_length() - 1) / m_files.piece_length());
    │ │ │ +    return static_cast<int>(piece) < num_pieces - 1
    │ │ │ +      ? m_files.piece_length() : static_cast<int>(m_files.total_size() - std::int64_t(num_pieces - 1) * m_files.piece_length());
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  lt::file_storage const& m_files;
    │ │ │ +  std::map<lt::piece_index_t, std::vector<char>> m_file_data;
    │ │ │ +};
    │ │ │ +
    │ │ │ +lt::storage_index_t pop(std::vector<lt::storage_index_t>& q)
    │ │ │ +{
    │ │ │ +  TORRENT_ASSERT(!q.empty());
    │ │ │ +  lt::storage_index_t const ret = q.back();
    │ │ │ +  q.pop_back();
    │ │ │ +  return ret;
    │ │ │ +}
    │ │ │ +
    │ │ │ +struct temp_disk_io final : lt::disk_interface
    │ │ │ +  , lt::buffer_allocator_interface
    │ │ │ +{
    │ │ │ +  explicit temp_disk_io(lt::io_context& ioc): m_ioc(ioc) {}
    │ │ │ +
    │ │ │ +  void settings_updated() override {}
    │ │ │ +
    │ │ │ +  lt::storage_holder new_torrent(lt::storage_params const& params
    │ │ │ +    , std::shared_ptr<void> const&) override
    │ │ │ +  {
    │ │ │ +    lt::storage_index_t const idx = m_free_slots.empty()
    │ │ │ +      ? m_torrents.end_index()
    │ │ │ +      : pop(m_free_slots);
    │ │ │ +    auto storage = std::make_unique<temp_storage>(params.files);
    │ │ │ +    if (idx == m_torrents.end_index()) m_torrents.emplace_back(std::move(storage));
    │ │ │ +    else m_torrents[idx] = std::move(storage);
    │ │ │ +    return lt::storage_holder(idx, *this);
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void remove_torrent(lt::storage_index_t const idx) override
    │ │ │ +  {
    │ │ │ +    m_torrents[idx].reset();
    │ │ │ +    m_free_slots.push_back(idx);
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void abort(bool) override {}
    │ │ │ +
    │ │ │ +  void async_read(lt::storage_index_t storage, lt::peer_request const& r
    │ │ │ +    , std::function<void(lt::disk_buffer_holder block, lt::storage_error const& se)> handler
    │ │ │ +    , lt::disk_job_flags_t) override
    │ │ │ +  {
    │ │ │ +    // this buffer is owned by the storage. It will remain valid for as
    │ │ │ +    // long as the torrent remains in the session. We don't need any lifetime
    │ │ │ +    // management of it.
    │ │ │ +    lt::storage_error error;
    │ │ │ +    lt::span<char const> b = m_torrents[storage]->readv(r, error);
    │ │ │ +
    │ │ │ +    post(m_ioc, [handler, error, b, this]
    │ │ │ +      { handler(lt::disk_buffer_holder(*this, const_cast<char*>(b.data()), int(b.size())), error); });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  bool async_write(lt::storage_index_t storage, lt::peer_request const& r
    │ │ │ +    , char const* buf, std::shared_ptr<lt::disk_observer>
    │ │ │ +    , std::function<void(lt::storage_error const&)> handler
    │ │ │ +    , lt::disk_job_flags_t) override
    │ │ │ +  {
    │ │ │ +    lt::span<char const> const b = { buf, r.length };
    │ │ │ +
    │ │ │ +    m_torrents[storage]->writev(b, r.piece, r.start);
    │ │ │ +
    │ │ │ +    post(m_ioc, [=]{ handler(lt::storage_error()); });
    │ │ │ +    return false;
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_hash(lt::storage_index_t storage, lt::piece_index_t const piece
    │ │ │ +    , lt::span<lt::sha256_hash> block_hashes, lt::disk_job_flags_t
    │ │ │ +    , std::function<void(lt::piece_index_t, lt::sha1_hash const&, lt::storage_error const&)> handler) override
    │ │ │ +  {
    │ │ │ +    lt::storage_error error;
    │ │ │ +    lt::sha1_hash const hash = m_torrents[storage]->hash(piece, block_hashes, error);
    │ │ │ +    post(m_ioc, [=]{ handler(piece, hash, error); });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_hash2(lt::storage_index_t storage, lt::piece_index_t const piece
    │ │ │ +    , int const offset, lt::disk_job_flags_t
    │ │ │ +    , std::function<void(lt::piece_index_t, lt::sha256_hash const&, lt::storage_error const&)> handler) override
    │ │ │ +  {
    │ │ │ +    lt::storage_error error;
    │ │ │ +    lt::sha256_hash const hash = m_torrents[storage]->hash2(piece, offset, error);
    │ │ │ +    post(m_ioc, [=]{ handler(piece, hash, error); });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_move_storage(lt::storage_index_t, std::string p, lt::move_flags_t
    │ │ │ +    , std::function<void(lt::status_t, std::string const&, lt::storage_error const&)> handler) override
    │ │ │ +  {
    │ │ │ +    post(m_ioc, [=]{
    │ │ │ +      handler(lt::status_t::fatal_disk_error, p
    │ │ │ +        , lt::storage_error(lt::error_code(boost::system::errc::operation_not_supported, lt::system_category())));
    │ │ │ +    });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_release_files(lt::storage_index_t, std::function<void()>) override {}
    │ │ │ +
    │ │ │ +  void async_delete_files(lt::storage_index_t, lt::remove_flags_t
    │ │ │ +    , std::function<void(lt::storage_error const&)> handler) override
    │ │ │ +  {
    │ │ │ +    post(m_ioc, [=]{ handler(lt::storage_error()); });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_check_files(lt::storage_index_t
    │ │ │ +    , lt::add_torrent_params const*
    │ │ │ +    , lt::aux::vector<std::string, lt::file_index_t>
    │ │ │ +    , std::function<void(lt::status_t, lt::storage_error const&)> handler) override
    │ │ │ +  {
    │ │ │ +    post(m_ioc, [=]{ handler(lt::status_t::no_error, lt::storage_error()); });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_rename_file(lt::storage_index_t
    │ │ │ +    , lt::file_index_t const idx
    │ │ │ +    , std::string const name
    │ │ │ +    , std::function<void(std::string const&, lt::file_index_t, lt::storage_error const&)> handler) override
    │ │ │ +  {
    │ │ │ +    post(m_ioc, [=]{ handler(name, idx, lt::storage_error()); });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_stop_torrent(lt::storage_index_t, std::function<void()> handler) override
    │ │ │ +  {
    │ │ │ +    post(m_ioc, handler);
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_set_file_priority(lt::storage_index_t
    │ │ │ +    , lt::aux::vector<lt::download_priority_t, lt::file_index_t> prio
    │ │ │ +    , std::function<void(lt::storage_error const&
    │ │ │ +      , lt::aux::vector<lt::download_priority_t, lt::file_index_t>)> handler) override
    │ │ │ +  {
    │ │ │ +    post(m_ioc, [=]{
    │ │ │ +      handler(lt::storage_error(lt::error_code(
    │ │ │ +        boost::system::errc::operation_not_supported, lt::system_category())), std::move(prio));
    │ │ │ +    });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void async_clear_piece(lt::storage_index_t, lt::piece_index_t index
    │ │ │ +    , std::function<void(lt::piece_index_t)> handler) override
    │ │ │ +  {
    │ │ │ +    post(m_ioc, [=]{ handler(index); });
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  // implements buffer_allocator_interface
    │ │ │ +  void free_disk_buffer(char*) override
    │ │ │ +  {
    │ │ │ +    // never free any buffer. We only return buffers owned by the storage
    │ │ │ +    // object
    │ │ │ +  }
    │ │ │ +
    │ │ │ +  void update_stats_counters(lt::counters&) const override {}
    │ │ │ +
    │ │ │ +  std::vector<lt::open_file_state> get_status(lt::storage_index_t) const override
    │ │ │ +  { return {}; }
    │ │ │ +
    │ │ │ +  void submit_jobs() override {}
    │ │ │ +
    │ │ │ +private:
    │ │ │ +
    │ │ │ +  lt::aux::vector<std::shared_ptr<temp_storage>, lt::storage_index_t> m_torrents;
    │ │ │ +
    │ │ │ +  // slots that are unused in the m_torrents vector
    │ │ │ +  std::vector<lt::storage_index_t> m_free_slots;
    │ │ │ +
    │ │ │ +  // callbacks are posted on this
    │ │ │ +  lt::io_context& m_ioc;
    │ │ │ +};
    │ │ │ +
    │ │ │ +std::unique_ptr<lt::disk_interface> temp_disk_constructor(
    │ │ │ +  lt::io_context& ioc, lt::settings_interface const&, lt::counters&)
    │ │ │ +{
    │ │ │ +  return std::make_unique<temp_disk_io>(ioc);
    │ │ │ +}
    │ │ │ +
    │ │ │ +[report issue]
    │ │ │ +

    settings_interface

    │ │ │ +

    Declared in "libtorrent/settings_pack.hpp"

    │ │ │ +

    the common interface to settings_pack and the internal representation of │ │ │ +settings.

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

    open_file_state

    │ │ │

    Declared in "libtorrent/disk_interface.hpp"

    │ │ │

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

    │ │ │
    │ │ │  struct open_file_state
    │ │ │  {
    │ │ │ @@ -199,18 +475,18 @@
    │ │ │  

    remove_torrent()

    │ │ │
    │ │ │  virtual void remove_torrent (storage_index_t) = 0;
    │ │ │  
    │ │ │

    remove the storage with the specified index. This is not expected to │ │ │ delete any files from disk, just to clean up any resources associated │ │ │ with the specified storage.

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    async_write() async_read()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    async_read() async_write()

    │ │ │
    │ │ │  virtual bool async_write (storage_index_t storage, peer_request const& r
    │ │ │        , char const* buf, std::shared_ptr<disk_observer> o
    │ │ │        , std::function<void(storage_error const&)> handler
    │ │ │        , disk_job_flags_t flags = {}) = 0;
    │ │ │  virtual void async_read (storage_index_t storage, peer_request const& r
    │ │ │        , std::function<void(disk_buffer_holder, storage_error const&)> handler
    │ │ │ @@ -469,22 +745,22 @@
    │ │ │  internal libtorrent torrent object to tie the storage object allocated
    │ │ │  for a torrent to the lifetime of the internal torrent object. When a
    │ │ │  torrent is removed from the session, this holder is destructed and will
    │ │ │  inform the disk object.

    │ │ │
    │ │ │  struct storage_holder
    │ │ │  {
    │ │ │ -   storage_holder (storage_index_t idx, disk_interface& disk_io);
    │ │ │     storage_holder () = default;
    │ │ │ +   storage_holder (storage_index_t idx, disk_interface& disk_io);
    │ │ │     ~storage_holder ();
    │ │ │     explicit operator bool () const;
    │ │ │     operator storage_index_t () const;
    │ │ │     void reset ();
    │ │ │ -   storage_holder (storage_holder const&) = delete;
    │ │ │     storage_holder& operator= (storage_holder const&) = delete;
    │ │ │ +   storage_holder (storage_holder const&) = delete;
    │ │ │     storage_holder (storage_holder&& rhs) noexcept;
    │ │ │     storage_holder& operator= (storage_holder&& rhs) noexcept;
    │ │ │  };
    │ │ │  
    │ │ │ [report issue]
    │ │ │
    │ │ │

    disk_observer

    │ │ │ @@ -524,18 +800,18 @@ │ │ │

    The disk buffer holder acts like a unique_ptr that frees a disk buffer │ │ │ when it's destructed

    │ │ │

    If this buffer holder is moved-from, default constructed or reset, │ │ │ data() will return nullptr.

    │ │ │
    │ │ │  struct disk_buffer_holder
    │ │ │  {
    │ │ │ -   disk_buffer_holder (disk_buffer_holder&&) noexcept;
    │ │ │     disk_buffer_holder& operator= (disk_buffer_holder&&) & noexcept;
    │ │ │ -   disk_buffer_holder (disk_buffer_holder const&) = delete;
    │ │ │ +   disk_buffer_holder (disk_buffer_holder&&) noexcept;
    │ │ │     disk_buffer_holder& operator= (disk_buffer_holder const&) = delete;
    │ │ │ +   disk_buffer_holder (disk_buffer_holder const&) = delete;
    │ │ │     disk_buffer_holder (buffer_allocator_interface& alloc
    │ │ │        , char* buf, int sz) noexcept;
    │ │ │     disk_buffer_holder () noexcept = default;
    │ │ │     ~disk_buffer_holder ();
    │ │ │     char* data () const noexcept;
    │ │ │     void reset ();
    │ │ │     void swap (disk_buffer_holder& h) noexcept;
    │ │ │ @@ -600,34 +876,16 @@
    │ │ │  
    │ │ │

    bool()

    │ │ │
    │ │ │  explicit operator bool () const noexcept;
    │ │ │  
    │ │ │

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

    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -
    │ │ │ -

    settings_interface

    │ │ │ -

    Declared in "libtorrent/settings_pack.hpp"

    │ │ │ -

    the common interface to settings_pack and the internal representation of │ │ │ -settings.

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

    file_open_mode_t

    │ │ │

    Declared in "libtorrent/disk_interface.hpp"

    │ │ │
    │ │ │
    read_only
    │ │ │
    open the file for reading only
    │ │ │
    │ │ │ ├── html2text {} │ │ │ │ @@ -1,17 +1,18 @@ │ │ │ │ > │ │ │ │ _[_l_i_b_t_o_r_r_e_n_t_ _l_o_g_o_] │ │ │ │ VVeerrssiioonn:: 2.0.11 │ │ │ │ _h_o_m_e │ │ │ │ Table of contents │ │ │ │ + * _s_e_t_t_i_n_g_s___i_n_t_e_r_f_a_c_e │ │ │ │ * _o_p_e_n___f_i_l_e___s_t_a_t_e │ │ │ │ * _d_i_s_k___i_n_t_e_r_f_a_c_e │ │ │ │ o _n_e_w___t_o_r_r_e_n_t_(_) │ │ │ │ o _r_e_m_o_v_e___t_o_r_r_e_n_t_(_) │ │ │ │ - o _a_s_y_n_c___w_r_i_t_e_(_)_ _a_s_y_n_c___r_e_a_d_(_) │ │ │ │ + o _a_s_y_n_c___r_e_a_d_(_)_ _a_s_y_n_c___w_r_i_t_e_(_) │ │ │ │ o _a_s_y_n_c___h_a_s_h_(_) │ │ │ │ o _a_s_y_n_c___h_a_s_h_2_(_) │ │ │ │ o _a_s_y_n_c___m_o_v_e___s_t_o_r_a_g_e_(_) │ │ │ │ o _a_s_y_n_c___r_e_l_e_a_s_e___f_i_l_e_s_(_) │ │ │ │ o _a_s_y_n_c___c_h_e_c_k___f_i_l_e_s_(_) │ │ │ │ o _a_s_y_n_c___s_t_o_p___t_o_r_r_e_n_t_(_) │ │ │ │ o _a_s_y_n_c___r_e_n_a_m_e___f_i_l_e_(_) │ │ │ │ @@ -32,28 +33,322 @@ │ │ │ │ o _d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r_(_) │ │ │ │ o _~_d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r_(_) │ │ │ │ o _d_a_t_a_(_) │ │ │ │ o _r_e_s_e_t_(_) │ │ │ │ o _s_w_a_p_(_) │ │ │ │ o _i_s___m_u_t_a_b_l_e_(_) │ │ │ │ o _b_o_o_l_(_) │ │ │ │ - * _s_e_t_t_i_n_g_s___i_n_t_e_r_f_a_c_e │ │ │ │ * _f_i_l_e___o_p_e_n___m_o_d_e___t │ │ │ │ -You have some control over _s_e_s_s_i_o_n configuration through the session:: │ │ │ │ -apply_settings() member function. To change one or more configuration options, │ │ │ │ -create a _s_e_t_t_i_n_g_s___p_a_c_k object and fill it with the settings to be set and pass │ │ │ │ -it in to session::apply_settings(). │ │ │ │ -The _s_e_t_t_i_n_g_s___p_a_c_k object is a collection of settings updates that are applied │ │ │ │ -to the _s_e_s_s_i_o_n when passed to session::apply_settings(). It's empty when │ │ │ │ -constructed. │ │ │ │ -You have control over proxy and authorization settings and also the user-agent │ │ │ │ -that will be sent to the tracker. The user-agent will also be used to identify │ │ │ │ -the client with other peers. │ │ │ │ -Each configuration option is named with an enum value inside the _s_e_t_t_i_n_g_s___p_a_c_k │ │ │ │ -class. These are the available settings: │ │ │ │ +The disk I/O can be customized in libtorrent. In previous versions, the │ │ │ │ +customization was at the level of each torrent. Now, the customization point is │ │ │ │ +at the _s_e_s_s_i_o_n level. All torrents added to a _s_e_s_s_i_o_n will use the same disk I/ │ │ │ │ +O subsystem, as determined by the disk_io_constructor (in _s_e_s_s_i_o_n___p_a_r_a_m_s). │ │ │ │ +This allows the disk subsystem to also customize threading and disk job │ │ │ │ +management. │ │ │ │ +To customize the disk subsystem, implement _d_i_s_k___i_n_t_e_r_f_a_c_e and provide a factory │ │ │ │ +function to the _s_e_s_s_i_o_n constructor (via _s_e_s_s_i_o_n___p_a_r_a_m_s). │ │ │ │ +Example use: │ │ │ │ +struct temp_storage │ │ │ │ +{ │ │ │ │ + explicit temp_storage(lt::file_storage const& fs) : m_files(fs) {} │ │ │ │ + │ │ │ │ + lt::span readv(lt::peer_request const r, lt::storage_error& ec) │ │ │ │ +const │ │ │ │ + { │ │ │ │ + auto const i = m_file_data.find(r.piece); │ │ │ │ + if (i == m_file_data.end()) │ │ │ │ + { │ │ │ │ + ec.operation = lt::operation_t::file_read; │ │ │ │ + ec.ec = boost::asio::error::eof; │ │ │ │ + return {}; │ │ │ │ + } │ │ │ │ + if (int(i->second.size()) <= r.start) │ │ │ │ + { │ │ │ │ + ec.operation = lt::operation_t::file_read; │ │ │ │ + ec.ec = boost::asio::error::eof; │ │ │ │ + return {}; │ │ │ │ + } │ │ │ │ + return { i->second.data() + r.start, std::min(r.length, int(i->second.size │ │ │ │ +()) - r.start) }; │ │ │ │ + } │ │ │ │ + void writev(lt::span const b, lt::piece_index_t const piece, int │ │ │ │ +const offset) │ │ │ │ + { │ │ │ │ + auto& data = m_file_data[piece]; │ │ │ │ + if (data.empty()) │ │ │ │ + { │ │ │ │ + // allocate the whole piece, otherwise we'll invalidate the pointers │ │ │ │ + // we have returned back to libtorrent │ │ │ │ + int const size = piece_size(piece); │ │ │ │ + data.resize(std::size_t(size)); │ │ │ │ + } │ │ │ │ + TORRENT_ASSERT(offset + b.size() <= int(data.size())); │ │ │ │ + std::memcpy(data.data() + offset, b.data(), std::size_t(b.size())); │ │ │ │ + } │ │ │ │ + lt::sha1_hash hash(lt::piece_index_t const piece │ │ │ │ + , lt::span const block_hashes, lt::storage_error& ec) │ │ │ │ +const │ │ │ │ + { │ │ │ │ + auto const i = m_file_data.find(piece); │ │ │ │ + if (i == m_file_data.end()) │ │ │ │ + { │ │ │ │ + ec.operation = lt::operation_t::file_read; │ │ │ │ + ec.ec = boost::asio::error::eof; │ │ │ │ + return {}; │ │ │ │ + } │ │ │ │ + if (!block_hashes.empty()) │ │ │ │ + { │ │ │ │ + int const piece_size2 = m_files.piece_size2(piece); │ │ │ │ + int const blocks_in_piece2 = m_files.blocks_in_piece2(piece); │ │ │ │ + char const* buf = i->second.data(); │ │ │ │ + std::int64_t offset = 0; │ │ │ │ + for (int k = 0; k < blocks_in_piece2; ++k) │ │ │ │ + { │ │ │ │ + lt::hasher256 h2; │ │ │ │ + std::ptrdiff_t const len2 = std::min(lt::default_block_size, int │ │ │ │ +(piece_size2 - offset)); │ │ │ │ + h2.update({ buf, len2 }); │ │ │ │ + buf += len2; │ │ │ │ + offset += len2; │ │ │ │ + block_hashes[k] = h2.final(); │ │ │ │ + } │ │ │ │ + } │ │ │ │ + return lt::hasher(i->second).final(); │ │ │ │ + } │ │ │ │ + lt::sha256_hash hash2(lt::piece_index_t const piece, int const offset, lt:: │ │ │ │ +storage_error& ec) │ │ │ │ + { │ │ │ │ + auto const i = m_file_data.find(piece); │ │ │ │ + if (i == m_file_data.end()) │ │ │ │ + { │ │ │ │ + ec.operation = lt::operation_t::file_read; │ │ │ │ + ec.ec = boost::asio::error::eof; │ │ │ │ + return {}; │ │ │ │ + } │ │ │ │ + │ │ │ │ + int const piece_size = m_files.piece_size2(piece); │ │ │ │ + │ │ │ │ + std::ptrdiff_t const len = std::min(lt::default_block_size, piece_size - │ │ │ │ +offset); │ │ │ │ + │ │ │ │ + lt::span b = {i->second.data() + offset, len}; │ │ │ │ + return lt::hasher256(b).final(); │ │ │ │ + } │ │ │ │ + │ │ │ │ +private: │ │ │ │ + int piece_size(lt::piece_index_t piece) const │ │ │ │ + { │ │ │ │ + int const num_pieces = static_cast((m_files.total_size() + │ │ │ │ +m_files.piece_length() - 1) / m_files.piece_length()); │ │ │ │ + return static_cast(piece) < num_pieces - 1 │ │ │ │ + ? m_files.piece_length() : static_cast(m_files.total_size() - std:: │ │ │ │ +int64_t(num_pieces - 1) * m_files.piece_length()); │ │ │ │ + } │ │ │ │ + │ │ │ │ + lt::file_storage const& m_files; │ │ │ │ + std::map> m_file_data; │ │ │ │ +}; │ │ │ │ + │ │ │ │ +lt::storage_index_t pop(std::vector& q) │ │ │ │ +{ │ │ │ │ + TORRENT_ASSERT(!q.empty()); │ │ │ │ + lt::storage_index_t const ret = q.back(); │ │ │ │ + q.pop_back(); │ │ │ │ + return ret; │ │ │ │ +} │ │ │ │ + │ │ │ │ +struct temp_disk_io final : lt::disk_interface │ │ │ │ + , lt::buffer_allocator_interface │ │ │ │ +{ │ │ │ │ + explicit temp_disk_io(lt::io_context& ioc): m_ioc(ioc) {} │ │ │ │ + │ │ │ │ + void settings_updated() override {} │ │ │ │ + │ │ │ │ + lt::storage_holder new_torrent(lt::storage_params const& params │ │ │ │ + , std::shared_ptr const&) override │ │ │ │ + { │ │ │ │ + lt::storage_index_t const idx = m_free_slots.empty() │ │ │ │ + ? m_torrents.end_index() │ │ │ │ + : pop(m_free_slots); │ │ │ │ + auto storage = std::make_unique(params.files); │ │ │ │ + if (idx == m_torrents.end_index()) m_torrents.emplace_back(std::move │ │ │ │ +(storage)); │ │ │ │ + else m_torrents[idx] = std::move(storage); │ │ │ │ + return lt::storage_holder(idx, *this); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void remove_torrent(lt::storage_index_t const idx) override │ │ │ │ + { │ │ │ │ + m_torrents[idx].reset(); │ │ │ │ + m_free_slots.push_back(idx); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void abort(bool) override {} │ │ │ │ + │ │ │ │ + void async_read(lt::storage_index_t storage, lt::peer_request const& r │ │ │ │ + , std::function handler │ │ │ │ + , lt::disk_job_flags_t) override │ │ │ │ + { │ │ │ │ + // this buffer is owned by the storage. It will remain valid for as │ │ │ │ + // long as the torrent remains in the session. We don't need any lifetime │ │ │ │ + // management of it. │ │ │ │ + lt::storage_error error; │ │ │ │ + lt::span b = m_torrents[storage]->readv(r, error); │ │ │ │ + │ │ │ │ + post(m_ioc, [handler, error, b, this] │ │ │ │ + { handler(lt::disk_buffer_holder(*this, const_cast(b.data()), int │ │ │ │ +(b.size())), error); }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + bool async_write(lt::storage_index_t storage, lt::peer_request const& r │ │ │ │ + , char const* buf, std::shared_ptr │ │ │ │ + , std::function handler │ │ │ │ + , lt::disk_job_flags_t) override │ │ │ │ + { │ │ │ │ + lt::span const b = { buf, r.length }; │ │ │ │ + │ │ │ │ + m_torrents[storage]->writev(b, r.piece, r.start); │ │ │ │ + │ │ │ │ + post(m_ioc, [=]{ handler(lt::storage_error()); }); │ │ │ │ + return false; │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_hash(lt::storage_index_t storage, lt::piece_index_t const piece │ │ │ │ + , lt::span block_hashes, lt::disk_job_flags_t │ │ │ │ + , std::function handler) override │ │ │ │ + { │ │ │ │ + lt::storage_error error; │ │ │ │ + lt::sha1_hash const hash = m_torrents[storage]->hash(piece, block_hashes, │ │ │ │ +error); │ │ │ │ + post(m_ioc, [=]{ handler(piece, hash, error); }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_hash2(lt::storage_index_t storage, lt::piece_index_t const piece │ │ │ │ + , int const offset, lt::disk_job_flags_t │ │ │ │ + , std::function handler) override │ │ │ │ + { │ │ │ │ + lt::storage_error error; │ │ │ │ + lt::sha256_hash const hash = m_torrents[storage]->hash2(piece, offset, │ │ │ │ +error); │ │ │ │ + post(m_ioc, [=]{ handler(piece, hash, error); }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_move_storage(lt::storage_index_t, std::string p, lt::move_flags_t │ │ │ │ + , std::function handler) override │ │ │ │ + { │ │ │ │ + post(m_ioc, [=]{ │ │ │ │ + handler(lt::status_t::fatal_disk_error, p │ │ │ │ + , lt::storage_error(lt::error_code(boost::system::errc:: │ │ │ │ +operation_not_supported, lt::system_category()))); │ │ │ │ + }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_release_files(lt::storage_index_t, std::function) override │ │ │ │ +{} │ │ │ │ + │ │ │ │ + void async_delete_files(lt::storage_index_t, lt::remove_flags_t │ │ │ │ + , std::function handler) override │ │ │ │ + { │ │ │ │ + post(m_ioc, [=]{ handler(lt::storage_error()); }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_check_files(lt::storage_index_t │ │ │ │ + , lt::add_torrent_params const* │ │ │ │ + , lt::aux::vector │ │ │ │ + , std::function handler) │ │ │ │ +override │ │ │ │ + { │ │ │ │ + post(m_ioc, [=]{ handler(lt::status_t::no_error, lt::storage_error()); }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_rename_file(lt::storage_index_t │ │ │ │ + , lt::file_index_t const idx │ │ │ │ + , std::string const name │ │ │ │ + , std::function handler) override │ │ │ │ + { │ │ │ │ + post(m_ioc, [=]{ handler(name, idx, lt::storage_error()); }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_stop_torrent(lt::storage_index_t, std::function handler) │ │ │ │ +override │ │ │ │ + { │ │ │ │ + post(m_ioc, handler); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_set_file_priority(lt::storage_index_t │ │ │ │ + , lt::aux::vector prio │ │ │ │ + , std::function)> handler) │ │ │ │ +override │ │ │ │ + { │ │ │ │ + post(m_ioc, [=]{ │ │ │ │ + handler(lt::storage_error(lt::error_code( │ │ │ │ + boost::system::errc::operation_not_supported, lt::system_category())), │ │ │ │ +std::move(prio)); │ │ │ │ + }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + void async_clear_piece(lt::storage_index_t, lt::piece_index_t index │ │ │ │ + , std::function handler) override │ │ │ │ + { │ │ │ │ + post(m_ioc, [=]{ handler(index); }); │ │ │ │ + } │ │ │ │ + │ │ │ │ + // implements buffer_allocator_interface │ │ │ │ + void free_disk_buffer(char*) override │ │ │ │ + { │ │ │ │ + // never free any buffer. We only return buffers owned by the storage │ │ │ │ + // object │ │ │ │ + } │ │ │ │ + │ │ │ │ + void update_stats_counters(lt::counters&) const override {} │ │ │ │ + │ │ │ │ + std::vector get_status(lt::storage_index_t) const │ │ │ │ +override │ │ │ │ + { return {}; } │ │ │ │ + │ │ │ │ + void submit_jobs() override {} │ │ │ │ + │ │ │ │ +private: │ │ │ │ + │ │ │ │ + lt::aux::vector, lt::storage_index_t> │ │ │ │ +m_torrents; │ │ │ │ + │ │ │ │ + // slots that are unused in the m_torrents vector │ │ │ │ + std::vector m_free_slots; │ │ │ │ + │ │ │ │ + // callbacks are posted on this │ │ │ │ + lt::io_context& m_ioc; │ │ │ │ +}; │ │ │ │ + │ │ │ │ +std::unique_ptr temp_disk_constructor( │ │ │ │ + lt::io_context& ioc, lt::settings_interface const&, lt::counters&) │ │ │ │ +{ │ │ │ │ + return std::make_unique(ioc); │ │ │ │ +} │ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ +************ sseettttiinnggss__iinntteerrffaaccee ************ │ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_t_t_i_n_g_s___p_a_c_k_._h_p_p" │ │ │ │ +the common interface to _s_e_t_t_i_n_g_s___p_a_c_k and the internal representation of │ │ │ │ +settings. │ │ │ │ +struct settings_interface │ │ │ │ +{ │ │ │ │ + virtual void sseett__ssttrr (int name, std::string val) = 0; │ │ │ │ + virtual void sseett__bbooooll (int name, bool val) = 0; │ │ │ │ + virtual void sseett__iinntt (int name, int val) = 0; │ │ │ │ + virtual bool hhaass__vvaall (int name) const = 0; │ │ │ │ + virtual bool ggeett__bbooooll (int name) const = 0; │ │ │ │ + virtual std::string const& ggeett__ssttrr (int name) const = 0; │ │ │ │ + virtual int ggeett__iinntt (int name) const = 0; │ │ │ │ +}; │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ ooppeenn__ffiillee__ssttaattee ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___i_n_t_e_r_f_a_c_e_._h_p_p" │ │ │ │ this contains information about a file that's currently open by the libtorrent │ │ │ │ disk I/O subsystem. It's associated with a single torrent. │ │ │ │ struct open_file_state │ │ │ │ { │ │ │ │ @@ -159,15 +454,15 @@ │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** rreemmoovvee__ttoorrrreenntt(()) ********** │ │ │ │ virtual void rreemmoovvee__ttoorrrreenntt (storage_index_t) = 0; │ │ │ │ remove the storage with the specified index. This is not expected to delete any │ │ │ │ files from disk, just to clean up any resources associated with the specified │ │ │ │ storage. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** aassyynncc__wwrriittee(()) aassyynncc__rreeaadd(()) ********** │ │ │ │ +********** aassyynncc__rreeaadd(()) aassyynncc__wwrriittee(()) ********** │ │ │ │ virtual bool aassyynncc__wwrriittee (storage_index_t storage, peer_request const& r │ │ │ │ , char const* buf, std::shared_ptr o │ │ │ │ , std::function handler │ │ │ │ , disk_job_flags_t flags = {}) = 0; │ │ │ │ virtual void aassyynncc__rreeaadd (storage_index_t storage, peer_request const& r │ │ │ │ , std::function handler │ │ │ │ , disk_job_flags_t flags = {}) = 0; │ │ │ │ @@ -361,22 +656,22 @@ │ │ │ │ a unique, owning, reference to the storage of a torrent in a disk io subsystem │ │ │ │ (class that implements _d_i_s_k___i_n_t_e_r_f_a_c_e). This is held by the internal libtorrent │ │ │ │ torrent object to tie the storage object allocated for a torrent to the │ │ │ │ lifetime of the internal torrent object. When a torrent is removed from the │ │ │ │ _s_e_s_s_i_o_n, this holder is destructed and will inform the disk object. │ │ │ │ struct storage_holder │ │ │ │ { │ │ │ │ - ssttoorraaggee__hhoollddeerr (storage_index_t idx, disk_interface& disk_io); │ │ │ │ ssttoorraaggee__hhoollddeerr () = default; │ │ │ │ + ssttoorraaggee__hhoollddeerr (storage_index_t idx, disk_interface& disk_io); │ │ │ │ ~~ssttoorraaggee__hhoollddeerr (); │ │ │ │ explicit operator bbooooll () const; │ │ │ │ operator ssttoorraaggee__iinnddeexx__tt () const; │ │ │ │ void rreesseett (); │ │ │ │ - ssttoorraaggee__hhoollddeerr (storage_holder const&) = delete; │ │ │ │ storage_holder& ooppeerraattoorr== (storage_holder const&) = delete; │ │ │ │ + ssttoorraaggee__hhoollddeerr (storage_holder const&) = delete; │ │ │ │ ssttoorraaggee__hhoollddeerr (storage_holder&& rhs) noexcept; │ │ │ │ storage_holder& ooppeerraattoorr== (storage_holder&& rhs) noexcept; │ │ │ │ }; │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ ddiisskk__oobbsseerrvveerr ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___o_b_s_e_r_v_e_r_._h_p_p" │ │ │ │ struct disk_observer │ │ │ │ @@ -403,18 +698,18 @@ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r_._h_p_p" │ │ │ │ The disk buffer holder acts like a unique_ptr that frees a disk buffer when │ │ │ │ it's destructed │ │ │ │ If this buffer holder is moved-from, default constructed or reset, data() will │ │ │ │ return nullptr. │ │ │ │ struct disk_buffer_holder │ │ │ │ { │ │ │ │ - ddiisskk__bbuuffffeerr__hhoollddeerr (disk_buffer_holder&&) noexcept; │ │ │ │ disk_buffer_holder& ooppeerraattoorr== (disk_buffer_holder&&) & noexcept; │ │ │ │ - ddiisskk__bbuuffffeerr__hhoollddeerr (disk_buffer_holder const&) = delete; │ │ │ │ + ddiisskk__bbuuffffeerr__hhoollddeerr (disk_buffer_holder&&) noexcept; │ │ │ │ disk_buffer_holder& ooppeerraattoorr== (disk_buffer_holder const&) = delete; │ │ │ │ + ddiisskk__bbuuffffeerr__hhoollddeerr (disk_buffer_holder const&) = delete; │ │ │ │ ddiisskk__bbuuffffeerr__hhoollddeerr (buffer_allocator_interface& alloc │ │ │ │ , char* buf, int sz) noexcept; │ │ │ │ ddiisskk__bbuuffffeerr__hhoollddeerr () noexcept = default; │ │ │ │ ~~ddiisskk__bbuuffffeerr__hhoollddeerr (); │ │ │ │ char* ddaattaa () const noexcept; │ │ │ │ void rreesseett (); │ │ │ │ void sswwaapp (disk_buffer_holder& h) noexcept; │ │ │ │ @@ -454,29 +749,14 @@ │ │ │ │ bool iiss__mmuuttaabbllee () const noexcept; │ │ │ │ if this returns true, the buffer may not be modified in place │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** bbooooll(()) ********** │ │ │ │ explicit operator bbooooll () const noexcept; │ │ │ │ implicitly convertible to true if the object is currently holding a buffer │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -************ sseettttiinnggss__iinntteerrffaaccee ************ │ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_t_t_i_n_g_s___p_a_c_k_._h_p_p" │ │ │ │ -the common interface to _s_e_t_t_i_n_g_s___p_a_c_k and the internal representation of │ │ │ │ -settings. │ │ │ │ -struct settings_interface │ │ │ │ -{ │ │ │ │ - virtual void sseett__iinntt (int name, int val) = 0; │ │ │ │ - virtual bool hhaass__vvaall (int name) const = 0; │ │ │ │ - virtual void sseett__ssttrr (int name, std::string val) = 0; │ │ │ │ - virtual void sseett__bbooooll (int name, bool val) = 0; │ │ │ │ - virtual int ggeett__iinntt (int name) const = 0; │ │ │ │ - virtual std::string const& ggeett__ssttrr (int name) const = 0; │ │ │ │ - virtual bool ggeett__bbooooll (int name) const = 0; │ │ │ │ -}; │ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ ffiillee__ooppeenn__mmooddee__tt ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___i_n_t_e_r_f_a_c_e_._h_p_p" │ │ │ │ read_only │ │ │ │ open the file for reading only │ │ │ │ write_only │ │ │ │ open the file for writing only │ │ │ │ read_write │ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html │ │ │ @@ -47,16 +47,16 @@ │ │ │
  • get_mutable_item()
  • │ │ │
  • put_mutable_item()
  • │ │ │
  • get_infohashes_sample()
  • │ │ │
  • tick()
  • │ │ │
  • counters()
  • │ │ │ │ │ │ │ │ │ -
  • sign_mutable_item()
  • │ │ │ -
  • dht_default_storage_constructor()
  • │ │ │ +
  • dht_default_storage_constructor()
  • │ │ │ +
  • sign_mutable_item()
  • │ │ │
  • announce_flags_t
  • │ │ │ │ │ │
    │ │ │ [report issue]
    │ │ │

    dht_state

    │ │ │

    Declared in "libtorrent/kademlia/dht_state.hpp"

    │ │ │

    This structure helps to store and load the state │ │ │ @@ -308,16 +308,27 @@ │ │ │ [report issue]

    │ │ │
    │ │ │

    counters()

    │ │ │
    │ │ │  virtual dht_storage_counters counters () const = 0;
    │ │ │  
    │ │ │

    return stats counters for the store

    │ │ │ -[report issue]
    │ │ │ +[report issue]
    │ │ │ │ │ │ +
    │ │ │ +

    dht_default_storage_constructor()

    │ │ │ +

    Declared in "libtorrent/kademlia/dht_storage.hpp"

    │ │ │ +
    │ │ │ +std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (
    │ │ │ +   settings_interface const& settings);
    │ │ │ +
    │ │ │ +

    constructor for the default DHT storage. The DHT storage is responsible │ │ │ +for maintaining peers and mutable and immutable items announced and │ │ │ +stored/put to the DHT node.

    │ │ │ +[report issue]
    │ │ │
    │ │ │

    sign_mutable_item()

    │ │ │

    Declared in "libtorrent/kademlia/item.hpp"

    │ │ │
    │ │ │  signature sign_mutable_item (
    │ │ │     span<char const> v
    │ │ │     , span<char const> salt
    │ │ │ @@ -327,25 +338,14 @@
    │ │ │  
    │ │ │

    given a byte range v and an optional byte range salt, a │ │ │ sequence number, public key pk (must be 32 bytes) and a secret key │ │ │ sk (must be 64 bytes), this function produces a signature which │ │ │ is written into a 64 byte buffer pointed to by sig. The caller │ │ │ is responsible for allocating the destination buffer that's passed in │ │ │ as the sig argument. Typically it would be allocated on the stack.

    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    dht_default_storage_constructor()

    │ │ │ -

    Declared in "libtorrent/kademlia/dht_storage.hpp"

    │ │ │ -
    │ │ │ -std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (
    │ │ │ -   settings_interface const& settings);
    │ │ │ -
    │ │ │ -

    constructor for the default DHT storage. The DHT storage is responsible │ │ │ -for maintaining peers and mutable and immutable items announced and │ │ │ -stored/put to the DHT node.

    │ │ │ [report issue]
    │ │ │
    │ │ │

    announce_flags_t

    │ │ │

    Declared in "libtorrent/kademlia/announce_flags.hpp"

    │ │ │
    │ │ │
    seed
    │ │ │
    announce to DHT as a seed
    │ │ │ ├── html2text {} │ │ │ │ @@ -14,16 +14,16 @@ │ │ │ │ o _p_u_t___i_m_m_u_t_a_b_l_e___i_t_e_m_(_) │ │ │ │ o _g_e_t___m_u_t_a_b_l_e___i_t_e_m___s_e_q_(_) │ │ │ │ o _g_e_t___m_u_t_a_b_l_e___i_t_e_m_(_) │ │ │ │ o _p_u_t___m_u_t_a_b_l_e___i_t_e_m_(_) │ │ │ │ o _g_e_t___i_n_f_o_h_a_s_h_e_s___s_a_m_p_l_e_(_) │ │ │ │ o _t_i_c_k_(_) │ │ │ │ o _c_o_u_n_t_e_r_s_(_) │ │ │ │ - * _s_i_g_n___m_u_t_a_b_l_e___i_t_e_m_(_) │ │ │ │ * _d_h_t___d_e_f_a_u_l_t___s_t_o_r_a_g_e___c_o_n_s_t_r_u_c_t_o_r_(_) │ │ │ │ + * _s_i_g_n___m_u_t_a_b_l_e___i_t_e_m_(_) │ │ │ │ * _a_n_n_o_u_n_c_e___f_l_a_g_s___t │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ ddhhtt__ssttaattee ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_k_a_d_e_m_l_i_a_/_d_h_t___s_t_a_t_e_._h_p_p" │ │ │ │ This structure helps to store and load the state of the dht_tracker. At this │ │ │ │ moment the library is only a dual stack implementation of the DHT. See _B_E_P_ _3_2 │ │ │ │ struct dht_state │ │ │ │ @@ -210,36 +210,36 @@ │ │ │ │ For implementers: Use this functions for expire peers or items or any other │ │ │ │ storage cleanup. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** ccoouunntteerrss(()) ********** │ │ │ │ virtual dht_storage_counters ccoouunntteerrss () const = 0; │ │ │ │ return stats _c_o_u_n_t_e_r_s for the store │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ +************ ddhhtt__ddeeffaauulltt__ssttoorraaggee__ccoonnssttrruuccttoorr(()) ************ │ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_k_a_d_e_m_l_i_a_/_d_h_t___s_t_o_r_a_g_e_._h_p_p" │ │ │ │ +std::unique_ptr ddhhtt__ddeeffaauulltt__ssttoorraaggee__ccoonnssttrruuccttoorr ( │ │ │ │ + settings_interface const& settings); │ │ │ │ +constructor for the default DHT storage. The DHT storage is responsible for │ │ │ │ +maintaining peers and mutable and immutable items announced and stored/put to │ │ │ │ +the DHT node. │ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ ssiiggnn__mmuuttaabbllee__iitteemm(()) ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_k_a_d_e_m_l_i_a_/_i_t_e_m_._h_p_p" │ │ │ │ signature ssiiggnn__mmuuttaabbllee__iitteemm ( │ │ │ │ span v │ │ │ │ , span salt │ │ │ │ , sequence_number seq │ │ │ │ , public_key const& pk │ │ │ │ , secret_key const& sk); │ │ │ │ given a byte range v and an optional byte range salt, a sequence number, public │ │ │ │ key pk (must be 32 bytes) and a secret key sk (must be 64 bytes), this function │ │ │ │ produces a signature which is written into a 64 byte buffer pointed to by sig. │ │ │ │ The caller is responsible for allocating the destination buffer that's passed │ │ │ │ in as the sig argument. Typically it would be allocated on the stack. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -************ ddhhtt__ddeeffaauulltt__ssttoorraaggee__ccoonnssttrruuccttoorr(()) ************ │ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_k_a_d_e_m_l_i_a_/_d_h_t___s_t_o_r_a_g_e_._h_p_p" │ │ │ │ -std::unique_ptr ddhhtt__ddeeffaauulltt__ssttoorraaggee__ccoonnssttrruuccttoorr ( │ │ │ │ - settings_interface const& settings); │ │ │ │ -constructor for the default DHT storage. The DHT storage is responsible for │ │ │ │ -maintaining peers and mutable and immutable items announced and stored/put to │ │ │ │ -the DHT node. │ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ aannnnoouunnccee__ffllaaggss__tt ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_k_a_d_e_m_l_i_a_/_a_n_n_o_u_n_c_e___f_l_a_g_s_._h_p_p" │ │ │ │ seed │ │ │ │ announce to DHT as a seed │ │ │ │ implied_port │ │ │ │ announce to DHT with the implied-port flag set. This tells the network to │ │ │ │ use your source UDP port as your listen port, rather than the one │ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html │ │ │ @@ -33,44 +33,44 @@ │ │ │

    Table of contents

    │ │ │ │ │ │
    │ │ │ [report issue]
    │ │ │

    storage_error

    │ │ │

    Declared in "libtorrent/error_code.hpp"

    │ │ │

    used by storage to return errors │ │ │ also includes which underlying file the │ │ │ error happened on

    │ │ │
    │ │ │  struct storage_error
    │ │ │  {
    │ │ │     explicit operator bool () const;
    │ │ │ -   void file (file_index_t f);
    │ │ │     file_index_t file () const;
    │ │ │ +   void file (file_index_t f);
    │ │ │  
    │ │ │     error_code ec;
    │ │ │     operation_t operation;
    │ │ │  };
    │ │ │  
    │ │ │ [report issue]
    │ │ │

    bool()

    │ │ │ @@ -79,96 +79,505 @@ │ │ │ │ │ │

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

    │ │ │ [report issue]
    │ │ │
    │ │ │

    file()

    │ │ │
    │ │ │ -void file (file_index_t f);
    │ │ │  file_index_t file () const;
    │ │ │ +void file (file_index_t f);
    │ │ │  
    │ │ │

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

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

    libtorrent_category()

    │ │ │ -

    Declared in "libtorrent/error_code.hpp"

    │ │ │ -
    │ │ │ -boost::system::error_category& libtorrent_category ();
    │ │ │ -
    │ │ │ -

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

    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    http_category()

    │ │ │ -

    Declared in "libtorrent/error_code.hpp"

    │ │ │ -
    │ │ │ -boost::system::error_category& http_category ();
    │ │ │ -
    │ │ │ -

    returns the error_category for HTTP errors

    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    gzip_category()

    │ │ │ -

    Declared in "libtorrent/gzip.hpp"

    │ │ │ +
    │ │ │ +

    pcp_category()

    │ │ │ +

    Declared in "libtorrent/natpmp.hpp"

    │ │ │
    │ │ │ -boost::system::error_category& gzip_category ();
    │ │ │ +boost::system::error_category& pcp_category ();
    │ │ │  
    │ │ │ -

    get the error_category for zip errors

    │ │ │ [report issue]
    │ │ │
    │ │ │

    upnp_category()

    │ │ │

    Declared in "libtorrent/upnp.hpp"

    │ │ │
    │ │ │  boost::system::error_category& upnp_category ();
    │ │ │  
    │ │ │

    the boost.system error category for UPnP errors

    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    i2p_category()

    │ │ │ -

    Declared in "libtorrent/i2p_stream.hpp"

    │ │ │ -
    │ │ │ -boost::system::error_category& i2p_category ();
    │ │ │ -
    │ │ │ -

    returns the error category for I2P errors

    │ │ │ [report issue]
    │ │ │
    │ │ │

    socks_category()

    │ │ │

    Declared in "libtorrent/socks5_stream.hpp"

    │ │ │
    │ │ │  boost::system::error_category& socks_category ();
    │ │ │  
    │ │ │

    returns the error_category for SOCKS5 errors

    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    pcp_category()

    │ │ │ -

    Declared in "libtorrent/natpmp.hpp"

    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    gzip_category()

    │ │ │ +

    Declared in "libtorrent/gzip.hpp"

    │ │ │
    │ │ │ -boost::system::error_category& pcp_category ();
    │ │ │ +boost::system::error_category& gzip_category ();
    │ │ │ +
    │ │ │ +

    get the error_category for zip errors

    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    i2p_category()

    │ │ │ +

    Declared in "libtorrent/i2p_stream.hpp"

    │ │ │ +
    │ │ │ +boost::system::error_category& i2p_category ();
    │ │ │  
    │ │ │ +

    returns the error category for I2P errors

    │ │ │ [report issue]
    │ │ │
    │ │ │

    bdecode_category()

    │ │ │

    Declared in "libtorrent/bdecode.hpp"

    │ │ │
    │ │ │  boost::system::error_category& bdecode_category ();
    │ │ │  
    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    libtorrent_category()

    │ │ │ +

    Declared in "libtorrent/error_code.hpp"

    │ │ │ +
    │ │ │ +boost::system::error_category& libtorrent_category ();
    │ │ │ +
    │ │ │ +

    return the instance of the libtorrent_error_category which │ │ │ +maps libtorrent error codes to human readable error messages.

    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    http_category()

    │ │ │ +

    Declared in "libtorrent/error_code.hpp"

    │ │ │ +
    │ │ │ +boost::system::error_category& http_category ();
    │ │ │ +
    │ │ │ +

    returns the error_category for HTTP errors

    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    enum pcp_errors

    │ │ │ +

    Declared in "libtorrent/natpmp.hpp"

    │ │ │ + │ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
    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 
    │ │ │ [report issue]
    │ │ │
    │ │ │

    enum error_code_enum

    │ │ │ +

    Declared in "libtorrent/upnp.hpp"

    │ │ │ + │ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
    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 │ │ │ +must be fully specified
    external_port_cannot_be_wildcarded716The external port cannot be a wildcard, but must │ │ │ +be specified
    port_mapping_conflict718The port mapping entry specified conflicts with a │ │ │ +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 │ │ │ +lease times on port mappings
    remote_host_must_be_wildcard726RemoteHost must be a wildcard and cannot be a │ │ │ +specific IP address or DNS name
    external_port_must_be_wildcard727ExternalPort must be a wildcard and cannot be a │ │ │ +specific port
    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    enum socks_error_code

    │ │ │ +

    Declared in "libtorrent/socks5_stream.hpp"

    │ │ │ + │ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
    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 
    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    enum error_code_enum

    │ │ │ +

    Declared in "libtorrent/gzip.hpp"

    │ │ │ + │ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
    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 │ │ │ +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
    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    enum i2p_error_code

    │ │ │ +

    Declared in "libtorrent/i2p_stream.hpp"

    │ │ │ + │ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
    namevaluedescription
    no_error0 
    parse_failed1 
    cant_reach_peer2 
    i2p_error3 
    invalid_key4 
    invalid_id5 
    timeout6 
    key_not_found7 
    duplicated_id8 
    num_errors9 
    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    enum error_code_enum

    │ │ │ +

    Declared in "libtorrent/bdecode.hpp"

    │ │ │ + │ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ +
    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
    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    enum error_code_enum

    │ │ │

    Declared in "libtorrent/error_code.hpp"

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -991,423 +1400,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    service_unavailable503 
    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    enum error_code_enum

    │ │ │ -

    Declared in "libtorrent/gzip.hpp"

    │ │ │ - │ │ │ -│ │ │ -│ │ │ -│ │ │ -│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
    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 │ │ │ -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
    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    enum error_code_enum

    │ │ │ -

    Declared in "libtorrent/upnp.hpp"

    │ │ │ - │ │ │ -│ │ │ -│ │ │ -│ │ │ -│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
    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 │ │ │ -must be fully specified
    external_port_cannot_be_wildcarded716The external port cannot be a wildcard, but must │ │ │ -be specified
    port_mapping_conflict718The port mapping entry specified conflicts with a │ │ │ -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 │ │ │ -lease times on port mappings
    remote_host_must_be_wildcard726RemoteHost must be a wildcard and cannot be a │ │ │ -specific IP address or DNS name
    external_port_must_be_wildcard727ExternalPort must be a wildcard and cannot be a │ │ │ -specific port
    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    enum i2p_error_code

    │ │ │ -

    Declared in "libtorrent/i2p_stream.hpp"

    │ │ │ - │ │ │ -│ │ │ -│ │ │ -│ │ │ -│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
    namevaluedescription
    no_error0 
    parse_failed1 
    cant_reach_peer2 
    i2p_error3 
    invalid_key4 
    invalid_id5 
    timeout6 
    key_not_found7 
    duplicated_id8 
    num_errors9 
    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    enum socks_error_code

    │ │ │ -

    Declared in "libtorrent/socks5_stream.hpp"

    │ │ │ - │ │ │ -│ │ │ -│ │ │ -│ │ │ -│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
    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 
    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    enum pcp_errors

    │ │ │ -

    Declared in "libtorrent/natpmp.hpp"

    │ │ │ - │ │ │ -│ │ │ -│ │ │ -│ │ │ -│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
    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 
    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    enum error_code_enum

    │ │ │ -

    Declared in "libtorrent/bdecode.hpp"

    │ │ │ - │ │ │ -│ │ │ -│ │ │ -│ │ │ -│ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ - │ │ │ -
    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
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ │ │ │ -
    │ │ │ -

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

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

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

    │ │ │
    │ │ │  virtual void sent_have (piece_index_t);
    │ │ │  virtual void sent_interested ();
    │ │ │  virtual void sent_piece (peer_request const&);
    │ │ │  virtual void sent_not_interested ();
    │ │ │  virtual void sent_unchoke ();
    │ │ │  
    │ │ │ @@ -669,21 +739,21 @@ │ │ │
    │ │ │

    on_unknown_message()

    │ │ │
    │ │ │  virtual bool on_unknown_message (int /*length*/, int /*msg*/,
    │ │ │        span<char const> /*body*/);
    │ │ │  
    │ │ │

    this is not called for web seeds

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    on_piece_pass() on_piece_failed()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    on_piece_failed() on_piece_pass()

    │ │ │
    │ │ │ -virtual void on_piece_failed (piece_index_t);
    │ │ │  virtual void on_piece_pass (piece_index_t);
    │ │ │ +virtual void on_piece_failed (piece_index_t);
    │ │ │  
    │ │ │

    called when a piece that this peer participated in either │ │ │ fails or passes the hash_check

    │ │ │ [report issue]
    │ │ │
    │ │ │

    tick()

    │ │ │
    │ │ │ @@ -723,86 +793,16 @@
    │ │ │  (consume, produce, packet_size)

    │ │ │

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

    │ │ │

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

    │ │ │

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

    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -
    │ │ │ -

    peer_connection_handle

    │ │ │ -

    Declared in "libtorrent/peer_connection_handle.hpp"

    │ │ │ -

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

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

    bt_peer_connection_handle

    │ │ │ -

    Declared in "libtorrent/peer_connection_handle.hpp"

    │ │ │ -

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

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

    create_ut_pex_plugin()

    │ │ │

    Declared in "libtorrent/extensions/ut_pex.hpp"

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

    constructor function for the ut_pex extension. The ut_pex │ │ │ ├── html2text {} │ │ │ │ @@ -2,57 +2,57 @@ │ │ │ │ _[_l_i_b_t_o_r_r_e_n_t_ _l_o_g_o_] │ │ │ │ VVeerrssiioonn:: 2.0.11 │ │ │ │ _h_o_m_e │ │ │ │ Table of contents │ │ │ │ * _a_ _w_o_r_d_ _o_f_ _c_a_u_t_i_o_n │ │ │ │ * _p_l_u_g_i_n_-_i_n_t_e_r_f_a_c_e │ │ │ │ * _c_u_s_t_o_m_ _a_l_e_r_t_s │ │ │ │ + * _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e │ │ │ │ + * _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e │ │ │ │ * _p_l_u_g_i_n │ │ │ │ o _i_m_p_l_e_m_e_n_t_e_d___f_e_a_t_u_r_e_s_(_) │ │ │ │ o _n_e_w___t_o_r_r_e_n_t_(_) │ │ │ │ o _a_d_d_e_d_(_) │ │ │ │ o _a_b_o_r_t_(_) │ │ │ │ o _o_n___d_h_t___r_e_q_u_e_s_t_(_) │ │ │ │ o _o_n___a_l_e_r_t_(_) │ │ │ │ o _o_n___u_n_k_n_o_w_n___t_o_r_r_e_n_t_(_) │ │ │ │ o _o_n___t_i_c_k_(_) │ │ │ │ o _g_e_t___u_n_c_h_o_k_e___p_r_i_o_r_i_t_y_(_) │ │ │ │ o _l_o_a_d___s_t_a_t_e_(_) │ │ │ │ * _t_o_r_r_e_n_t___p_l_u_g_i_n │ │ │ │ o _n_e_w___c_o_n_n_e_c_t_i_o_n_(_) │ │ │ │ - o _o_n___p_i_e_c_e___p_a_s_s_(_)_ _o_n___p_i_e_c_e___f_a_i_l_e_d_(_) │ │ │ │ + o _o_n___p_i_e_c_e___f_a_i_l_e_d_(_)_ _o_n___p_i_e_c_e___p_a_s_s_(_) │ │ │ │ o _t_i_c_k_(_) │ │ │ │ o _o_n___p_a_u_s_e_(_)_ _o_n___r_e_s_u_m_e_(_) │ │ │ │ o _o_n___f_i_l_e_s___c_h_e_c_k_e_d_(_) │ │ │ │ o _o_n___s_t_a_t_e_(_) │ │ │ │ o _o_n___a_d_d___p_e_e_r_(_) │ │ │ │ * _p_e_e_r___p_l_u_g_i_n │ │ │ │ o _t_y_p_e_(_) │ │ │ │ o _a_d_d___h_a_n_d_s_h_a_k_e_(_) │ │ │ │ o _o_n___d_i_s_c_o_n_n_e_c_t_(_) │ │ │ │ o _o_n___c_o_n_n_e_c_t_e_d_(_) │ │ │ │ o _o_n___h_a_n_d_s_h_a_k_e_(_) │ │ │ │ o _o_n___e_x_t_e_n_s_i_o_n___h_a_n_d_s_h_a_k_e_(_) │ │ │ │ - o _o_n___u_n_c_h_o_k_e_(_)_ _o_n___h_a_v_e___n_o_n_e_(_)_ _o_n___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _o_n___r_e_q_u_e_s_t_(_) │ │ │ │ - _o_n___d_o_n_t___h_a_v_e_(_)_ _o_n___h_a_v_e___a_l_l_(_)_ _o_n___b_i_t_f_i_e_l_d_(_)_ _o_n___h_a_v_e_(_) │ │ │ │ - _o_n___a_l_l_o_w_e_d___f_a_s_t_(_)_ _o_n___c_h_o_k_e_(_)_ _o_n___i_n_t_e_r_e_s_t_e_d_(_) │ │ │ │ + o _o_n___a_l_l_o_w_e_d___f_a_s_t_(_)_ _o_n___h_a_v_e___n_o_n_e_(_)_ _o_n___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _o_n___r_e_q_u_e_s_t_(_) │ │ │ │ + _o_n___u_n_c_h_o_k_e_(_)_ _o_n___h_a_v_e___a_l_l_(_)_ _o_n___d_o_n_t___h_a_v_e_(_)_ _o_n___c_h_o_k_e_(_)_ _o_n___i_n_t_e_r_e_s_t_e_d │ │ │ │ + _(_)_ _o_n___h_a_v_e_(_)_ _o_n___b_i_t_f_i_e_l_d_(_) │ │ │ │ o _o_n___p_i_e_c_e_(_) │ │ │ │ - o _s_e_n_t___u_n_c_h_o_k_e_(_)_ _s_e_n_t___h_a_v_e_(_)_ _s_e_n_t___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _s_e_n_t___p_i_e_c_e_(_) │ │ │ │ - _s_e_n_t___i_n_t_e_r_e_s_t_e_d_(_) │ │ │ │ + o _s_e_n_t___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _s_e_n_t___u_n_c_h_o_k_e_(_)_ _s_e_n_t___h_a_v_e_(_)_ _s_e_n_t___i_n_t_e_r_e_s_t_e_d_(_) │ │ │ │ + _s_e_n_t___p_i_e_c_e_(_) │ │ │ │ o _s_e_n_t___p_a_y_l_o_a_d_(_) │ │ │ │ o _c_a_n___d_i_s_c_o_n_n_e_c_t_(_) │ │ │ │ o _o_n___e_x_t_e_n_d_e_d_(_) │ │ │ │ o _o_n___u_n_k_n_o_w_n___m_e_s_s_a_g_e_(_) │ │ │ │ - o _o_n___p_i_e_c_e___p_a_s_s_(_)_ _o_n___p_i_e_c_e___f_a_i_l_e_d_(_) │ │ │ │ + o _o_n___p_i_e_c_e___f_a_i_l_e_d_(_)_ _o_n___p_i_e_c_e___p_a_s_s_(_) │ │ │ │ o _t_i_c_k_(_) │ │ │ │ o _w_r_i_t_e___r_e_q_u_e_s_t_(_) │ │ │ │ * _c_r_y_p_t_o___p_l_u_g_i_n │ │ │ │ o _d_e_c_r_y_p_t_(_) │ │ │ │ - * _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e │ │ │ │ - * _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e │ │ │ │ * _c_r_e_a_t_e___u_t___p_e_x___p_l_u_g_i_n_(_) │ │ │ │ * _c_r_e_a_t_e___s_m_a_r_t___b_a_n___p_l_u_g_i_n_(_) │ │ │ │ * _c_r_e_a_t_e___u_t___m_e_t_a_d_a_t_a___p_l_u_g_i_n_(_) │ │ │ │ libtorrent has a _p_l_u_g_i_n interface for implementing extensions to the protocol. │ │ │ │ These can be general extensions for transferring metadata or peer exchange │ │ │ │ extensions, or it could be used to provide a way to customize the protocol to │ │ │ │ fit a particular (closed) network. │ │ │ │ @@ -131,14 +131,79 @@ │ │ │ │ The static category is required for checking whether or not the category for a │ │ │ │ specific _a_l_e_r_t is enabled or not, without instantiating the _a_l_e_r_t. The category │ │ │ │ virtual function is the run-time equivalence. │ │ │ │ The what() virtual function may simply be a string literal of the class name of │ │ │ │ your _a_l_e_r_t. │ │ │ │ For more information, see the _a_l_e_r_t_ _s_e_c_t_i_o_n. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ +************ ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************ │ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p" │ │ │ │ +the _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e class provides a handle to the internal peer │ │ │ │ +connection object, to be used by plugins. This is a low level interface that │ │ │ │ +may not be stable across libtorrent versions │ │ │ │ +struct peer_connection_handle │ │ │ │ +{ │ │ │ │ + explicit ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (std::weak_ptr impl); │ │ │ │ + connection_type ttyyppee () const; │ │ │ │ + void aadddd__eexxtteennssiioonn (std::shared_ptr); │ │ │ │ + peer_plugin const* ffiinndd__pplluuggiinn (string_view type) const; │ │ │ │ + bool iiss__sseeeedd () const; │ │ │ │ + bool uuppllooaadd__oonnllyy () const; │ │ │ │ + bool hhaass__ppiieeccee (piece_index_t i) const; │ │ │ │ + peer_id const& ppiidd () const; │ │ │ │ + bool iiss__iinntteerreessttiinngg () const; │ │ │ │ + bool iiss__cchhookkeedd () const; │ │ │ │ + bool iiss__ppeeeerr__iinntteerreesstteedd () const; │ │ │ │ + bool hhaass__ppeeeerr__cchhookkeedd () const; │ │ │ │ + void mmaayybbee__uunncchhookkee__tthhiiss__ppeeeerr (); │ │ │ │ + void cchhookkee__tthhiiss__ppeeeerr (); │ │ │ │ + void ggeett__ppeeeerr__iinnffoo (peer_info& p) const; │ │ │ │ + torrent_handle aassssoocciiaatteedd__ttoorrrreenntt () const; │ │ │ │ + _t_c_p_:_:_e_n_d_p_o_i_n_t llooccaall__eennddppooiinntt () const; │ │ │ │ + _t_c_p_:_:_e_n_d_p_o_i_n_t const& rreemmoottee () const; │ │ │ │ + bool iiss__ccoonnnneeccttiinngg () const; │ │ │ │ + void ddiissccoonnnneecctt (error_code const& ec, operation_t op │ │ │ │ + , disconnect_severity_t = peer_connection_interface::normal); │ │ │ │ + bool iiss__ddiissccoonnnneeccttiinngg () const; │ │ │ │ + bool iiss__oouuttggooiinngg () const; │ │ │ │ + bool iiggnnoorree__uunncchhookkee__sslloottss () const; │ │ │ │ + bool oonn__llooccaall__nneettwwoorrkk () const; │ │ │ │ + bool ffaaiilleedd () const; │ │ │ │ + void ppeeeerr__lloogg (peer_log_alert::direction_t direction │ │ │ │ + , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT │ │ │ │ +(4,5); │ │ │ │ + bool sshhoouulldd__lloogg (peer_log_alert::direction_t direction) const; │ │ │ │ + bool ccaann__ddiissccoonnnneecctt (error_code const& ec) const; │ │ │ │ + bool hhaass__mmeettaaddaattaa () const; │ │ │ │ + bool iinn__hhaannddsshhaakkee () const; │ │ │ │ + void sseenndd__bbuuffffeerr (char const* begin, int size); │ │ │ │ + std::time_t llaasstt__sseeeenn__ccoommpplleettee () const; │ │ │ │ + time_point ttiimmee__ooff__llaasstt__uunncchhookkee () const; │ │ │ │ + bool ooppeerraattoorr!!== (peer_connection_handle const& o) const; │ │ │ │ + bool ooppeerraattoorr==== (peer_connection_handle const& o) const; │ │ │ │ + bool ooppeerraattoorr<< (peer_connection_handle const& o) const; │ │ │ │ + std::shared_ptr nnaattiivvee__hhaannddllee () const; │ │ │ │ +}; │ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ +************ bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************ │ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p" │ │ │ │ +The _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e provides a handle to the internal bittorrent peer │ │ │ │ +connection object to plugins. It's low level and may not be a stable API across │ │ │ │ +libtorrent versions. │ │ │ │ +struct bt_peer_connection_handle : peer_connection_handle │ │ │ │ +{ │ │ │ │ + explicit bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (peer_connection_handle pc); │ │ │ │ + bool ssuuppppoorrtt__eexxtteennssiioonnss () const; │ │ │ │ + bool ppaacckkeett__ffiinniisshheedd () const; │ │ │ │ + bool ssuuppppoorrttss__eennccrryyppttiioonn () const; │ │ │ │ + void sswwiittcchh__rreeccvv__ccrryyppttoo (std::shared_ptr crypto); │ │ │ │ + void sswwiittcchh__sseenndd__ccrryyppttoo (std::shared_ptr crypto); │ │ │ │ + std::shared_ptr nnaattiivvee__hhaannddllee () const; │ │ │ │ +}; │ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ pplluuggiinn ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_._h_p_p" │ │ │ │ this is the base class for a _s_e_s_s_i_o_n _p_l_u_g_i_n. One primary feature is that it is │ │ │ │ notified of all torrents that are added to the _s_e_s_s_i_o_n, and can add its own │ │ │ │ torrent_plugins. │ │ │ │ struct plugin │ │ │ │ { │ │ │ │ @@ -256,19 +321,19 @@ │ │ │ │ Torrent plugins are associated with a single torrent and have a number of │ │ │ │ functions called at certain events. Many of its functions have the ability to │ │ │ │ change or override the default libtorrent behavior. │ │ │ │ struct torrent_plugin │ │ │ │ { │ │ │ │ virtual std::shared_ptr nneeww__ccoonnnneeccttiioonn (peer_connection_handle │ │ │ │ const&); │ │ │ │ - virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t); │ │ │ │ virtual void oonn__ppiieeccee__ppaassss (piece_index_t); │ │ │ │ + virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t); │ │ │ │ virtual void ttiicckk (); │ │ │ │ - virtual bool oonn__rreessuummee (); │ │ │ │ virtual bool oonn__ppaauussee (); │ │ │ │ + virtual bool oonn__rreessuummee (); │ │ │ │ virtual void oonn__ffiilleess__cchheecckkeedd (); │ │ │ │ virtual void oonn__ssttaattee (torrent_status::state_t); │ │ │ │ virtual void oonn__aadddd__ppeeeerr (tcp::endpoint const&, │ │ │ │ peer_source_flags_t, add_peer_flags_t); │ │ │ │ │ │ │ │ static constexpr add_peer_flags_t ffiirrsstt__ttiimmee = 1_bit; │ │ │ │ static constexpr add_peer_flags_t ffiilltteerreedd = 2_bit; │ │ │ │ @@ -285,30 +350,30 @@ │ │ │ │ have its hook functions called on event specific to that peer. │ │ │ │ The peer_connection_handle will be valid as long as the shared_ptr is being │ │ │ │ held by the torrent object. So, it is generally a good idea to not keep a │ │ │ │ shared_ptr to your own _p_e_e_r___p_l_u_g_i_n. If you want to keep references to it, use │ │ │ │ weak_ptr. │ │ │ │ If this function throws an exception, the connection will be closed. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** oonn__ppiieeccee__ppaassss(()) oonn__ppiieeccee__ffaaiilleedd(()) ********** │ │ │ │ -virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t); │ │ │ │ +********** oonn__ppiieeccee__ffaaiilleedd(()) oonn__ppiieeccee__ppaassss(()) ********** │ │ │ │ virtual void oonn__ppiieeccee__ppaassss (piece_index_t); │ │ │ │ +virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t); │ │ │ │ These hooks are called when a piece passes the hash check or fails the hash │ │ │ │ check, respectively. The index is the piece index that was downloaded. It is │ │ │ │ possible to access the list of peers that participated in sending the piece │ │ │ │ through the torrent and the piece_picker. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** ttiicckk(()) ********** │ │ │ │ virtual void ttiicckk (); │ │ │ │ This hook is called approximately once per second. It is a way of making it │ │ │ │ easy for plugins to do timed events, for sending messages or whatever. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** oonn__ppaauussee(()) oonn__rreessuummee(()) ********** │ │ │ │ -virtual bool oonn__rreessuummee (); │ │ │ │ virtual bool oonn__ppaauussee (); │ │ │ │ +virtual bool oonn__rreessuummee (); │ │ │ │ These hooks are called when the torrent is paused and resumed respectively. The │ │ │ │ return value indicates if the event was handled. A return value of true │ │ │ │ indicates that it was handled, and no other _p_l_u_g_i_n after this one will have │ │ │ │ this hook function called, and the standard handler will also not be invoked. │ │ │ │ So, returning true effectively overrides the standard behavior of pause or │ │ │ │ resume. │ │ │ │ Note that if you call pause() or resume() on the torrent from your handler it │ │ │ │ @@ -354,51 +419,51 @@ │ │ │ │ { │ │ │ │ virtual string_view ttyyppee () const; │ │ │ │ virtual void aadddd__hhaannddsshhaakkee (entry&); │ │ │ │ virtual void oonn__ddiissccoonnnneecctt (error_code const&); │ │ │ │ virtual void oonn__ccoonnnneecctteedd (); │ │ │ │ virtual bool oonn__hhaannddsshhaakkee (span); │ │ │ │ virtual bool oonn__eexxtteennssiioonn__hhaannddsshhaakkee (bdecode_node const&); │ │ │ │ - virtual bool oonn__hhaavvee__nnoonnee (); │ │ │ │ + virtual bool oonn__iinntteerreesstteedd (); │ │ │ │ virtual bool oonn__hhaavvee (piece_index_t); │ │ │ │ - virtual bool oonn__rreeqquueesstt (peer_request const&); │ │ │ │ - virtual bool oonn__nnoott__iinntteerreesstteedd (); │ │ │ │ - virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t); │ │ │ │ + virtual bool oonn__hhaavvee__aallll (); │ │ │ │ + virtual bool oonn__uunncchhookkee (); │ │ │ │ virtual bool oonn__bbiittffiieelldd (bitfield const& //**bbiittffiieelldd**//); │ │ │ │ - virtual bool oonn__iinntteerreesstteedd (); │ │ │ │ virtual bool oonn__cchhookkee (); │ │ │ │ - virtual bool oonn__uunncchhookkee (); │ │ │ │ - virtual bool oonn__hhaavvee__aallll (); │ │ │ │ + virtual bool oonn__nnoott__iinntteerreesstteedd (); │ │ │ │ + virtual bool oonn__hhaavvee__nnoonnee (); │ │ │ │ + virtual bool oonn__rreeqquueesstt (peer_request const&); │ │ │ │ virtual bool oonn__ddoonntt__hhaavvee (piece_index_t); │ │ │ │ + virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t); │ │ │ │ virtual bool oonn__ppiieeccee (peer_request const& //**ppiieeccee**// │ │ │ │ , span //**bbuuff**//); │ │ │ │ + virtual bool oonn__ccaanncceell (peer_request const&); │ │ │ │ virtual bool oonn__rreejjeecctt (peer_request const&); │ │ │ │ virtual bool oonn__ssuuggggeesstt (piece_index_t); │ │ │ │ - virtual bool oonn__ccaanncceell (peer_request const&); │ │ │ │ - virtual void sseenntt__aallllooww__ffaasstt (piece_index_t); │ │ │ │ - virtual void sseenntt__cchhookkee (); │ │ │ │ - virtual void sseenntt__hhaavvee__aallll (); │ │ │ │ virtual void sseenntt__ssuuggggeesstt (piece_index_t); │ │ │ │ + virtual void sseenntt__ccaanncceell (peer_request const&); │ │ │ │ + virtual void sseenntt__cchhookkee (); │ │ │ │ virtual void sseenntt__rreeqquueesstt (peer_request const&); │ │ │ │ - virtual void sseenntt__hhaavvee__nnoonnee (); │ │ │ │ + virtual void sseenntt__aallllooww__ffaasstt (piece_index_t); │ │ │ │ virtual void sseenntt__rreejjeecctt__rreeqquueesstt (peer_request const&); │ │ │ │ - virtual void sseenntt__ccaanncceell (peer_request const&); │ │ │ │ + virtual void sseenntt__hhaavvee__aallll (); │ │ │ │ + virtual void sseenntt__hhaavvee__nnoonnee (); │ │ │ │ virtual void sseenntt__hhaavvee (piece_index_t); │ │ │ │ virtual void sseenntt__iinntteerreesstteedd (); │ │ │ │ virtual void sseenntt__ppiieeccee (peer_request const&); │ │ │ │ virtual void sseenntt__nnoott__iinntteerreesstteedd (); │ │ │ │ virtual void sseenntt__uunncchhookkee (); │ │ │ │ virtual void sseenntt__ppaayyllooaadd (int //** bbyytteess **//); │ │ │ │ virtual bool ccaann__ddiissccoonnnneecctt (error_code const& //**eecc**//); │ │ │ │ virtual bool oonn__eexxtteennddeedd (int //**lleennggtthh**//, int //**mmssgg**//, │ │ │ │ span //**bbooddyy**//); │ │ │ │ virtual bool oonn__uunnkknnoowwnn__mmeessssaaggee (int //**lleennggtthh**//, int //**mmssgg**//, │ │ │ │ span //**bbooddyy**//); │ │ │ │ - virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t); │ │ │ │ virtual void oonn__ppiieeccee__ppaassss (piece_index_t); │ │ │ │ + virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t); │ │ │ │ virtual void ttiicckk (); │ │ │ │ virtual bool wwrriittee__rreeqquueesstt (peer_request const&); │ │ │ │ }; │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** ttyyppee(()) ********** │ │ │ │ virtual string_view ttyyppee () const; │ │ │ │ This function is expected to return the name of the _p_l_u_g_i_n. │ │ │ │ @@ -426,43 +491,43 @@ │ │ │ │ ********** oonn__eexxtteennssiioonn__hhaannddsshhaakkee(()) ********** │ │ │ │ virtual bool oonn__eexxtteennssiioonn__hhaannddsshhaakkee (bdecode_node const&); │ │ │ │ called when the extension handshake from the other end is received if this │ │ │ │ returns false, it means that this extension isn't supported by this peer. It │ │ │ │ will result in this _p_e_e_r___p_l_u_g_i_n being removed from the peer_connection and │ │ │ │ destructed. this is not called for web seeds │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** oonn__uunncchhookkee(()) oonn__hhaavvee__nnoonnee(()) oonn__nnoott__iinntteerreesstteedd(()) oonn__rreeqquueesstt(()) oonn__ddoonntt__hhaavvee │ │ │ │ -(()) oonn__hhaavvee__aallll(()) oonn__bbiittffiieelldd(()) oonn__hhaavvee(()) oonn__aalllloowweedd__ffaasstt(()) oonn__cchhookkee(()) │ │ │ │ -oonn__iinntteerreesstteedd(()) ********** │ │ │ │ -virtual bool oonn__hhaavvee__nnoonnee (); │ │ │ │ +********** oonn__aalllloowweedd__ffaasstt(()) oonn__hhaavvee__nnoonnee(()) oonn__nnoott__iinntteerreesstteedd(()) oonn__rreeqquueesstt(()) │ │ │ │ +oonn__uunncchhookkee(()) oonn__hhaavvee__aallll(()) oonn__ddoonntt__hhaavvee(()) oonn__cchhookkee(()) oonn__iinntteerreesstteedd(()) oonn__hhaavvee(()) │ │ │ │ +oonn__bbiittffiieelldd(()) ********** │ │ │ │ +virtual bool oonn__iinntteerreesstteedd (); │ │ │ │ virtual bool oonn__hhaavvee (piece_index_t); │ │ │ │ -virtual bool oonn__rreeqquueesstt (peer_request const&); │ │ │ │ -virtual bool oonn__nnoott__iinntteerreesstteedd (); │ │ │ │ -virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t); │ │ │ │ +virtual bool oonn__hhaavvee__aallll (); │ │ │ │ +virtual bool oonn__uunncchhookkee (); │ │ │ │ virtual bool oonn__bbiittffiieelldd (bitfield const& //**bbiittffiieelldd**//); │ │ │ │ -virtual bool oonn__iinntteerreesstteedd (); │ │ │ │ virtual bool oonn__cchhookkee (); │ │ │ │ -virtual bool oonn__uunncchhookkee (); │ │ │ │ -virtual bool oonn__hhaavvee__aallll (); │ │ │ │ +virtual bool oonn__nnoott__iinntteerreesstteedd (); │ │ │ │ +virtual bool oonn__hhaavvee__nnoonnee (); │ │ │ │ +virtual bool oonn__rreeqquueesstt (peer_request const&); │ │ │ │ virtual bool oonn__ddoonntt__hhaavvee (piece_index_t); │ │ │ │ +virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t); │ │ │ │ returning true from any of the message handlers indicates that the _p_l_u_g_i_n has │ │ │ │ handled the message. it will break the _p_l_u_g_i_n chain traversing and not let │ │ │ │ anyone else handle the message, including the default handler. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** oonn__ppiieeccee(()) ********** │ │ │ │ virtual bool oonn__ppiieeccee (peer_request const& //**ppiieeccee**// │ │ │ │ , span //**bbuuff**//); │ │ │ │ This function is called when the peer connection is receiving a piece. buf │ │ │ │ points (non-owning pointer) to the data in an internal immutable disk buffer. │ │ │ │ The length of the data is specified in the length member of the piece │ │ │ │ parameter. returns true to indicate that the piece is handled and the rest of │ │ │ │ the logic should be ignored. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** sseenntt__uunncchhookkee(()) sseenntt__hhaavvee(()) sseenntt__nnoott__iinntteerreesstteedd(()) sseenntt__ppiieeccee(()) │ │ │ │ -sseenntt__iinntteerreesstteedd(()) ********** │ │ │ │ +********** sseenntt__nnoott__iinntteerreesstteedd(()) sseenntt__uunncchhookkee(()) sseenntt__hhaavvee(()) sseenntt__iinntteerreesstteedd(()) │ │ │ │ +sseenntt__ppiieeccee(()) ********** │ │ │ │ virtual void sseenntt__hhaavvee (piece_index_t); │ │ │ │ virtual void sseenntt__iinntteerreesstteedd (); │ │ │ │ virtual void sseenntt__ppiieeccee (peer_request const&); │ │ │ │ virtual void sseenntt__nnoott__iinntteerreesstteedd (); │ │ │ │ virtual void sseenntt__uunncchhookkee (); │ │ │ │ called after a choke message has been sent to the peer │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ @@ -490,17 +555,17 @@ │ │ │ │ receiving large messages. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** oonn__uunnkknnoowwnn__mmeessssaaggee(()) ********** │ │ │ │ virtual bool oonn__uunnkknnoowwnn__mmeessssaaggee (int //**lleennggtthh**//, int //**mmssgg**//, │ │ │ │ span //**bbooddyy**//); │ │ │ │ this is not called for web seeds │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** oonn__ppiieeccee__ppaassss(()) oonn__ppiieeccee__ffaaiilleedd(()) ********** │ │ │ │ -virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t); │ │ │ │ +********** oonn__ppiieeccee__ffaaiilleedd(()) oonn__ppiieeccee__ppaassss(()) ********** │ │ │ │ virtual void oonn__ppiieeccee__ppaassss (piece_index_t); │ │ │ │ +virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t); │ │ │ │ called when a piece that this peer participated in either fails or passes the │ │ │ │ hash_check │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** ttiicckk(()) ********** │ │ │ │ virtual void ttiicckk (); │ │ │ │ called approximately once every second │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ @@ -529,79 +594,14 @@ │ │ │ │ consume is set to the number of bytes which should be trimmed from the head of │ │ │ │ the buffers, default is 0 │ │ │ │ produce is set to the number of bytes of payload which are now ready to be sent │ │ │ │ to the upper layer. default is the number of bytes passed in receive_vec │ │ │ │ packet_size is set to the minimum number of bytes which must be read to advance │ │ │ │ the next step of decryption. default is 0 │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -************ ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************ │ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p" │ │ │ │ -the _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e class provides a handle to the internal peer │ │ │ │ -connection object, to be used by plugins. This is a low level interface that │ │ │ │ -may not be stable across libtorrent versions │ │ │ │ -struct peer_connection_handle │ │ │ │ -{ │ │ │ │ - explicit ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (std::weak_ptr impl); │ │ │ │ - connection_type ttyyppee () const; │ │ │ │ - peer_plugin const* ffiinndd__pplluuggiinn (string_view type) const; │ │ │ │ - void aadddd__eexxtteennssiioonn (std::shared_ptr); │ │ │ │ - bool iiss__sseeeedd () const; │ │ │ │ - bool uuppllooaadd__oonnllyy () const; │ │ │ │ - peer_id const& ppiidd () const; │ │ │ │ - bool hhaass__ppiieeccee (piece_index_t i) const; │ │ │ │ - bool iiss__iinntteerreessttiinngg () const; │ │ │ │ - bool iiss__cchhookkeedd () const; │ │ │ │ - bool iiss__ppeeeerr__iinntteerreesstteedd () const; │ │ │ │ - bool hhaass__ppeeeerr__cchhookkeedd () const; │ │ │ │ - void cchhookkee__tthhiiss__ppeeeerr (); │ │ │ │ - void mmaayybbee__uunncchhookkee__tthhiiss__ppeeeerr (); │ │ │ │ - void ggeett__ppeeeerr__iinnffoo (peer_info& p) const; │ │ │ │ - torrent_handle aassssoocciiaatteedd__ttoorrrreenntt () const; │ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t const& rreemmoottee () const; │ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t llooccaall__eennddppooiinntt () const; │ │ │ │ - void ddiissccoonnnneecctt (error_code const& ec, operation_t op │ │ │ │ - , disconnect_severity_t = peer_connection_interface::normal); │ │ │ │ - bool iiss__oouuttggooiinngg () const; │ │ │ │ - bool iiss__ccoonnnneeccttiinngg () const; │ │ │ │ - bool iiss__ddiissccoonnnneeccttiinngg () const; │ │ │ │ - bool oonn__llooccaall__nneettwwoorrkk () const; │ │ │ │ - bool iiggnnoorree__uunncchhookkee__sslloottss () const; │ │ │ │ - bool ffaaiilleedd () const; │ │ │ │ - bool sshhoouulldd__lloogg (peer_log_alert::direction_t direction) const; │ │ │ │ - void ppeeeerr__lloogg (peer_log_alert::direction_t direction │ │ │ │ - , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT │ │ │ │ -(4,5); │ │ │ │ - bool ccaann__ddiissccoonnnneecctt (error_code const& ec) const; │ │ │ │ - bool hhaass__mmeettaaddaattaa () const; │ │ │ │ - bool iinn__hhaannddsshhaakkee () const; │ │ │ │ - void sseenndd__bbuuffffeerr (char const* begin, int size); │ │ │ │ - std::time_t llaasstt__sseeeenn__ccoommpplleettee () const; │ │ │ │ - time_point ttiimmee__ooff__llaasstt__uunncchhookkee () const; │ │ │ │ - bool ooppeerraattoorr==== (peer_connection_handle const& o) const; │ │ │ │ - bool ooppeerraattoorr<< (peer_connection_handle const& o) const; │ │ │ │ - bool ooppeerraattoorr!!== (peer_connection_handle const& o) const; │ │ │ │ - std::shared_ptr nnaattiivvee__hhaannddllee () const; │ │ │ │ -}; │ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -************ bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************ │ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p" │ │ │ │ -The _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e provides a handle to the internal bittorrent peer │ │ │ │ -connection object to plugins. It's low level and may not be a stable API across │ │ │ │ -libtorrent versions. │ │ │ │ -struct bt_peer_connection_handle : peer_connection_handle │ │ │ │ -{ │ │ │ │ - explicit bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (peer_connection_handle pc); │ │ │ │ - bool ppaacckkeett__ffiinniisshheedd () const; │ │ │ │ - bool ssuuppppoorrtt__eexxtteennssiioonnss () const; │ │ │ │ - bool ssuuppppoorrttss__eennccrryyppttiioonn () const; │ │ │ │ - void sswwiittcchh__sseenndd__ccrryyppttoo (std::shared_ptr crypto); │ │ │ │ - void sswwiittcchh__rreeccvv__ccrryyppttoo (std::shared_ptr crypto); │ │ │ │ - std::shared_ptr nnaattiivvee__hhaannddllee () const; │ │ │ │ -}; │ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ ccrreeaattee__uutt__ppeexx__pplluuggiinn(()) ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_/_u_t___p_e_x_._h_p_p" │ │ │ │ std::shared_ptr ccrreeaattee__uutt__ppeexx__pplluuggiinn (torrent_handle const&, │ │ │ │ client_data_t); │ │ │ │ constructor function for the ut_pex extension. The ut_pex extension allows │ │ │ │ peers to gossip about their connections, allowing the swarm stay well connected │ │ │ │ and peers aware of more peers in the swarm. This extension is enabled by │ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html │ │ │ @@ -29,27 +29,27 @@ │ │ │ │ │ │ │ │ │

    home

    │ │ │
    │ │ │

    Table of contents

    │ │ │ │ │ │
    │ │ │ [report issue]
    │ │ │

    read_resume_data()

    │ │ │

    Declared in "libtorrent/read_resume_data.hpp"

    │ │ │
    │ │ │ -add_torrent_params read_resume_data (span<char const> buffer
    │ │ │ -   , error_code& ec, load_torrent_limits const& cfg = {});
    │ │ │  add_torrent_params read_resume_data (bdecode_node const& rd
    │ │ │     , error_code& ec, int piece_limit = 0x200000);
    │ │ │ +add_torrent_params read_resume_data (span<char const> buffer
    │ │ │ +   , error_code& ec, load_torrent_limits const& cfg = {});
    │ │ │  add_torrent_params read_resume_data (bdecode_node const& rd
    │ │ │     , int piece_limit = 0x200000);
    │ │ │  add_torrent_params read_resume_data (span<char const> buffer
    │ │ │     , load_torrent_limits const& cfg = {});
    │ │ │  
    │ │ │

    these functions are used to parse resume data and populate the appropriate │ │ │ fields in an add_torrent_params object. This object can then be used to add │ │ │ @@ -61,35 +61,35 @@ │ │ │

    The piece_limit parameter determines the largest number of pieces │ │ │ allowed in the torrent that may be loaded as part of the resume data, if │ │ │ it contains an info field. The overloads that take a flat buffer are │ │ │ instead configured with limits on torrent sizes via load_torrent limits.

    │ │ │

    In order to support large torrents, it may also be necessary to raise the │ │ │ settings_pack::max_piece_count setting and pass a higher limit to calls │ │ │ to torrent_info::parse_info_section().

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    write_resume_data_buf() write_resume_data()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    write_resume_data() write_resume_data_buf()

    │ │ │

    Declared in "libtorrent/write_resume_data.hpp"

    │ │ │
    │ │ │ -std::vector<char> write_resume_data_buf (add_torrent_params const& atp);
    │ │ │  entry write_resume_data (add_torrent_params const& atp);
    │ │ │ +std::vector<char> write_resume_data_buf (add_torrent_params const& atp);
    │ │ │  
    │ │ │

    this function turns the resume data in an add_torrent_params object │ │ │ into a bencoded structure

    │ │ │ │ │ │ [report issue]
    │ │ │
    │ │ │

    write_torrent_file() write_torrent_file_buf()

    │ │ │

    Declared in "libtorrent/write_resume_data.hpp"

    │ │ │
    │ │ │ +entry write_torrent_file (add_torrent_params const& atp, write_torrent_flags_t flags);
    │ │ │ +entry write_torrent_file (add_torrent_params const& atp);
    │ │ │  std::vector<char> write_torrent_file_buf (add_torrent_params const& atp
    │ │ │     , write_torrent_flags_t flags);
    │ │ │ -entry write_torrent_file (add_torrent_params const& atp);
    │ │ │ -entry write_torrent_file (add_torrent_params const& atp, write_torrent_flags_t flags);
    │ │ │  
    │ │ │

    writes only the fields to create a .torrent file. This function may fail │ │ │ with a std::system_error exception if:

    │ │ │
      │ │ │
    • The add_torrent_params object passed to this function does not contain the │ │ │ info dictionary (the ti field)
    • │ │ │
    • The piece layers are not complete for all files that need them
    • │ │ │ ├── html2text {} │ │ │ │ @@ -1,23 +1,23 @@ │ │ │ │ > │ │ │ │ _[_l_i_b_t_o_r_r_e_n_t_ _l_o_g_o_] │ │ │ │ VVeerrssiioonn:: 2.0.11 │ │ │ │ _h_o_m_e │ │ │ │ Table of contents │ │ │ │ * _r_e_a_d___r_e_s_u_m_e___d_a_t_a_(_) │ │ │ │ - * _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a___b_u_f_(_)_ _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_(_) │ │ │ │ + * _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_(_)_ _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a___b_u_f_(_) │ │ │ │ * _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_)_ _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e___b_u_f_(_) │ │ │ │ * _w_r_i_t_e___t_o_r_r_e_n_t___f_l_a_g_s___t │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ rreeaadd__rreessuummee__ddaattaa(()) ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_r_e_a_d___r_e_s_u_m_e___d_a_t_a_._h_p_p" │ │ │ │ -add_torrent_params rreeaadd__rreessuummee__ddaattaa (span buffer │ │ │ │ - , error_code& ec, load_torrent_limits const& cfg = {}); │ │ │ │ add_torrent_params rreeaadd__rreessuummee__ddaattaa (bdecode_node const& rd │ │ │ │ , error_code& ec, int piece_limit = 0x200000); │ │ │ │ +add_torrent_params rreeaadd__rreessuummee__ddaattaa (span buffer │ │ │ │ + , error_code& ec, load_torrent_limits const& cfg = {}); │ │ │ │ add_torrent_params rreeaadd__rreessuummee__ddaattaa (bdecode_node const& rd │ │ │ │ , int piece_limit = 0x200000); │ │ │ │ add_torrent_params rreeaadd__rreessuummee__ddaattaa (span buffer │ │ │ │ , load_torrent_limits const& cfg = {}); │ │ │ │ these functions are used to parse resume data and populate the appropriate │ │ │ │ fields in an _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s object. This object can then be used to add the │ │ │ │ actual _t_o_r_r_e_n_t___i_n_f_o object to and pass to session::add_torrent() or session:: │ │ │ │ @@ -29,28 +29,28 @@ │ │ │ │ the torrent that may be loaded as part of the resume data, if it contains an │ │ │ │ info field. The overloads that take a flat buffer are instead configured with │ │ │ │ limits on torrent sizes via load_torrent limits. │ │ │ │ In order to support large torrents, it may also be necessary to raise the │ │ │ │ _s_e_t_t_i_n_g_s___p_a_c_k_:_:_m_a_x___p_i_e_c_e___c_o_u_n_t setting and pass a higher limit to calls to │ │ │ │ _t_o_r_r_e_n_t___i_n_f_o_:_:_p_a_r_s_e___i_n_f_o___s_e_c_t_i_o_n_(_). │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -************ wwrriittee__rreessuummee__ddaattaa__bbuuff(()) wwrriittee__rreessuummee__ddaattaa(()) ************ │ │ │ │ +************ wwrriittee__rreessuummee__ddaattaa(()) wwrriittee__rreessuummee__ddaattaa__bbuuff(()) ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_._h_p_p" │ │ │ │ -std::vector wwrriittee__rreessuummee__ddaattaa__bbuuff (add_torrent_params const& atp); │ │ │ │ entry wwrriittee__rreessuummee__ddaattaa (add_torrent_params const& atp); │ │ │ │ +std::vector wwrriittee__rreessuummee__ddaattaa__bbuuff (add_torrent_params const& atp); │ │ │ │ this function turns the resume data in an add_torrent_params object into a │ │ │ │ bencoded structure │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ wwrriittee__ttoorrrreenntt__ffiillee(()) wwrriittee__ttoorrrreenntt__ffiillee__bbuuff(()) ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_._h_p_p" │ │ │ │ -std::vector wwrriittee__ttoorrrreenntt__ffiillee__bbuuff (add_torrent_params const& atp │ │ │ │ - , write_torrent_flags_t flags); │ │ │ │ -entry wwrriittee__ttoorrrreenntt__ffiillee (add_torrent_params const& atp); │ │ │ │ entry wwrriittee__ttoorrrreenntt__ffiillee (add_torrent_params const& atp, write_torrent_flags_t │ │ │ │ flags); │ │ │ │ +entry wwrriittee__ttoorrrreenntt__ffiillee (add_torrent_params const& atp); │ │ │ │ +std::vector wwrriittee__ttoorrrreenntt__ffiillee__bbuuff (add_torrent_params const& atp │ │ │ │ + , write_torrent_flags_t flags); │ │ │ │ writes only the fields to create a .torrent file. This function may fail with a │ │ │ │ std::system_error exception if: │ │ │ │ * The _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s object passed to this function does not contain │ │ │ │ the info dictionary (the ti field) │ │ │ │ * The piece layers are not complete for all files that need them │ │ │ │ The write_torrent_file_buf() overload returns the torrent file in bencoded │ │ │ │ buffer form. This overload may be faster at the expense of lost flexibility to │ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html │ │ │ @@ -34,77 +34,77 @@ │ │ │ │ │ │
    │ │ │ [report issue]
    │ │ │

    session_params

    │ │ │

    Declared in "libtorrent/session_params.hpp"

    │ │ │

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

    │ │ │
    │ │ │  struct session_params
    │ │ │  {
    │ │ │ -   session_params ();
    │ │ │     session_params (settings_pack const& sp);
    │ │ │     session_params (settings_pack&& sp);
    │ │ │ +   session_params ();
    │ │ │     session_params (settings_pack&& sp
    │ │ │        , std::vector<std::shared_ptr<plugin>> exts);
    │ │ │     session_params (settings_pack const& sp
    │ │ │        , std::vector<std::shared_ptr<plugin>> exts);
    │ │ │  
    │ │ │     settings_pack settings;
    │ │ │     std::vector<std::shared_ptr<plugin>> extensions;
    │ │ │ @@ -114,17 +114,17 @@
    │ │ │     std::map<std::string, std::string> ext_state;
    │ │ │     libtorrent::ip_filter ip_filter;
    │ │ │  };
    │ │ │  
    │ │ │ [report issue]
    │ │ │

    session_params()

    │ │ │
    │ │ │ -session_params ();
    │ │ │  session_params (settings_pack const& sp);
    │ │ │  session_params (settings_pack&& sp);
    │ │ │ +session_params ();
    │ │ │  
    │ │ │

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

    │ │ │ [report issue]
    │ │ │
    │ │ │

    session_params()

    │ │ │ @@ -179,32 +179,32 @@ │ │ │ may outlive session, causing the session destructor to not block. The │ │ │ session_proxy destructor will block however, until the underlying session │ │ │ is done shutting down.

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

    ~session_proxy() operator=() session_proxy()

    │ │ │ +[report issue]
    │ │ │ +

    session_proxy() operator=() ~session_proxy()

    │ │ │
    │ │ │  session_proxy (session_proxy const&);
    │ │ │ +~session_proxy ();
    │ │ │  session_proxy& operator= (session_proxy&&) & noexcept;
    │ │ │ -session_proxy& operator= (session_proxy const&) &;
    │ │ │  session_proxy (session_proxy&&) noexcept;
    │ │ │ -~session_proxy ();
    │ │ │  session_proxy ();
    │ │ │ +session_proxy& operator= (session_proxy const&) &;
    │ │ │  
    │ │ │

    default constructor, does not refer to any session │ │ │ implementation object.

    │ │ │ [report issue]
    │ │ │
    │ │ │
    │ │ │

    session

    │ │ │ @@ -218,52 +218,52 @@ │ │ │ session_handle::apply_settings() member function. To change one or more │ │ │ configuration options, create a settings_pack. object and fill it with │ │ │ the settings to be set and pass it in to session::apply_settings().

    │ │ │

    see apply_settings().

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

    session()

    │ │ │
    │ │ │ -session (session_params const& params, session_flags_t flags);
    │ │ │  session (session_params&& params, session_flags_t flags);
    │ │ │ -explicit session (session_params&& params);
    │ │ │  session ();
    │ │ │ +explicit session (session_params&& params);
    │ │ │  explicit session (session_params const& params);
    │ │ │ +session (session_params const& params, session_flags_t flags);
    │ │ │  
    │ │ │

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

    │ │ │

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

    │ │ │ [report issue]
    │ │ │
    │ │ │

    session()

    │ │ │
    │ │ │  session (session_params&& params, io_context& ios);
    │ │ │ -session (session_params const& params, io_context& ios, session_flags_t);
    │ │ │ -session (session_params&& params, io_context& ios, session_flags_t);
    │ │ │  session (session_params const& params, io_context& ios);
    │ │ │ +session (session_params&& params, io_context& ios, session_flags_t);
    │ │ │ +session (session_params const& params, io_context& ios, session_flags_t);
    │ │ │  
    │ │ │

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

    │ │ │
    │ │ │ @@ -310,15 +310,15 @@ │ │ │ [report issue]
    │ │ │
    │ │ │
    │ │ │

    session_handle

    │ │ │

    Declared in "libtorrent/session_handle.hpp"

    │ │ │

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

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

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

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    get_torrent_status() refresh_torrent_status()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    refresh_torrent_status() get_torrent_status()

    │ │ │
    │ │ │  std::vector<torrent_status> get_torrent_status (
    │ │ │        std::function<bool(torrent_status const&)> const& pred
    │ │ │        , status_flags_t flags = {}) const;
    │ │ │  void refresh_torrent_status (std::vector<torrent_status>* ret
    │ │ │        , status_flags_t flags = {}) const;
    │ │ │  
    │ │ │ @@ -507,18 +507,18 @@ │ │ │
    │ │ │  void set_dht_state (dht::dht_state&& st);
    │ │ │  void set_dht_state (dht::dht_state const& st);
    │ │ │  
    │ │ │

    set the DHT state for the session. This will be taken into account the │ │ │ next time the DHT is started, as if it had been passed in via the │ │ │ session_params on startup.

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    find_torrent() get_torrents()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    get_torrents() find_torrent()

    │ │ │
    │ │ │  std::vector<torrent_handle> get_torrents () const;
    │ │ │  torrent_handle find_torrent (sha1_hash const& info_hash) const;
    │ │ │  
    │ │ │

    find_torrent() looks for a torrent with the given info-hash. In │ │ │ case there is such a torrent in the session, a torrent_handle to that │ │ │ torrent is returned. In case the torrent cannot be found, an invalid │ │ │ @@ -529,19 +529,19 @@ │ │ │ torrents currently in the session.

    │ │ │ │ │ │ [report issue]
    │ │ │
    │ │ │

    async_add_torrent() add_torrent()

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

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

    │ │ │

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

    │ │ │ │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    pause() resume() is_paused()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    pause() is_paused() resume()

    │ │ │
    │ │ │ +void resume ();
    │ │ │  void pause ();
    │ │ │  bool is_paused () const;
    │ │ │ -void resume ();
    │ │ │  
    │ │ │

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

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

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    dht_get_peers() dht_announce()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    dht_announce() dht_get_peers()

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

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

    │ │ │

    dht_announce() will issue a DHT announce request to the DHT to the │ │ │ specified info-hash, advertising the specified port. If the port is │ │ │ left at its default, 0, the port will be implied by the DHT message's │ │ │ @@ -787,21 +787,21 @@ │ │ │ that sends bad data with very high accuracy. Should │ │ │ eliminate most problems on poisoned torrents. │ │ │ │ │ │

    │ │ │  #include <libtorrent/extensions/smart_ban.hpp>
    │ │ │  ses.add_extension(&lt::create_smart_ban_plugin);
    │ │ │  
    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    set_ip_filter() get_ip_filter()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    get_ip_filter() set_ip_filter()

    │ │ │
    │ │ │ -ip_filter get_ip_filter () const;
    │ │ │  void set_ip_filter (ip_filter f);
    │ │ │ +ip_filter get_ip_filter () const;
    │ │ │  
    │ │ │

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

    │ │ │

    Each time a peer is blocked because of the IP filter, a │ │ │ peer_blocked_alert is generated. get_ip_filter() Returns the │ │ │ @@ -813,36 +813,36 @@ │ │ │ void set_port_filter (port_filter const& f); │ │ │ │ │ │

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

    │ │ │ │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    is_listening() ssl_listen_port() listen_port()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    is_listening() listen_port() ssl_listen_port()

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

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

    │ │ │

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

    │ │ │ │ │ │ [report issue]
    │ │ │
    │ │ │

    set_peer_class_filter() get_peer_class_filter()

    │ │ │
    │ │ │ -ip_filter get_peer_class_filter () const;
    │ │ │  void set_peer_class_filter (ip_filter const& f);
    │ │ │ +ip_filter get_peer_class_filter () const;
    │ │ │  
    │ │ │

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

    │ │ │

    The ip-filter essentially maps an IP -> uint32. Each bit in that 32 │ │ │ bit integer represents a peer class. The least significant bit │ │ │ represents class 0, the next bit class 1 and so on.

    │ │ │ @@ -915,18 +915,18 @@ │ │ │ remove the peer class if it's still assigned to torrents or peers. It │ │ │ will however remove it once the last peer and torrent drops their │ │ │ references to it.

    │ │ │

    There is no need to call this function for custom peer classes. All │ │ │ peer classes will be properly destructed when the session object │ │ │ destructs.

    │ │ │

    For more information on peer classes, see peer classes.

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    get_peer_class() set_peer_class()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    set_peer_class() get_peer_class()

    │ │ │
    │ │ │  void set_peer_class (peer_class_t cid, peer_class_info const& pci);
    │ │ │  peer_class_info get_peer_class (peer_class_t cid) const;
    │ │ │  
    │ │ │

    These functions queries information from a peer class and updates the │ │ │ configuration of a peer class, respectively.

    │ │ │

    cid must refer to an existing peer class. If it does not, the │ │ │ @@ -974,30 +974,30 @@ │ │ │ advised to remove them from the back of the queue, to minimize the │ │ │ shifting.

    │ │ │ │ │ │ [report issue]
    │ │ │
    │ │ │

    apply_settings() get_settings()

    │ │ │
    │ │ │ -settings_pack get_settings () const;
    │ │ │  void apply_settings (settings_pack&&);
    │ │ │  void apply_settings (settings_pack const&);
    │ │ │ +settings_pack get_settings () const;
    │ │ │  
    │ │ │

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

    │ │ │ - │ │ │ │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    set_alert_notify() wait_for_alert() pop_alerts()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    wait_for_alert() pop_alerts() set_alert_notify()

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

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

    │ │ │

    It is safe to call pop_alerts from multiple different threads, as │ │ │ @@ -1048,16 +1048,16 @@ │ │ │ alert::type() but can also be queries from a concrete type via │ │ │ T::alert_type, as a static constant.

    │ │ │ │ │ │ [report issue]
    │ │ │
    │ │ │

    delete_port_mapping() add_port_mapping()

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

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

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

    write_session_params_buf() write_session_params() read_session_params()

    │ │ │ +
    │ │ │ +

    write_session_params() write_session_params_buf() read_session_params()

    │ │ │

    Declared in "libtorrent/session_params.hpp"

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

    These functions serialize and de-serialize a session_params object to and │ │ │ from bencoded form. The session_params object is used to initialize a new │ │ │ session using the state from a previous one (or by programmatically configure │ │ │ the session up-front). │ │ │ The flags parameter can be used to only save and load certain aspects of the │ │ │ ├── html2text {} │ │ │ │ @@ -3,68 +3,68 @@ │ │ │ │ VVeerrssiioonn:: 2.0.11 │ │ │ │ _h_o_m_e │ │ │ │ Table of contents │ │ │ │ * _s_e_s_s_i_o_n___p_a_r_a_m_s │ │ │ │ o _s_e_s_s_i_o_n___p_a_r_a_m_s_(_) │ │ │ │ o _s_e_s_s_i_o_n___p_a_r_a_m_s_(_) │ │ │ │ * _s_e_s_s_i_o_n___p_r_o_x_y │ │ │ │ - o _~_s_e_s_s_i_o_n___p_r_o_x_y_(_)_ _o_p_e_r_a_t_o_r_=_(_)_ _s_e_s_s_i_o_n___p_r_o_x_y_(_) │ │ │ │ + o _s_e_s_s_i_o_n___p_r_o_x_y_(_)_ _o_p_e_r_a_t_o_r_=_(_)_ _~_s_e_s_s_i_o_n___p_r_o_x_y_(_) │ │ │ │ * _s_e_s_s_i_o_n │ │ │ │ o _s_e_s_s_i_o_n_(_) │ │ │ │ o _s_e_s_s_i_o_n_(_) │ │ │ │ o _~_s_e_s_s_i_o_n_(_) │ │ │ │ o _a_b_o_r_t_(_) │ │ │ │ * _s_e_s_s_i_o_n___h_a_n_d_l_e │ │ │ │ o _i_s___v_a_l_i_d_(_) │ │ │ │ o _s_e_s_s_i_o_n___s_t_a_t_e_(_) │ │ │ │ - o _g_e_t___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)_ _r_e_f_r_e_s_h___t_o_r_r_e_n_t___s_t_a_t_u_s_(_) │ │ │ │ + o _r_e_f_r_e_s_h___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)_ _g_e_t___t_o_r_r_e_n_t___s_t_a_t_u_s_(_) │ │ │ │ o _p_o_s_t___t_o_r_r_e_n_t___u_p_d_a_t_e_s_(_) │ │ │ │ o _p_o_s_t___s_e_s_s_i_o_n___s_t_a_t_s_(_) │ │ │ │ o _p_o_s_t___d_h_t___s_t_a_t_s_(_) │ │ │ │ o _s_e_t___d_h_t___s_t_a_t_e_(_) │ │ │ │ - o _f_i_n_d___t_o_r_r_e_n_t_(_)_ _g_e_t___t_o_r_r_e_n_t_s_(_) │ │ │ │ + o _g_e_t___t_o_r_r_e_n_t_s_(_)_ _f_i_n_d___t_o_r_r_e_n_t_(_) │ │ │ │ o _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_)_ _a_d_d___t_o_r_r_e_n_t_(_) │ │ │ │ - o _p_a_u_s_e_(_)_ _r_e_s_u_m_e_(_)_ _i_s___p_a_u_s_e_d_(_) │ │ │ │ + o _p_a_u_s_e_(_)_ _i_s___p_a_u_s_e_d_(_)_ _r_e_s_u_m_e_(_) │ │ │ │ o _i_s___d_h_t___r_u_n_n_i_n_g_(_) │ │ │ │ o _s_e_t___d_h_t___s_t_o_r_a_g_e_(_) │ │ │ │ o _a_d_d___d_h_t___n_o_d_e_(_) │ │ │ │ o _d_h_t___g_e_t___i_t_e_m_(_) │ │ │ │ o _d_h_t___g_e_t___i_t_e_m_(_) │ │ │ │ o _d_h_t___p_u_t___i_t_e_m_(_) │ │ │ │ o _d_h_t___p_u_t___i_t_e_m_(_) │ │ │ │ - o _d_h_t___g_e_t___p_e_e_r_s_(_)_ _d_h_t___a_n_n_o_u_n_c_e_(_) │ │ │ │ + o _d_h_t___a_n_n_o_u_n_c_e_(_)_ _d_h_t___g_e_t___p_e_e_r_s_(_) │ │ │ │ o _d_h_t___l_i_v_e___n_o_d_e_s_(_) │ │ │ │ o _d_h_t___s_a_m_p_l_e___i_n_f_o_h_a_s_h_e_s_(_) │ │ │ │ o _d_h_t___d_i_r_e_c_t___r_e_q_u_e_s_t_(_) │ │ │ │ o _a_d_d___e_x_t_e_n_s_i_o_n_(_) │ │ │ │ - o _s_e_t___i_p___f_i_l_t_e_r_(_)_ _g_e_t___i_p___f_i_l_t_e_r_(_) │ │ │ │ + o _g_e_t___i_p___f_i_l_t_e_r_(_)_ _s_e_t___i_p___f_i_l_t_e_r_(_) │ │ │ │ o _s_e_t___p_o_r_t___f_i_l_t_e_r_(_) │ │ │ │ - o _i_s___l_i_s_t_e_n_i_n_g_(_)_ _s_s_l___l_i_s_t_e_n___p_o_r_t_(_)_ _l_i_s_t_e_n___p_o_r_t_(_) │ │ │ │ + o _i_s___l_i_s_t_e_n_i_n_g_(_)_ _l_i_s_t_e_n___p_o_r_t_(_)_ _s_s_l___l_i_s_t_e_n___p_o_r_t_(_) │ │ │ │ o _s_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_)_ _g_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_) │ │ │ │ o _g_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)_ _s_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_) │ │ │ │ o _c_r_e_a_t_e___p_e_e_r___c_l_a_s_s_(_) │ │ │ │ o _d_e_l_e_t_e___p_e_e_r___c_l_a_s_s_(_) │ │ │ │ - o _g_e_t___p_e_e_r___c_l_a_s_s_(_)_ _s_e_t___p_e_e_r___c_l_a_s_s_(_) │ │ │ │ + o _s_e_t___p_e_e_r___c_l_a_s_s_(_)_ _g_e_t___p_e_e_r___c_l_a_s_s_(_) │ │ │ │ o _r_e_m_o_v_e___t_o_r_r_e_n_t_(_) │ │ │ │ o _a_p_p_l_y___s_e_t_t_i_n_g_s_(_)_ _g_e_t___s_e_t_t_i_n_g_s_(_) │ │ │ │ - o _s_e_t___a_l_e_r_t___n_o_t_i_f_y_(_)_ _w_a_i_t___f_o_r___a_l_e_r_t_(_)_ _p_o_p___a_l_e_r_t_s_(_) │ │ │ │ + o _w_a_i_t___f_o_r___a_l_e_r_t_(_)_ _p_o_p___a_l_e_r_t_s_(_)_ _s_e_t___a_l_e_r_t___n_o_t_i_f_y_(_) │ │ │ │ o _d_e_l_e_t_e___p_o_r_t___m_a_p_p_i_n_g_(_)_ _a_d_d___p_o_r_t___m_a_p_p_i_n_g_(_) │ │ │ │ o _r_e_o_p_e_n___n_e_t_w_o_r_k___s_o_c_k_e_t_s_(_) │ │ │ │ o _n_a_t_i_v_e___h_a_n_d_l_e_(_) │ │ │ │ - * _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s___b_u_f_(_)_ _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)_ _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_) │ │ │ │ + * _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)_ _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s___b_u_f_(_)_ _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_) │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ sseessssiioonn__ppaarraammss ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___p_a_r_a_m_s_._h_p_p" │ │ │ │ The _s_e_s_s_i_o_n___p_a_r_a_m_s is a parameters pack for configuring the _s_e_s_s_i_o_n before it's │ │ │ │ started. │ │ │ │ struct session_params │ │ │ │ { │ │ │ │ - sseessssiioonn__ppaarraammss (); │ │ │ │ sseessssiioonn__ppaarraammss (settings_pack const& sp); │ │ │ │ sseessssiioonn__ppaarraammss (settings_pack&& sp); │ │ │ │ + sseessssiioonn__ppaarraammss (); │ │ │ │ sseessssiioonn__ppaarraammss (settings_pack&& sp │ │ │ │ , std::vector> exts); │ │ │ │ sseessssiioonn__ppaarraammss (settings_pack const& sp │ │ │ │ , std::vector> exts); │ │ │ │ │ │ │ │ settings_pack settings; │ │ │ │ std::vector> extensions; │ │ │ │ @@ -72,17 +72,17 @@ │ │ │ │ dht::dht_storage_constructor_type dht_storage_constructor; │ │ │ │ disk_io_constructor_type disk_io_constructor; │ │ │ │ std::map ext_state; │ │ │ │ libtorrent::ip_filter ip_filter; │ │ │ │ }; │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** sseessssiioonn__ppaarraammss(()) ********** │ │ │ │ -sseessssiioonn__ppaarraammss (); │ │ │ │ sseessssiioonn__ppaarraammss (settings_pack const& sp); │ │ │ │ sseessssiioonn__ppaarraammss (settings_pack&& sp); │ │ │ │ +sseessssiioonn__ppaarraammss (); │ │ │ │ This constructor can be used to start with the default plugins (ut_metadata, │ │ │ │ ut_pex and smart_ban). Pass a _s_e_t_t_i_n_g_s___p_a_c_k to set the initial settings when │ │ │ │ the _s_e_s_s_i_o_n starts. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** sseessssiioonn__ppaarraammss(()) ********** │ │ │ │ sseessssiioonn__ppaarraammss (settings_pack&& sp │ │ │ │ , std::vector> exts); │ │ │ │ @@ -123,28 +123,28 @@ │ │ │ │ the completion of the shutdown. The lifetime of this object may outlive │ │ │ │ _s_e_s_s_i_o_n, causing the _s_e_s_s_i_o_n destructor to not block. The _s_e_s_s_i_o_n___p_r_o_x_y │ │ │ │ destructor will block however, until the underlying _s_e_s_s_i_o_n is done shutting │ │ │ │ down. │ │ │ │ struct session_proxy │ │ │ │ { │ │ │ │ sseessssiioonn__pprrooxxyy (session_proxy const&); │ │ │ │ + ~~sseessssiioonn__pprrooxxyy (); │ │ │ │ session_proxy& ooppeerraattoorr== (session_proxy&&) & noexcept; │ │ │ │ - session_proxy& ooppeerraattoorr== (session_proxy const&) &; │ │ │ │ sseessssiioonn__pprrooxxyy (session_proxy&&) noexcept; │ │ │ │ - ~~sseessssiioonn__pprrooxxyy (); │ │ │ │ sseessssiioonn__pprrooxxyy (); │ │ │ │ + session_proxy& ooppeerraattoorr== (session_proxy const&) &; │ │ │ │ }; │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** ~~sseessssiioonn__pprrooxxyy(()) ooppeerraattoorr==(()) sseessssiioonn__pprrooxxyy(()) ********** │ │ │ │ +********** sseessssiioonn__pprrooxxyy(()) ooppeerraattoorr==(()) ~~sseessssiioonn__pprrooxxyy(()) ********** │ │ │ │ sseessssiioonn__pprrooxxyy (session_proxy const&); │ │ │ │ +~~sseessssiioonn__pprrooxxyy (); │ │ │ │ session_proxy& ooppeerraattoorr== (session_proxy&&) & noexcept; │ │ │ │ -session_proxy& ooppeerraattoorr== (session_proxy const&) &; │ │ │ │ sseessssiioonn__pprrooxxyy (session_proxy&&) noexcept; │ │ │ │ -~~sseessssiioonn__pprrooxxyy (); │ │ │ │ sseessssiioonn__pprrooxxyy (); │ │ │ │ +session_proxy& ooppeerraattoorr== (session_proxy const&) &; │ │ │ │ default constructor, does not refer to any _s_e_s_s_i_o_n implementation object. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ************ sseessssiioonn ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n_._h_p_p" │ │ │ │ The _s_e_s_s_i_o_n holds all state that spans multiple torrents. Among other things it │ │ │ │ runs the network loop and manages all torrents. Once it's created, the _s_e_s_s_i_o_n │ │ │ │ object will spawn the main thread that will do all the work. The main thread │ │ │ │ @@ -152,47 +152,47 @@ │ │ │ │ You have some control over _s_e_s_s_i_o_n configuration through the session_handle:: │ │ │ │ apply_settings() member function. To change one or more configuration options, │ │ │ │ create a _s_e_t_t_i_n_g_s___p_a_c_k. object and fill it with the settings to be set and pass │ │ │ │ it in to session::apply_settings(). │ │ │ │ see _a_p_p_l_y___s_e_t_t_i_n_g_s_(_). │ │ │ │ struct session : session_handle │ │ │ │ { │ │ │ │ - sseessssiioonn (session_params const& params, session_flags_t flags); │ │ │ │ sseessssiioonn (session_params&& params, session_flags_t flags); │ │ │ │ - explicit sseessssiioonn (session_params&& params); │ │ │ │ sseessssiioonn (); │ │ │ │ + explicit sseessssiioonn (session_params&& params); │ │ │ │ explicit sseessssiioonn (session_params const& params); │ │ │ │ + sseessssiioonn (session_params const& params, session_flags_t flags); │ │ │ │ sseessssiioonn (session_params&& params, io_context& ios); │ │ │ │ - sseessssiioonn (session_params const& params, io_context& ios, session_flags_t); │ │ │ │ - sseessssiioonn (session_params&& params, io_context& ios, session_flags_t); │ │ │ │ sseessssiioonn (session_params const& params, io_context& ios); │ │ │ │ + sseessssiioonn (session_params&& params, io_context& ios, session_flags_t); │ │ │ │ + sseessssiioonn (session_params const& params, io_context& ios, session_flags_t); │ │ │ │ ~~sseessssiioonn (); │ │ │ │ session_proxy aabboorrtt (); │ │ │ │ }; │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** sseessssiioonn(()) ********** │ │ │ │ -sseessssiioonn (session_params const& params, session_flags_t flags); │ │ │ │ sseessssiioonn (session_params&& params, session_flags_t flags); │ │ │ │ -explicit sseessssiioonn (session_params&& params); │ │ │ │ sseessssiioonn (); │ │ │ │ +explicit sseessssiioonn (session_params&& params); │ │ │ │ explicit sseessssiioonn (session_params const& params); │ │ │ │ +sseessssiioonn (session_params const& params, session_flags_t flags); │ │ │ │ Constructs the _s_e_s_s_i_o_n objects which acts as the container of torrents. In │ │ │ │ order to avoid a race condition between starting the _s_e_s_s_i_o_n and configuring │ │ │ │ it, you can pass in a _s_e_s_s_i_o_n___p_a_r_a_m_s object. Its settings will take effect │ │ │ │ before the _s_e_s_s_i_o_n starts up. │ │ │ │ The overloads taking flags can be used to start a _s_e_s_s_i_o_n in paused mode (by │ │ │ │ passing in session::paused). Note that add_default_plugins do not have an │ │ │ │ affect on constructors that take a _s_e_s_s_i_o_n___p_a_r_a_m_s object. It already contains │ │ │ │ the plugins to use. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** sseessssiioonn(()) ********** │ │ │ │ sseessssiioonn (session_params&& params, io_context& ios); │ │ │ │ -sseessssiioonn (session_params const& params, io_context& ios, session_flags_t); │ │ │ │ -sseessssiioonn (session_params&& params, io_context& ios, session_flags_t); │ │ │ │ sseessssiioonn (session_params const& params, io_context& ios); │ │ │ │ +sseessssiioonn (session_params&& params, io_context& ios, session_flags_t); │ │ │ │ +sseessssiioonn (session_params const& params, io_context& ios, session_flags_t); │ │ │ │ Overload of the constructor that takes an external io_context to run the │ │ │ │ _s_e_s_s_i_o_n object on. This is primarily useful for tests that may want to run │ │ │ │ multiple sessions on a single io_context, or low resource systems where │ │ │ │ additional threads are expensive and sharing an io_context with other events is │ │ │ │ fine. │ │ │ │ Warning │ │ │ │ The _s_e_s_s_i_o_n object does not cleanly terminate with an external io_context. The │ │ │ │ @@ -245,69 +245,69 @@ │ │ │ │ void ppoosstt__sseessssiioonn__ssttaattss (); │ │ │ │ void ppoosstt__ddhhtt__ssttaattss (); │ │ │ │ void sseett__ddhhtt__ssttaattee (dht::dht_state&& st); │ │ │ │ void sseett__ddhhtt__ssttaattee (dht::dht_state const& st); │ │ │ │ std::vector ggeett__ttoorrrreennttss () const; │ │ │ │ torrent_handle ffiinndd__ttoorrrreenntt (sha1_hash const& info_hash) const; │ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params, error_code& ec); │ │ │ │ - void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params); │ │ │ │ - void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params&& params); │ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params); │ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params); │ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params, error_code& │ │ │ │ ec); │ │ │ │ + void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params&& params); │ │ │ │ + void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params); │ │ │ │ + void rreessuummee (); │ │ │ │ void ppaauussee (); │ │ │ │ bool iiss__ppaauusseedd () const; │ │ │ │ - void rreessuummee (); │ │ │ │ bool iiss__ddhhtt__rruunnnniinngg () const; │ │ │ │ void sseett__ddhhtt__ssttoorraaggee (dht::dht_storage_constructor_type sc); │ │ │ │ void aadddd__ddhhtt__nnooddee (std::pair const& node); │ │ │ │ void ddhhtt__ggeett__iitteemm (sha1_hash const& target); │ │ │ │ void ddhhtt__ggeett__iitteemm (std::array key │ │ │ │ , std::string salt = std::string()); │ │ │ │ sha1_hash ddhhtt__ppuutt__iitteemm (entry data); │ │ │ │ void ddhhtt__ppuutt__iitteemm (std::array key │ │ │ │ , std::function& │ │ │ │ , std::int64_t&, std::string const&)> cb │ │ │ │ , std::string salt = std::string()); │ │ │ │ - void ddhhtt__ggeett__ppeeeerrss (sha1_hash const& info_hash); │ │ │ │ void ddhhtt__aannnnoouunnccee (sha1_hash const& info_hash, int port = 0, dht:: │ │ │ │ announce_flags_t flags = {}); │ │ │ │ + void ddhhtt__ggeett__ppeeeerrss (sha1_hash const& info_hash); │ │ │ │ void ddhhtt__lliivvee__nnooddeess (sha1_hash const& nid); │ │ │ │ void ddhhtt__ssaammppllee__iinnffoohhaasshheess (udp::endpoint const& ep, sha1_hash const& │ │ │ │ target); │ │ │ │ void ddhhtt__ddiirreecctt__rreeqquueesstt (udp::endpoint const& ep, entry const& e, │ │ │ │ client_data_t userdata = {}); │ │ │ │ void aadddd__eexxtteennssiioonn (std::shared_ptr ext); │ │ │ │ void aadddd__eexxtteennssiioonn (std::function( │ │ │ │ torrent_handle const&, client_data_t)> ext); │ │ │ │ - ip_filter ggeett__iipp__ffiilltteerr () const; │ │ │ │ void sseett__iipp__ffiilltteerr (ip_filter f); │ │ │ │ + ip_filter ggeett__iipp__ffiilltteerr () const; │ │ │ │ void sseett__ppoorrtt__ffiilltteerr (port_filter const& f); │ │ │ │ - unsigned short ssssll__lliisstteenn__ppoorrtt () const; │ │ │ │ - bool iiss__lliisstteenniinngg () const; │ │ │ │ unsigned short lliisstteenn__ppoorrtt () const; │ │ │ │ - ip_filter ggeett__ppeeeerr__ccllaassss__ffiilltteerr () const; │ │ │ │ + bool iiss__lliisstteenniinngg () const; │ │ │ │ + unsigned short ssssll__lliisstteenn__ppoorrtt () const; │ │ │ │ void sseett__ppeeeerr__ccllaassss__ffiilltteerr (ip_filter const& f); │ │ │ │ + ip_filter ggeett__ppeeeerr__ccllaassss__ffiilltteerr () const; │ │ │ │ void sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr (peer_class_type_filter const& f); │ │ │ │ peer_class_type_filter ggeett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr () const; │ │ │ │ peer_class_t ccrreeaattee__ppeeeerr__ccllaassss (char const* name); │ │ │ │ void ddeelleettee__ppeeeerr__ccllaassss (peer_class_t cid); │ │ │ │ void sseett__ppeeeerr__ccllaassss (peer_class_t cid, peer_class_info const& pci); │ │ │ │ peer_class_info ggeett__ppeeeerr__ccllaassss (peer_class_t cid) const; │ │ │ │ void rreemmoovvee__ttoorrrreenntt (const torrent_handle&, remove_flags_t = {}); │ │ │ │ - settings_pack ggeett__sseettttiinnggss () const; │ │ │ │ void aappppllyy__sseettttiinnggss (settings_pack&&); │ │ │ │ void aappppllyy__sseettttiinnggss (settings_pack const&); │ │ │ │ - alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait); │ │ │ │ + settings_pack ggeett__sseettttiinnggss () const; │ │ │ │ void ppoopp__aalleerrttss (std::vector* alerts); │ │ │ │ void sseett__aalleerrtt__nnoottiiffyy (std::function const& fun); │ │ │ │ - void ddeelleettee__ppoorrtt__mmaappppiinngg (port_mapping_t handle); │ │ │ │ + alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait); │ │ │ │ std::vector aadddd__ppoorrtt__mmaappppiinngg (portmap_protocol t, int │ │ │ │ external_port, int local_port); │ │ │ │ + void ddeelleettee__ppoorrtt__mmaappppiinngg (port_mapping_t handle); │ │ │ │ void rreeooppeenn__nneettwwoorrkk__ssoocckkeettss (reopen_network_flags_t options = │ │ │ │ reopen_map_ports); │ │ │ │ std::shared_ptr nnaattiivvee__hhaannddllee () const; │ │ │ │ │ │ │ │ static constexpr save_state_flags_t ssaavvee__sseettttiinnggss = 0_bit; │ │ │ │ static constexpr save_state_flags_t ssaavvee__ddhhtt__ssttaattee = 2_bit; │ │ │ │ static constexpr save_state_flags_t ssaavvee__eexxtteennssiioonn__ssttaattee = 11_bit; │ │ │ │ @@ -333,15 +333,15 @@ │ │ │ │ all()) const; │ │ │ │ returns the current _s_e_s_s_i_o_n state. This can be passed to _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_) │ │ │ │ to save the state to disk and restored using _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_) when │ │ │ │ constructing a new _s_e_s_s_i_o_n. The kind of state that's included is all settings, │ │ │ │ the DHT routing table, possibly plugin-specific state. the flags parameter can │ │ │ │ be used to only save certain parts of the _s_e_s_s_i_o_n state │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** ggeett__ttoorrrreenntt__ssttaattuuss(()) rreeffrreesshh__ttoorrrreenntt__ssttaattuuss(()) ********** │ │ │ │ +********** rreeffrreesshh__ttoorrrreenntt__ssttaattuuss(()) ggeett__ttoorrrreenntt__ssttaattuuss(()) ********** │ │ │ │ std::vector ggeett__ttoorrrreenntt__ssttaattuuss ( │ │ │ │ std::function const& pred │ │ │ │ , status_flags_t flags = {}) const; │ │ │ │ void rreeffrreesshh__ttoorrrreenntt__ssttaattuuss (std::vector* ret │ │ │ │ , status_flags_t flags = {}) const; │ │ │ │ Note │ │ │ │ these calls are potentially expensive and won't scale well with lots of │ │ │ │ @@ -397,31 +397,31 @@ │ │ │ │ ********** sseett__ddhhtt__ssttaattee(()) ********** │ │ │ │ void sseett__ddhhtt__ssttaattee (dht::dht_state&& st); │ │ │ │ void sseett__ddhhtt__ssttaattee (dht::dht_state const& st); │ │ │ │ set the DHT state for the _s_e_s_s_i_o_n. This will be taken into account the next │ │ │ │ time the DHT is started, as if it had been passed in via the _s_e_s_s_i_o_n___p_a_r_a_m_s on │ │ │ │ startup. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** ffiinndd__ttoorrrreenntt(()) ggeett__ttoorrrreennttss(()) ********** │ │ │ │ +********** ggeett__ttoorrrreennttss(()) ffiinndd__ttoorrrreenntt(()) ********** │ │ │ │ std::vector ggeett__ttoorrrreennttss () const; │ │ │ │ torrent_handle ffiinndd__ttoorrrreenntt (sha1_hash const& info_hash) const; │ │ │ │ find_torrent() looks for a torrent with the given info-hash. In case there is │ │ │ │ such a torrent in the _s_e_s_s_i_o_n, a _t_o_r_r_e_n_t___h_a_n_d_l_e to that torrent is returned. In │ │ │ │ case the torrent cannot be found, an invalid _t_o_r_r_e_n_t___h_a_n_d_l_e is returned. │ │ │ │ See torrent_handle::is_valid() to know if the torrent was found or not. │ │ │ │ get_torrents() returns a vector of torrent_handles to all the torrents │ │ │ │ currently in the _s_e_s_s_i_o_n. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** aassyynncc__aadddd__ttoorrrreenntt(()) aadddd__ttoorrrreenntt(()) ********** │ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params, error_code& ec); │ │ │ │ -void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params); │ │ │ │ -void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params&& params); │ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params); │ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params); │ │ │ │ torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params, error_code& ec); │ │ │ │ +void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params&& params); │ │ │ │ +void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params); │ │ │ │ You add torrents through the _a_d_d___t_o_r_r_e_n_t_(_) function where you give an object │ │ │ │ with all the parameters. The _a_d_d___t_o_r_r_e_n_t_(_) overloads will block until the │ │ │ │ torrent has been added (or failed to be added) and returns an error code and a │ │ │ │ _t_o_r_r_e_n_t___h_a_n_d_l_e. In order to add torrents more efficiently, consider using │ │ │ │ _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_) which returns immediately, without waiting for the torrent │ │ │ │ to add. Notification of the torrent being added is sent as _a_d_d___t_o_r_r_e_n_t___a_l_e_r_t. │ │ │ │ The save_path field in _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s must be set to a valid path where the │ │ │ │ @@ -442,18 +442,18 @@ │ │ │ │ torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet │ │ │ │ link that will just download the metadata, but no payload, set the │ │ │ │ torrent_flags::upload_mode flag. │ │ │ │ Special consideration has to be taken when adding hybrid torrents (i.e. │ │ │ │ torrents that are BitTorrent v2 torrents that are backwards compatible with │ │ │ │ v1). For more details, see _B_i_t_T_o_r_r_e_n_t_ _v_2_ _t_o_r_r_e_n_t_s. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** ppaauussee(()) rreessuummee(()) iiss__ppaauusseedd(()) ********** │ │ │ │ +********** ppaauussee(()) iiss__ppaauusseedd(()) rreessuummee(()) ********** │ │ │ │ +void rreessuummee (); │ │ │ │ void ppaauussee (); │ │ │ │ bool iiss__ppaauusseedd () const; │ │ │ │ -void rreessuummee (); │ │ │ │ Pausing the _s_e_s_s_i_o_n has the same effect as pausing every torrent in it, except │ │ │ │ that torrents will not be resumed by the auto-manage mechanism. Resuming will │ │ │ │ restore the torrents to their previous paused state. i.e. the _s_e_s_s_i_o_n pause │ │ │ │ state is separate from the torrent pause state. A torrent is inactive if it is │ │ │ │ paused or if the _s_e_s_s_i_o_n is paused. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** iiss__ddhhtt__rruunnnniinngg(()) ********** │ │ │ │ @@ -529,18 +529,18 @@ │ │ │ │ and make the function entirely self-contained. The only reason data blob's │ │ │ │ value is computed via a function instead of just passing in the new value is to │ │ │ │ avoid race conditions. If you want to uuppddaattee the value in the DHT, you must │ │ │ │ first retrieve it, then modify it, then write it back. The way the DHT works, │ │ │ │ it is natural to always do a lookup before storing and calling the callback in │ │ │ │ between is convenient. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** ddhhtt__ggeett__ppeeeerrss(()) ddhhtt__aannnnoouunnccee(()) ********** │ │ │ │ -void ddhhtt__ggeett__ppeeeerrss (sha1_hash const& info_hash); │ │ │ │ +********** ddhhtt__aannnnoouunnccee(()) ddhhtt__ggeett__ppeeeerrss(()) ********** │ │ │ │ void ddhhtt__aannnnoouunnccee (sha1_hash const& info_hash, int port = 0, dht:: │ │ │ │ announce_flags_t flags = {}); │ │ │ │ +void ddhhtt__ggeett__ppeeeerrss (sha1_hash const& info_hash); │ │ │ │ dht_get_peers() will issue a DHT get_peer request to the DHT for the specified │ │ │ │ info-hash. The response (the peers) will be posted back in a │ │ │ │ _d_h_t___g_e_t___p_e_e_r_s___r_e_p_l_y___a_l_e_r_t. │ │ │ │ dht_announce() will issue a DHT announce request to the DHT to the specified │ │ │ │ info-hash, advertising the specified port. If the port is left at its default, │ │ │ │ 0, the port will be implied by the DHT message's source port (which may improve │ │ │ │ connectivity through a NAT). dht_announce() is not affected by the │ │ │ │ @@ -597,17 +597,17 @@ │ │ │ │ smart ban _p_l_u_g_i_n │ │ │ │ A _p_l_u_g_i_n that, with a small overhead, can ban peers that sends bad data │ │ │ │ with very high accuracy. Should eliminate most problems on poisoned │ │ │ │ torrents. │ │ │ │ #include │ │ │ │ ses.add_extension(<::create_smart_ban_plugin); │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** sseett__iipp__ffiilltteerr(()) ggeett__iipp__ffiilltteerr(()) ********** │ │ │ │ -ip_filter ggeett__iipp__ffiilltteerr () const; │ │ │ │ +********** ggeett__iipp__ffiilltteerr(()) sseett__iipp__ffiilltteerr(()) ********** │ │ │ │ void sseett__iipp__ffiilltteerr (ip_filter f); │ │ │ │ +ip_filter ggeett__iipp__ffiilltteerr () const; │ │ │ │ Sets a filter that will be used to reject and accept incoming as well as │ │ │ │ outgoing connections based on their originating ip address. The default filter │ │ │ │ will allow connections to any ip address. To build a set of rules for which │ │ │ │ addresses are accepted and not, see _i_p___f_i_l_t_e_r. │ │ │ │ Each time a peer is blocked because of the IP filter, a _p_e_e_r___b_l_o_c_k_e_d___a_l_e_r_t is │ │ │ │ generated. get_ip_filter() Returns the _i_p___f_i_l_t_e_r currently in the _s_e_s_s_i_o_n. See │ │ │ │ _i_p___f_i_l_t_e_r. │ │ │ │ @@ -615,27 +615,27 @@ │ │ │ │ ********** sseett__ppoorrtt__ffiilltteerr(()) ********** │ │ │ │ void sseett__ppoorrtt__ffiilltteerr (port_filter const& f); │ │ │ │ apply _p_o_r_t___f_i_l_t_e_r f to incoming and outgoing peers. a port filter will reject │ │ │ │ making outgoing peer connections to certain remote ports. The main intention is │ │ │ │ to be able to avoid triggering certain anti-virus software by connecting to │ │ │ │ SMTP, FTP ports. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** iiss__lliisstteenniinngg(()) ssssll__lliisstteenn__ppoorrtt(()) lliisstteenn__ppoorrtt(()) ********** │ │ │ │ -unsigned short ssssll__lliisstteenn__ppoorrtt () const; │ │ │ │ -bool iiss__lliisstteenniinngg () const; │ │ │ │ +********** iiss__lliisstteenniinngg(()) lliisstteenn__ppoorrtt(()) ssssll__lliisstteenn__ppoorrtt(()) ********** │ │ │ │ unsigned short lliisstteenn__ppoorrtt () const; │ │ │ │ +bool iiss__lliisstteenniinngg () const; │ │ │ │ +unsigned short ssssll__lliisstteenn__ppoorrtt () const; │ │ │ │ is_listening() will tell you whether or not the _s_e_s_s_i_o_n has successfully opened │ │ │ │ a listening port. If it hasn't, this function will return false, and then you │ │ │ │ can set a new _s_e_t_t_i_n_g_s___p_a_c_k_:_:_l_i_s_t_e_n___i_n_t_e_r_f_a_c_e_s to try another interface and │ │ │ │ port to bind to. │ │ │ │ listen_port() returns the port we ended up listening on. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** sseett__ppeeeerr__ccllaassss__ffiilltteerr(()) ggeett__ppeeeerr__ccllaassss__ffiilltteerr(()) ********** │ │ │ │ -ip_filter ggeett__ppeeeerr__ccllaassss__ffiilltteerr () const; │ │ │ │ void sseett__ppeeeerr__ccllaassss__ffiilltteerr (ip_filter const& f); │ │ │ │ +ip_filter ggeett__ppeeeerr__ccllaassss__ffiilltteerr () const; │ │ │ │ Sets the peer class filter for this _s_e_s_s_i_o_n. All new peer connections will take │ │ │ │ this into account and be added to the peer classes specified by this filter, │ │ │ │ based on the peer's IP address. │ │ │ │ The ip-filter essentially maps an IP -> uint32. Each bit in that 32 bit integer │ │ │ │ represents a peer class. The least significant bit represents class 0, the next │ │ │ │ bit class 1 and so on. │ │ │ │ For more info, see _i_p___f_i_l_t_e_r. │ │ │ │ @@ -690,15 +690,15 @@ │ │ │ │ Since peer classes are reference counted, this function will not remove the │ │ │ │ peer class if it's still assigned to torrents or peers. It will however remove │ │ │ │ it once the last peer and torrent drops their references to it. │ │ │ │ There is no need to call this function for custom peer classes. All peer │ │ │ │ classes will be properly destructed when the _s_e_s_s_i_o_n object destructs. │ │ │ │ For more information on peer classes, see _p_e_e_r_ _c_l_a_s_s_e_s. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** ggeett__ppeeeerr__ccllaassss(()) sseett__ppeeeerr__ccllaassss(()) ********** │ │ │ │ +********** sseett__ppeeeerr__ccllaassss(()) ggeett__ppeeeerr__ccllaassss(()) ********** │ │ │ │ void sseett__ppeeeerr__ccllaassss (peer_class_t cid, peer_class_info const& pci); │ │ │ │ peer_class_info ggeett__ppeeeerr__ccllaassss (peer_class_t cid) const; │ │ │ │ These functions queries information from a peer class and updates the │ │ │ │ configuration of a peer class, respectively. │ │ │ │ cid must refer to an existing peer class. If it does not, the return value of │ │ │ │ get_peer_class() is undefined. │ │ │ │ set_peer_class() sets all the information in the _p_e_e_r___c_l_a_s_s___i_n_f_o object in the │ │ │ │ @@ -731,25 +731,25 @@ │ │ │ │ Note that when a queued or downloading torrent is removed, its position in the │ │ │ │ download queue is vacated and every subsequent torrent in the queue has their │ │ │ │ queue positions updated. This can potentially cause a large state_update to be │ │ │ │ posted. When removing all torrents, it is advised to remove them from the back │ │ │ │ of the queue, to minimize the shifting. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** aappppllyy__sseettttiinnggss(()) ggeett__sseettttiinnggss(()) ********** │ │ │ │ -settings_pack ggeett__sseettttiinnggss () const; │ │ │ │ void aappppllyy__sseettttiinnggss (settings_pack&&); │ │ │ │ void aappppllyy__sseettttiinnggss (settings_pack const&); │ │ │ │ +settings_pack ggeett__sseettttiinnggss () const; │ │ │ │ Applies the settings specified by the _s_e_t_t_i_n_g_s___p_a_c_k s. This is an asynchronous │ │ │ │ operation that will return immediately and actually apply the settings to the │ │ │ │ main thread of libtorrent some time later. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -********** sseett__aalleerrtt__nnoottiiffyy(()) wwaaiitt__ffoorr__aalleerrtt(()) ppoopp__aalleerrttss(()) ********** │ │ │ │ -alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait); │ │ │ │ +********** wwaaiitt__ffoorr__aalleerrtt(()) ppoopp__aalleerrttss(()) sseett__aalleerrtt__nnoottiiffyy(()) ********** │ │ │ │ void ppoopp__aalleerrttss (std::vector* alerts); │ │ │ │ void sseett__aalleerrtt__nnoottiiffyy (std::function const& fun); │ │ │ │ +alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait); │ │ │ │ Alerts is the main mechanism for libtorrent to report errors and events. │ │ │ │ pop_alerts fills in the vector passed to it with pointers to new alerts. The │ │ │ │ _s_e_s_s_i_o_n still owns these alerts and they will stay valid until the next time │ │ │ │ pop_alerts is called. You may not delete the _a_l_e_r_t objects. │ │ │ │ It is safe to call pop_alerts from multiple different threads, as long as the │ │ │ │ alerts themselves are not accessed once another thread calls pop_alerts. Doing │ │ │ │ this requires manual synchronization between the popping threads. │ │ │ │ @@ -789,17 +789,17 @@ │ │ │ │ block. It should not perform any expensive work. It really should just notify │ │ │ │ the main application thread. │ │ │ │ The type of an _a_l_e_r_t is returned by the polymorphic function alert::type() but │ │ │ │ can also be queries from a concrete type via T::alert_type, as a static │ │ │ │ constant. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** ddeelleettee__ppoorrtt__mmaappppiinngg(()) aadddd__ppoorrtt__mmaappppiinngg(()) ********** │ │ │ │ -void ddeelleettee__ppoorrtt__mmaappppiinngg (port_mapping_t handle); │ │ │ │ std::vector aadddd__ppoorrtt__mmaappppiinngg (portmap_protocol t, int │ │ │ │ external_port, int local_port); │ │ │ │ +void ddeelleettee__ppoorrtt__mmaappppiinngg (port_mapping_t handle); │ │ │ │ add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP, │ │ │ │ whichever is enabled. A mapping is created for each listen socket in the │ │ │ │ _s_e_s_s_i_o_n. The return values are all handles referring to the port mappings that │ │ │ │ were just created. Pass them to _d_e_l_e_t_e___p_o_r_t___m_a_p_p_i_n_g_(_) to remove them. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ ********** rreeooppeenn__nneettwwoorrkk__ssoocckkeettss(()) ********** │ │ │ │ void rreeooppeenn__nneettwwoorrkk__ssoocckkeettss (reopen_network_flags_t options = │ │ │ │ @@ -845,24 +845,24 @@ │ │ │ │ protocols used by _a_d_d___p_o_r_t___m_a_p_p_i_n_g_(_) │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ reopen_map_ports │ │ │ │ This option indicates if the ports are mapped using natpmp and upnp. If │ │ │ │ mapping was already made, they are deleted and added again. This only │ │ │ │ works if natpmp and/or upnp are configured to be enable. │ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e] │ │ │ │ -************ wwrriittee__sseessssiioonn__ppaarraammss__bbuuff(()) wwrriittee__sseessssiioonn__ppaarraammss(()) rreeaadd__sseessssiioonn__ppaarraammss(()) │ │ │ │ +************ wwrriittee__sseessssiioonn__ppaarraammss(()) wwrriittee__sseessssiioonn__ppaarraammss__bbuuff(()) rreeaadd__sseessssiioonn__ppaarraammss(()) │ │ │ │ ************ │ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___p_a_r_a_m_s_._h_p_p" │ │ │ │ -session_params rreeaadd__sseessssiioonn__ppaarraammss (bdecode_node const& e │ │ │ │ +session_params rreeaadd__sseessssiioonn__ppaarraammss (span buf │ │ │ │ , save_state_flags_t flags = save_state_flags_t::all()); │ │ │ │ entry wwrriittee__sseessssiioonn__ppaarraammss (session_params const& sp │ │ │ │ , save_state_flags_t flags = save_state_flags_t::all()); │ │ │ │ -std::vector wwrriittee__sseessssiioonn__ppaarraammss__bbuuff (session_params const& sp │ │ │ │ +session_params rreeaadd__sseessssiioonn__ppaarraammss (bdecode_node const& e │ │ │ │ , save_state_flags_t flags = save_state_flags_t::all()); │ │ │ │ -session_params rreeaadd__sseessssiioonn__ppaarraammss (span buf │ │ │ │ +std::vector wwrriittee__sseessssiioonn__ppaarraammss__bbuuff (session_params const& sp │ │ │ │ , save_state_flags_t flags = save_state_flags_t::all()); │ │ │ │ These functions serialize and de-serialize a session_params object to and from │ │ │ │ bencoded form. The _s_e_s_s_i_o_n___p_a_r_a_m_s object is used to initialize a new _s_e_s_s_i_o_n │ │ │ │ using the state from a previous one (or by programmatically configure the │ │ │ │ _s_e_s_s_i_o_n up-front). The flags parameter can be used to only save and load │ │ │ │ certain aspects of the session's state. The _buf suffix indicates the function │ │ │ │ operates on buffer rather than the bencoded structure. The torrents in a │ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html │ │ │ @@ -33,31 +33,31 @@ │ │ │

    Table of contents

    │ │ │ │ │ │
    │ │ │

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

    │ │ │

    The settings_pack object is a collection of settings updates that are applied │ │ │ to the session when passed to session::apply_settings(). It's empty when │ │ │ @@ -4599,23 +4599,23 @@ │ │ │

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

    set_bool() set_str() set_int()

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

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

    │ │ │ [report issue]
    │ │ │
    │ │ │ @@ -4721,23 +4721,23 @@ │ │ │ [report issue]
    │ │ │
    │ │ │

    clear()

    │ │ │
    │ │ │  void clear (int name);
    │ │ │  
    │ │ │

    clear a specific setting from the pack

    │ │ │ - │ │ │ │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    get_bool() get_int() get_str()

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    get_int() get_str() get_bool()

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

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

    │ │ │ [report issue]
    │ │ │ @@ -5096,16 +5096,64 @@ │ │ │ http_pw │ │ │ 5 │ │ │ The server is assumed to be an HTTP proxy that requires user │ │ │ authorization. The username and password will be sent to the proxy. │ │ │ │ │ │ │ │ │ │ │ │ -[report issue]
    │ │ │ + │ │ │ +[report issue]
    │ │ │ │ │ │ +
    │ │ │ +

    setting_by_name() name_for_setting()

    │ │ │ +

    Declared in "libtorrent/settings_pack.hpp"

    │ │ │ +
    │ │ │ +int setting_by_name (string_view name);
    │ │ │ +char const* name_for_setting (int s);
    │ │ │ +
    │ │ │ +

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

    │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    default_settings()

    │ │ │ +

    Declared in "libtorrent/settings_pack.hpp"

    │ │ │ +
    │ │ │ +settings_pack default_settings ();
    │ │ │ +
    │ │ │ +

    returns a settings_pack with every setting set to its default value

    │ │ │ + │ │ │ +[report issue]
    │ │ │ +
    │ │ │ +

    min_memory_usage() high_performance_seed()

    │ │ │ +

    Declared in "libtorrent/session.hpp"

    │ │ │ +
    │ │ │ +settings_pack high_performance_seed ();
    │ │ │ +settings_pack min_memory_usage ();
    │ │ │ +
    │ │ │ +

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

    │ │ │ +

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

    │ │ │ +

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

    │ │ │ +

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

    │ │ │ +[report issue]
    │ │ │
    │ │ │

    generate_fingerprint()

    │ │ │

    Declared in "libtorrent/fingerprint.hpp"

    │ │ │
    │ │ │  std::string generate_fingerprint (std::string name
    │ │ │     , int major, int minor = 0, int revision = 0, int tag = 0);
    │ │ │  
    │ │ │ @@ -5154,62 +5202,14 @@ │ │ │ Tribler │ │ │ │ │ │ │ │ │ │ │ │

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

    │ │ │

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

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    min_memory_usage() high_performance_seed()

    │ │ │ -

    Declared in "libtorrent/session.hpp"

    │ │ │ -
    │ │ │ -settings_pack high_performance_seed ();
    │ │ │ -settings_pack min_memory_usage ();
    │ │ │ -
    │ │ │ -

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

    │ │ │ -

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

    │ │ │ -

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

    │ │ │ -

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

    │ │ │ - │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    name_for_setting() setting_by_name()

    │ │ │ -

    Declared in "libtorrent/settings_pack.hpp"

    │ │ │ -
    │ │ │ -int setting_by_name (string_view name);
    │ │ │ -char const* name_for_setting (int s);
    │ │ │ -
    │ │ │ -

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

    │ │ │ -[report issue]
    │ │ │ -
    │ │ │ -

    default_settings()

    │ │ │ -

    Declared in "libtorrent/settings_pack.hpp"

    │ │ │ -
    │ │ │ -settings_pack default_settings ();
    │ │ │ -
    │ │ │ -

    returns a settings_pack with every setting set to its default value

    │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │