--- /srv/reproducible-results/rbuild-debian/r-b-build.LthN7ah7/b1/libtorrent-rasterbar_2.0.8-1_amd64.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.LthN7ah7/b2/libtorrent-rasterbar_2.0.8-1_amd64.changes ├── Files │ @@ -1,7 +1,7 @@ │ │ 079593814c6dd79603ab878082eb3064 360872 libdevel optional libtorrent-rasterbar-dev_2.0.8-1_amd64.deb │ - 64beeea1429da945146c294d1a26b2eb 1605760 doc optional libtorrent-rasterbar-doc_2.0.8-1_all.deb │ + 2251f7a29dd3fb846b7a02efccc69a48 1605800 doc optional libtorrent-rasterbar-doc_2.0.8-1_all.deb │ 08dc5b726e361f27d835522e533d42a5 51839884 debug optional libtorrent-rasterbar2.0-dbgsym_2.0.8-1_amd64.deb │ 3e0d2464a8f4568e69d2977b586fd088 1551840 libs optional libtorrent-rasterbar2.0_2.0.8-1_amd64.deb │ d43c877edb4a898341bdf1cb94c5bbd6 13019504 debug optional python3-libtorrent-dbgsym_2.0.8-1_amd64.deb │ dd725d8da8d36614bfebc766e83fccf8 673812 python optional python3-libtorrent_2.0.8-1_amd64.deb ├── libtorrent-rasterbar-doc_2.0.8-1_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2022-10-23 15:10:21.000000 debian-binary │ │ -rw-r--r-- 0 0 0 3632 2022-10-23 15:10:21.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 1601936 2022-10-23 15:10:21.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 1601976 2022-10-23 15:10:21.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html │ │ │ │ @@ -55,94 +55,94 @@ │ │ │ │
  • enum error_code_enum
  • │ │ │ │
  • session_params │ │ │ │
  • │ │ │ │
  • session_proxy │ │ │ │
  • │ │ │ │
  • session │ │ │ │
  • │ │ │ │
  • session_handle │ │ │ │
  • │ │ │ │ -
  • write_session_params() read_session_params() write_session_params_buf()
  • │ │ │ │ +
  • read_session_params() write_session_params_buf() write_session_params()
  • │ │ │ │
  • web_seed_entry │ │ │ │
  • │ │ │ │
  • load_torrent_limits
  • │ │ │ │
  • torrent_info │ │ │ │
  • │ │ │ │
  • peer_info
  • │ │ │ │
  • info_hash_t │ │ │ │
  • │ │ │ │
  • piece_block
  • │ │ │ │
  • peer_request │ │ │ │
  • │ │ │ │ -
  • load_torrent_parsed() load_torrent_file() load_torrent_buffer()
  • │ │ │ │ +
  • load_torrent_file() load_torrent_parsed() load_torrent_buffer()
  • │ │ │ │
  • make_magnet_uri()
  • │ │ │ │
  • parse_magnet_uri()
  • │ │ │ │
  • truncate_files()
  • │ │ │ │
  • version()
  • │ │ │ │
  • enum socket_type_t
  • │ │ │ │
  • enum protocol_version
  • │ │ │ │
  • enum portmap_transport
  • │ │ │ │ @@ -199,30 +199,30 @@ │ │ │ │
  • load_state()
  • │ │ │ │ │ │ │ │ │ │ │ │
  • torrent_plugin │ │ │ │
  • │ │ │ │
  • peer_plugin │ │ │ │
  • │ │ │ │
  • dht_get_peers_reply_alert
  • │ │ │ │
  • dht_direct_response_alert
  • │ │ │ │
  • picker_log_alert
  • │ │ │ │
  • session_error_alert
  • │ │ │ │
  • dht_live_nodes_alert │ │ │ │
  • │ │ │ │
  • session_stats_header_alert
  • │ │ │ │
  • dht_sample_infohashes_alert │ │ │ │
  • │ │ │ │
  • block_uploaded_alert
  • │ │ │ │
  • alerts_dropped_alert
  • │ │ │ │
  • socks5_alert
  • │ │ │ │ @@ -582,15 +582,15 @@ │ │ │ │
  • torrent_conflict_alert
  • │ │ │ │
  • alert_cast()
  • │ │ │ │
  • operation_name()
  • │ │ │ │
  • enum operation_t
  • │ │ │ │
  • alert_category_t
  • │ │ │ │
  • int
  • │ │ │ │
  • counters │ │ │ │
  • │ │ │ │
  • stats_metric
  • │ │ │ │
  • session_stats_metrics()
  • │ │ │ │
  • find_metric_idx()
  • │ │ │ │
  • enum metric_type_t
  • │ │ │ │
  • ip_filter │ │ │ │ │ │ │ │ [report issue] │ │ │ │
    │ │ │ │

    make_magnet_uri()

    │ │ │ │

    Declared in "libtorrent/magnet_uri.hpp"

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

    Generates a magnet URI from the specified torrent.

    │ │ │ │

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

    │ │ │ │
    │ │ │ │ ti, info_hashes, url_seeds, dht_nodes, │ │ │ │ @@ -4479,16 +4479,16 @@ │ │ │ │ an empty string is returned.

    │ │ │ │

    For more information about magnet links, see magnet links.

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

    parse_magnet_uri()

    │ │ │ │

    Declared in "libtorrent/magnet_uri.hpp"

    │ │ │ │
    │ │ │ │ -add_torrent_params parse_magnet_uri (string_view uri);
    │ │ │ │  add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);
    │ │ │ │ +add_torrent_params parse_magnet_uri (string_view uri);
    │ │ │ │  void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec);
    │ │ │ │  
    │ │ │ │

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

    │ │ │ │ @@ -5278,16 +5278,16 @@ │ │ │ │
    │ │ │ │  struct torrent_plugin
    │ │ │ │  {
    │ │ │ │     virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);
    │ │ │ │     virtual void on_piece_pass (piece_index_t);
    │ │ │ │     virtual void on_piece_failed (piece_index_t);
    │ │ │ │     virtual void tick ();
    │ │ │ │ -   virtual bool on_resume ();
    │ │ │ │     virtual bool on_pause ();
    │ │ │ │ +   virtual bool on_resume ();
    │ │ │ │     virtual void on_files_checked ();
    │ │ │ │     virtual void on_state (torrent_status::state_t);
    │ │ │ │     virtual void on_add_peer (tcp::endpoint const&,
    │ │ │ │        peer_source_flags_t, add_peer_flags_t);
    │ │ │ │  
    │ │ │ │     static constexpr add_peer_flags_t first_time  = 1_bit;
    │ │ │ │     static constexpr add_peer_flags_t filtered  = 2_bit;
    │ │ │ │ @@ -5326,21 +5326,21 @@
    │ │ │ │  
    │ │ │ │

    tick()

    │ │ │ │
    │ │ │ │  virtual void tick ();
    │ │ │ │  
    │ │ │ │

    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.

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

    on_pause() on_resume()

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

    on_resume() on_pause()

    │ │ │ │
    │ │ │ │ -virtual bool on_resume ();
    │ │ │ │  virtual bool on_pause ();
    │ │ │ │ +virtual bool on_resume ();
    │ │ │ │  
    │ │ │ │

    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 plugin 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.

    │ │ │ │ @@ -5405,43 +5405,43 @@ │ │ │ │ { │ │ │ │ virtual string_view type () const; │ │ │ │ virtual void add_handshake (entry&); │ │ │ │ virtual void on_disconnect (error_code const&); │ │ │ │ virtual void on_connected (); │ │ │ │ virtual bool on_handshake (span<char const>); │ │ │ │ virtual bool on_extension_handshake (bdecode_node const&); │ │ │ │ + virtual bool on_request (peer_request const&); │ │ │ │ virtual bool on_have (piece_index_t); │ │ │ │ - virtual bool on_unchoke (); │ │ │ │ + virtual bool on_have_none (); │ │ │ │ + virtual bool on_bitfield (bitfield const& /*bitfield*/); │ │ │ │ + virtual bool on_choke (); │ │ │ │ + virtual bool on_allowed_fast (piece_index_t); │ │ │ │ virtual bool on_interested (); │ │ │ │ + virtual bool on_unchoke (); │ │ │ │ virtual bool on_not_interested (); │ │ │ │ - virtual bool on_allowed_fast (piece_index_t); │ │ │ │ - virtual bool on_choke (); │ │ │ │ - virtual bool on_bitfield (bitfield const& /*bitfield*/); │ │ │ │ - virtual bool on_have_all (); │ │ │ │ virtual bool on_dont_have (piece_index_t); │ │ │ │ - virtual bool on_have_none (); │ │ │ │ - virtual bool on_request (peer_request const&); │ │ │ │ + virtual bool on_have_all (); │ │ │ │ virtual bool on_piece (peer_request const& /*piece*/ │ │ │ │ , span<char const> /*buf*/); │ │ │ │ virtual bool on_cancel (peer_request const&); │ │ │ │ virtual bool on_suggest (piece_index_t); │ │ │ │ virtual bool on_reject (peer_request const&); │ │ │ │ - virtual void sent_allow_fast (piece_index_t); │ │ │ │ - virtual void sent_request (peer_request const&); │ │ │ │ + virtual void sent_have_all (); │ │ │ │ virtual void sent_have_none (); │ │ │ │ - virtual void sent_choke (); │ │ │ │ - virtual void sent_suggest (piece_index_t); │ │ │ │ + virtual void sent_request (peer_request const&); │ │ │ │ virtual void sent_cancel (peer_request const&); │ │ │ │ - virtual void sent_have_all (); │ │ │ │ + virtual void sent_choke (); │ │ │ │ virtual void sent_reject_request (peer_request const&); │ │ │ │ - virtual void sent_interested (); │ │ │ │ + virtual void sent_allow_fast (piece_index_t); │ │ │ │ + virtual void sent_suggest (piece_index_t); │ │ │ │ virtual void sent_not_interested (); │ │ │ │ - virtual void sent_have (piece_index_t); │ │ │ │ virtual void sent_piece (peer_request const&); │ │ │ │ + virtual void sent_have (piece_index_t); │ │ │ │ virtual void sent_unchoke (); │ │ │ │ + virtual void sent_interested (); │ │ │ │ virtual void sent_payload (int /* bytes */); │ │ │ │ virtual bool can_disconnect (error_code const& /*ec*/); │ │ │ │ virtual bool on_extended (int /*length*/, int /*msg*/, │ │ │ │ span<char const> /*body*/); │ │ │ │ virtual bool on_unknown_message (int /*length*/, int /*msg*/, │ │ │ │ span<char const> /*body*/); │ │ │ │ virtual void on_piece_pass (piece_index_t); │ │ │ │ @@ -5499,39 +5499,39 @@ │ │ │ │ virtual bool on_extension_handshake (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 peer_plugin │ │ │ │ being removed from the peer_connection and destructed. │ │ │ │ this is not called for web seeds

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

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

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

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

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

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

    │ │ │ │ [report issue]
    │ │ │ │ @@ -5543,27 +5543,27 @@ │ │ │ │ │ │ │ │

    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.

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

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

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

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

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

    called after a choke message has been sent to the peer

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

    sent_payload()

    │ │ │ │
    │ │ │ │  virtual void sent_payload (int /* bytes */);
    │ │ │ │ @@ -5633,16 +5633,16 @@
    │ │ │ │  
    │ │ │ │
    │ │ │ │

    crypto_plugin

    │ │ │ │

    Declared in "libtorrent/extensions.hpp"

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

    decrypt()

    │ │ │ │
    │ │ │ │ @@ -5666,49 +5666,49 @@
    │ │ │ │  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>);
    │ │ │ │ +   peer_plugin const* find_plugin (string_view type) const;
    │ │ │ │     bool is_seed () const;
    │ │ │ │     bool upload_only () const;
    │ │ │ │ -   bool has_piece (piece_index_t i) const;
    │ │ │ │     peer_id const& pid () const;
    │ │ │ │ -   bool is_choked () const;
    │ │ │ │ +   bool has_piece (piece_index_t i) const;
    │ │ │ │     bool is_interesting () const;
    │ │ │ │ -   bool has_peer_choked () const;
    │ │ │ │ +   bool is_choked () const;
    │ │ │ │     bool is_peer_interested () const;
    │ │ │ │ +   bool has_peer_choked () const;
    │ │ │ │     void maybe_unchoke_this_peer ();
    │ │ │ │     void choke_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;
    │ │ │ │ -   bool is_connecting () 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 ignore_unchoke_slots () const;
    │ │ │ │     bool on_local_network () 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 should_log (peer_log_alert::direction_t direction) const;
    │ │ │ │     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;
    │ │ │ │     bool operator== (peer_connection_handle const& o) const;
    │ │ │ │     std::shared_ptr<peer_connection> native_handle () const;
    │ │ │ │  };
    │ │ │ │  
    │ │ │ │ [report issue]
    │ │ │ │
    │ │ │ │

    bt_peer_connection_handle

    │ │ │ │ @@ -5716,16 +5716,16 @@ │ │ │ │

    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 packet_finished () const;
    │ │ │ │     bool supports_encryption () const;
    │ │ │ │     void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);
    │ │ │ │     void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);
    │ │ │ │     std::shared_ptr<bt_peer_connection> native_handle () const;
    │ │ │ │  };
    │ │ │ │  
    │ │ │ │ [report issue]
    │ │ │ │ @@ -5812,28 +5812,28 @@ │ │ │ │ { │ │ │ │ bool is_valid () const; │ │ │ │ void reserve (int num_files); │ │ │ │ void add_file (error_code& ec, std::string const& path, std::int64_t file_size │ │ │ │ , file_flags_t file_flags = {} │ │ │ │ , std::time_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ - void add_file_borrow (error_code& ec, string_view filename │ │ │ │ - , std::string const& path, std::int64_t file_size │ │ │ │ - , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ - , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ - , char const* root_hash = nullptr); │ │ │ │ void add_file_borrow (string_view filename │ │ │ │ , std::string const& path, std::int64_t file_size │ │ │ │ , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ void add_file (std::string const& path, std::int64_t file_size │ │ │ │ , file_flags_t file_flags = {} │ │ │ │ , std::time_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ + void add_file_borrow (error_code& ec, string_view filename │ │ │ │ + , std::string const& path, std::int64_t file_size │ │ │ │ + , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ + , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ + , char const* root_hash = nullptr); │ │ │ │ void rename_file (file_index_t index, std::string const& new_filename); │ │ │ │ std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset │ │ │ │ , std::int64_t size) const; │ │ │ │ peer_request map_file (file_index_t file, std::int64_t offset, int size) const; │ │ │ │ int num_files () const noexcept; │ │ │ │ file_index_t end_file () const noexcept; │ │ │ │ index_range<file_index_t> file_range () const noexcept; │ │ │ │ @@ -5848,27 +5848,27 @@ │ │ │ │ int piece_size (piece_index_t index) const; │ │ │ │ int piece_size2 (piece_index_t index) const; │ │ │ │ int blocks_in_piece2 (piece_index_t index) const; │ │ │ │ std::string const& name () const; │ │ │ │ void set_name (std::string const& n); │ │ │ │ void swap (file_storage& ti) noexcept; │ │ │ │ void canonicalize (); │ │ │ │ - sha1_hash hash (file_index_t index) const; │ │ │ │ - std::time_t mtime (file_index_t index) const; │ │ │ │ std::string symlink (file_index_t index) const; │ │ │ │ bool pad_file_at (file_index_t index) const; │ │ │ │ + sha256_hash root (file_index_t index) const; │ │ │ │ + std::int64_t file_offset (file_index_t index) const; │ │ │ │ + sha1_hash hash (file_index_t index) const; │ │ │ │ std::int64_t file_size (file_index_t index) const; │ │ │ │ std::string file_path (file_index_t index, std::string const& save_path = "") const; │ │ │ │ - std::int64_t file_offset (file_index_t index) const; │ │ │ │ char const* root_ptr (file_index_t const index) const; │ │ │ │ - sha256_hash root (file_index_t index) const; │ │ │ │ + std::time_t mtime (file_index_t index) const; │ │ │ │ string_view file_name (file_index_t index) const; │ │ │ │ + index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const; │ │ │ │ int file_num_blocks (file_index_t index) const; │ │ │ │ int file_num_pieces (file_index_t index) const; │ │ │ │ - index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const; │ │ │ │ int file_first_block_node (file_index_t index) const; │ │ │ │ int file_first_piece_node (file_index_t index) const; │ │ │ │ std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const; │ │ │ │ void all_path_hashes (std::unordered_set<std::uint32_t>& table) const; │ │ │ │ file_flags_t file_flags (file_index_t index) const; │ │ │ │ bool file_absolute_path (file_index_t index) const; │ │ │ │ file_index_t file_index_at_offset (std::int64_t offset) const; │ │ │ │ @@ -5898,37 +5898,37 @@ │ │ │ │

    reserve()

    │ │ │ │
    │ │ │ │  void reserve (int num_files);
    │ │ │ │  
    │ │ │ │

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

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

    add_file() add_file_borrow()

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

    add_file_borrow() add_file()

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

    Adds a file to the file storage. The add_file_borrow version │ │ │ │ expects that filename is the file name (without a path) of │ │ │ │ the file that's being added. │ │ │ │ This memory is borrowed, i.e. it is the caller's │ │ │ │ responsibility to make sure it stays valid throughout the lifetime │ │ │ │ of this file_storage object or any copy of it. The same thing applies │ │ │ │ @@ -6060,18 +6060,18 @@ │ │ │ │

    piece_range()

    │ │ │ │
    │ │ │ │  index_range<piece_index_t> piece_range () const noexcept;
    │ │ │ │  
    │ │ │ │

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

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

    piece_length() set_piece_length()

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

    set_piece_length() piece_length()

    │ │ │ │
    │ │ │ │  int piece_length () const;
    │ │ │ │  void set_piece_length (int l);
    │ │ │ │  
    │ │ │ │

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

    │ │ │ │ [report issue]
    │ │ │ │ @@ -6095,18 +6095,18 @@ │ │ │ │ [report issue] │ │ │ │
    │ │ │ │

    blocks_in_piece2()

    │ │ │ │
    │ │ │ │  int blocks_in_piece2 (piece_index_t index) const;
    │ │ │ │  
    │ │ │ │

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

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

    set_name() name()

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

    name() set_name()

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

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

    │ │ │ │ [report issue]
    │ │ │ │ @@ -6120,36 +6120,36 @@ │ │ │ │
    │ │ │ │

    canonicalize()

    │ │ │ │
    │ │ │ │  void canonicalize ();
    │ │ │ │  
    │ │ │ │

    arrange files and padding to match the canonical form required │ │ │ │ by BEP 52

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

    file_num_pieces() file_num_blocks() file_piece_range()

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

    file_piece_range() file_num_pieces() file_num_blocks()

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

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

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

    file_first_block_node() file_first_piece_node()

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

    file_first_piece_node() file_first_block_node()

    │ │ │ │
    │ │ │ │  int file_first_block_node (file_index_t index) const;
    │ │ │ │  int file_first_piece_node (file_index_t index) const;
    │ │ │ │  
    │ │ │ │

    index of first piece node in the merkle tree

    │ │ │ │ [report issue]
    │ │ │ │
    │ │ │ │ @@ -6229,18 +6229,18 @@ │ │ │ │

    file_absolute_path()

    │ │ │ │
    │ │ │ │  bool file_absolute_path (file_index_t index) const;
    │ │ │ │  
    │ │ │ │

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

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

    file_index_at_offset() file_index_at_piece()

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

    file_index_at_piece() file_index_at_offset()

    │ │ │ │
    │ │ │ │  file_index_t file_index_at_offset (std::int64_t offset) const;
    │ │ │ │  file_index_t file_index_at_piece (piece_index_t piece) const;
    │ │ │ │  
    │ │ │ │

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

    │ │ │ │ [report issue]
    │ │ │ │
    │ │ │ │ @@ -6480,38 +6480,38 @@ │ │ │ │ struct client_data_t │ │ │ │ { │ │ │ │ client_data_t () = default; │ │ │ │ explicit client_data_t (T* v); │ │ │ │ client_data_t& operator= (T* v); │ │ │ │ T* get () const; │ │ │ │ explicit operator T () const; │ │ │ │ - operator void* () const = delete; │ │ │ │ operator void const* () const = delete; │ │ │ │ client_data_t& operator= (void*) = delete; │ │ │ │ client_data_t& operator= (void const*) = delete; │ │ │ │ + operator void* () const = delete; │ │ │ │ │ │ │ │ template <typename T, typename U = typename std::enable_if<std::is_pointer<T>::value>::type> │ │ │ │ }; │ │ │ │ │ │ │ │ [report issue]
    │ │ │ │

    client_data_t()

    │ │ │ │
    │ │ │ │  client_data_t () = default;
    │ │ │ │  
    │ │ │ │

    construct a nullptr client data

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

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

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

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

    │ │ │ │
    │ │ │ │ -operator void* () const = delete;
    │ │ │ │  operator void const* () const = delete;
    │ │ │ │  client_data_t& operator= (void*) = delete;
    │ │ │ │  client_data_t& operator= (void const*) = delete;
    │ │ │ │ +operator void* () const = delete;
    │ │ │ │  
    │ │ │ │

    we don't allow type-unsafe operations

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

    add_torrent_params

    │ │ │ │

    Declared in "libtorrent/add_torrent_params.hpp"

    │ │ │ │ @@ -6894,18 +6894,18 @@ │ │ │ │

    Declared in "libtorrent/peer_class_type_filter.hpp"

    │ │ │ │

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

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

    remove() add()

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

    add() remove()

    │ │ │ │
    │ │ │ │ -void add (socket_type_t const st, peer_class_t const peer_class);
    │ │ │ │  void remove (socket_type_t const st, peer_class_t const peer_class);
    │ │ │ │ +void add (socket_type_t const st, peer_class_t const peer_class);
    │ │ │ │  
    │ │ │ │

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

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

    disallow() allow()

    │ │ │ │
    │ │ │ │ -void allow (socket_type_t const st, peer_class_t const peer_class);
    │ │ │ │  void disallow (socket_type_t const st, peer_class_t const peer_class);
    │ │ │ │ +void allow (socket_type_t const st, peer_class_t const peer_class);
    │ │ │ │  
    │ │ │ │

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

    │ │ │ │

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

    │ │ │ │ [report issue]
    │ │ │ │
    │ │ │ │ @@ -6997,16 +6997,16 @@ │ │ │ │

    block_info

    │ │ │ │

    Declared in "libtorrent/torrent_handle.hpp"

    │ │ │ │

    holds the state of a block in a piece. Who we requested │ │ │ │ it from and how far along we are at downloading it.

    │ │ │ │
    │ │ │ │  struct block_info
    │ │ │ │  {
    │ │ │ │ -   tcp::endpoint peer () const;
    │ │ │ │     void set_peer (tcp::endpoint const& ep);
    │ │ │ │ +   tcp::endpoint peer () const;
    │ │ │ │  
    │ │ │ │     enum block_state_t
    │ │ │ │     {
    │ │ │ │        none,
    │ │ │ │        requested,
    │ │ │ │        writing,
    │ │ │ │        finished,
    │ │ │ │ @@ -7014,20 +7014,20 @@
    │ │ │ │  
    │ │ │ │     unsigned bytes_progress:15;
    │ │ │ │     unsigned block_size:15;
    │ │ │ │     unsigned state:2;
    │ │ │ │     unsigned num_peers:14;
    │ │ │ │  };
    │ │ │ │  
    │ │ │ │ - │ │ │ │ -[report issue]
    │ │ │ │ -

    set_peer() peer()

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

    peer() set_peer()

    │ │ │ │
    │ │ │ │ -tcp::endpoint peer () const;
    │ │ │ │  void set_peer (tcp::endpoint const& ep);
    │ │ │ │ +tcp::endpoint peer () const;
    │ │ │ │  
    │ │ │ │

    The peer is the ip address of the peer this block was downloaded from.

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

    enum block_state_t

    │ │ │ │

    Declared in "libtorrent/torrent_handle.hpp"

    │ │ │ │ │ │ │ │ @@ -7170,97 +7170,97 @@ │ │ │ │ torrent_handle () noexcept = default; │ │ │ │ void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const; │ │ │ │ void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const; │ │ │ │ void read_piece (piece_index_t piece) const; │ │ │ │ bool have_piece (piece_index_t piece) const; │ │ │ │ void get_peer_info (std::vector<peer_info>& v) const; │ │ │ │ torrent_status status (status_flags_t flags = status_flags_t::all()) const; │ │ │ │ - void get_download_queue (std::vector<partial_piece_info>& queue) const; │ │ │ │ std::vector<partial_piece_info> get_download_queue () const; │ │ │ │ + void get_download_queue (std::vector<partial_piece_info>& queue) const; │ │ │ │ void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const; │ │ │ │ - void clear_piece_deadlines () const; │ │ │ │ void reset_piece_deadline (piece_index_t index) const; │ │ │ │ + void clear_piece_deadlines () const; │ │ │ │ void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const; │ │ │ │ std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const; │ │ │ │ std::vector<open_file_state> file_status () const; │ │ │ │ void clear_error () const; │ │ │ │ - void replace_trackers (std::vector<announce_entry> const&) const; │ │ │ │ void add_tracker (announce_entry const&) const; │ │ │ │ + void replace_trackers (std::vector<announce_entry> const&) const; │ │ │ │ std::vector<announce_entry> trackers () const; │ │ │ │ + void add_url_seed (std::string const& url) const; │ │ │ │ std::set<std::string> url_seeds () const; │ │ │ │ void remove_url_seed (std::string const& url) const; │ │ │ │ - void add_url_seed (std::string const& url) const; │ │ │ │ - std::set<std::string> http_seeds () const; │ │ │ │ void remove_http_seed (std::string const& url) const; │ │ │ │ void add_http_seed (std::string const& url) const; │ │ │ │ + std::set<std::string> http_seeds () const; │ │ │ │ void add_extension ( │ │ │ │ std::function<std::shared_ptr<torrent_plugin>(torrent_handle const&, client_data_t)> const& ext │ │ │ │ , client_data_t userdata = client_data_t{}); │ │ │ │ bool set_metadata (span<char const> metadata) const; │ │ │ │ bool is_valid () const; │ │ │ │ void resume () const; │ │ │ │ void pause (pause_flags_t flags = {}) const; │ │ │ │ + void set_flags (torrent_flags_t flags) const; │ │ │ │ torrent_flags_t flags () const; │ │ │ │ - void unset_flags (torrent_flags_t flags) const; │ │ │ │ void set_flags (torrent_flags_t flags, torrent_flags_t mask) const; │ │ │ │ - void set_flags (torrent_flags_t flags) const; │ │ │ │ + void unset_flags (torrent_flags_t flags) const; │ │ │ │ void flush_cache () const; │ │ │ │ void force_recheck () const; │ │ │ │ void save_resume_data (resume_data_flags_t flags = {}) const; │ │ │ │ bool need_save_resume_data () const; │ │ │ │ - void queue_position_up () const; │ │ │ │ - queue_position_t queue_position () const; │ │ │ │ void queue_position_bottom () const; │ │ │ │ + queue_position_t queue_position () const; │ │ │ │ + void queue_position_up () const; │ │ │ │ void queue_position_down () const; │ │ │ │ void queue_position_top () const; │ │ │ │ void queue_position_set (queue_position_t p) const; │ │ │ │ + void set_ssl_certificate_buffer (std::string const& certificate │ │ │ │ + , std::string const& private_key │ │ │ │ + , std::string const& dh_params); │ │ │ │ void set_ssl_certificate (std::string const& certificate │ │ │ │ , std::string const& private_key │ │ │ │ , std::string const& dh_params │ │ │ │ , std::string const& passphrase = ""); │ │ │ │ - void set_ssl_certificate_buffer (std::string const& certificate │ │ │ │ - , std::string const& private_key │ │ │ │ - , std::string const& dh_params); │ │ │ │ - std::shared_ptr<torrent_info> torrent_file_with_hashes () const; │ │ │ │ std::shared_ptr<const torrent_info> torrent_file () const; │ │ │ │ + std::shared_ptr<torrent_info> torrent_file_with_hashes () const; │ │ │ │ std::vector<std::vector<sha256_hash>> piece_layers () const; │ │ │ │ void piece_availability (std::vector<int>& avail) const; │ │ │ │ + void piece_priority (piece_index_t index, download_priority_t priority) const; │ │ │ │ std::vector<download_priority_t> get_piece_priorities () const; │ │ │ │ void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const; │ │ │ │ download_priority_t piece_priority (piece_index_t index) const; │ │ │ │ - void piece_priority (piece_index_t index, download_priority_t priority) const; │ │ │ │ void prioritize_pieces (std::vector<download_priority_t> const& pieces) const; │ │ │ │ - download_priority_t file_priority (file_index_t index) const; │ │ │ │ void file_priority (file_index_t index, download_priority_t priority) const; │ │ │ │ - void prioritize_files (std::vector<download_priority_t> const& files) const; │ │ │ │ + download_priority_t file_priority (file_index_t index) const; │ │ │ │ std::vector<download_priority_t> get_file_priorities () const; │ │ │ │ - void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const; │ │ │ │ - void force_dht_announce () const; │ │ │ │ + void prioritize_files (std::vector<download_priority_t> const& files) const; │ │ │ │ void force_lsd_announce () const; │ │ │ │ + void force_dht_announce () const; │ │ │ │ + void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const; │ │ │ │ void scrape_tracker (int idx = -1) const; │ │ │ │ int upload_limit () const; │ │ │ │ - int download_limit () const; │ │ │ │ void set_upload_limit (int limit) const; │ │ │ │ void set_download_limit (int limit) const; │ │ │ │ + int download_limit () const; │ │ │ │ void connect_peer (tcp::endpoint const& adr, peer_source_flags_t source = {} │ │ │ │ , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const; │ │ │ │ void clear_peers (); │ │ │ │ void set_max_uploads (int max_uploads) const; │ │ │ │ int max_uploads () const; │ │ │ │ int max_connections () const; │ │ │ │ void set_max_connections (int max_connections) const; │ │ │ │ void move_storage (std::string const& save_path │ │ │ │ , move_flags_t flags = move_flags_t::always_replace_files │ │ │ │ ) const; │ │ │ │ void rename_file (file_index_t index, std::string const& new_name) const; │ │ │ │ info_hash_t info_hashes () const; │ │ │ │ sha1_hash info_hash () const; │ │ │ │ - bool operator< (const torrent_handle& h) const; │ │ │ │ - bool operator== (const torrent_handle& h) const; │ │ │ │ bool operator!= (const torrent_handle& h) const; │ │ │ │ + bool operator== (const torrent_handle& h) const; │ │ │ │ + bool operator< (const torrent_handle& h) const; │ │ │ │ std::uint32_t id () const; │ │ │ │ std::shared_ptr<torrent> native_handle () const; │ │ │ │ client_data_t userdata () const; │ │ │ │ bool in_session () const; │ │ │ │ │ │ │ │ static constexpr add_piece_flags_t overwrite_existing = 0_bit; │ │ │ │ static constexpr status_flags_t query_distributed_copies = 0_bit; │ │ │ │ @@ -7363,30 +7363,30 @@ │ │ │ │ filter them out.

    │ │ │ │

    By default everything is included. The flags you can use to decide │ │ │ │ what to include are defined in this class.

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

    get_download_queue()

    │ │ │ │
    │ │ │ │ -void get_download_queue (std::vector<partial_piece_info>& queue) const;
    │ │ │ │  std::vector<partial_piece_info> get_download_queue () const;
    │ │ │ │ +void get_download_queue (std::vector<partial_piece_info>& queue) const;
    │ │ │ │  
    │ │ │ │

    get_download_queue() returns a vector with information about pieces │ │ │ │ that are partially downloaded or not downloaded but partially │ │ │ │ requested. See partial_piece_info for the fields in the returned │ │ │ │ vector.

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

    clear_piece_deadlines() reset_piece_deadline() set_piece_deadline()

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

    set_piece_deadline() clear_piece_deadlines() reset_piece_deadline()

    │ │ │ │
    │ │ │ │  void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;
    │ │ │ │ -void clear_piece_deadlines () const;
    │ │ │ │  void reset_piece_deadline (piece_index_t index) const;
    │ │ │ │ +void clear_piece_deadlines () const;
    │ │ │ │  
    │ │ │ │

    This function sets or resets the deadline associated with a specific │ │ │ │ piece index (index). libtorrent will attempt to download this │ │ │ │ entire piece before the deadline expires. This is not necessarily │ │ │ │ possible, but pieces with a more recent deadline will always be │ │ │ │ prioritized over pieces with a deadline further ahead in time. The │ │ │ │ deadline (and flags) of a piece can be changed by calling this │ │ │ │ @@ -7439,22 +7439,22 @@ │ │ │ │

    │ │ │ │

    clear_error()

    │ │ │ │
    │ │ │ │  void clear_error () const;
    │ │ │ │  
    │ │ │ │

    If the torrent is in an error state (i.e. torrent_status::error is │ │ │ │ non-empty), this will clear the error and start the torrent again.

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

    replace_trackers() trackers() add_tracker()

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

    trackers() replace_trackers() add_tracker()

    │ │ │ │
    │ │ │ │ -void replace_trackers (std::vector<announce_entry> const&) const;
    │ │ │ │  void add_tracker (announce_entry const&) const;
    │ │ │ │ +void replace_trackers (std::vector<announce_entry> const&) const;
    │ │ │ │  std::vector<announce_entry> trackers () const;
    │ │ │ │  
    │ │ │ │

    trackers() will return the list of trackers for this torrent. The │ │ │ │ announce entry contains both a string url which specify the │ │ │ │ announce url for the tracker as well as an int tier, which is │ │ │ │ specifies the order in which this tracker is tried. If you want │ │ │ │ libtorrent to use another list of trackers for this torrent, you can │ │ │ │ @@ -7466,41 +7466,41 @@ │ │ │ │ set. If it is, it doesn't do anything. If it's not in the current set │ │ │ │ of trackers, it will insert it in the tier specified in the │ │ │ │ announce_entry.

    │ │ │ │

    The updated set of trackers will be saved in the resume data, and when │ │ │ │ a torrent is started with resume data, the trackers from the resume │ │ │ │ data will replace the original ones.

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

    url_seeds() add_url_seed() remove_url_seed()

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

    url_seeds() remove_url_seed() add_url_seed()

    │ │ │ │
    │ │ │ │ +void add_url_seed (std::string const& url) const;
    │ │ │ │  std::set<std::string> url_seeds () const;
    │ │ │ │  void remove_url_seed (std::string const& url) const;
    │ │ │ │ -void add_url_seed (std::string const& url) const;
    │ │ │ │  
    │ │ │ │

    add_url_seed() adds another url to the torrent's list of url │ │ │ │ seeds. If the given url already exists in that list, the call has no │ │ │ │ effect. The torrent will connect to the server and try to download │ │ │ │ pieces from it, unless it's paused, queued, checking or seeding. │ │ │ │ remove_url_seed() removes the given url if it exists already. │ │ │ │ url_seeds() return a set of the url seeds currently in this │ │ │ │ torrent. Note that URLs that fails may be removed automatically from │ │ │ │ the list.

    │ │ │ │

    See http seeding for more information.

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

    remove_http_seed() http_seeds() add_http_seed()

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

    http_seeds() add_http_seed() remove_http_seed()

    │ │ │ │
    │ │ │ │ -std::set<std::string> http_seeds () const;
    │ │ │ │  void remove_http_seed (std::string const& url) const;
    │ │ │ │  void add_http_seed (std::string const& url) const;
    │ │ │ │ +std::set<std::string> http_seeds () const;
    │ │ │ │  
    │ │ │ │

    These functions are identical as the *_url_seed() variants, but │ │ │ │ they operate on BEP 17 web seeds instead of BEP 19.

    │ │ │ │

    See http seeding for more information.

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

    add_extension()

    │ │ │ │ @@ -7573,18 +7573,18 @@ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ [report issue]
    │ │ │ │
    │ │ │ │

    unset_flags() set_flags() flags()

    │ │ │ │
    │ │ │ │ +void set_flags (torrent_flags_t flags) const;
    │ │ │ │  torrent_flags_t flags () const;
    │ │ │ │ -void unset_flags (torrent_flags_t flags) const;
    │ │ │ │  void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;
    │ │ │ │ -void set_flags (torrent_flags_t flags) const;
    │ │ │ │ +void unset_flags (torrent_flags_t flags) const;
    │ │ │ │  
    │ │ │ │

    sets and gets the torrent state flags. See torrent_flags_t. │ │ │ │ The set_flags overload that take a mask will affect all │ │ │ │ flags part of the mask, and set their values to what the │ │ │ │ flags argument is set to. This allows clearing and │ │ │ │ setting flags in a single function call. │ │ │ │ The set_flags overload that just takes flags, sets all │ │ │ │ @@ -7735,25 +7735,25 @@ │ │ │ │

    │ │ │ │

    Note

    │ │ │ │

    A torrent's resume data is considered saved as soon as the │ │ │ │ save_resume_data_alert is posted. It is important to make sure this │ │ │ │ alert is received and handled in order for this function to be │ │ │ │ meaningful.

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

    queue_position_up() queue_position_down() queue_position_top() queue_position_bottom() queue_position()

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

    queue_position() queue_position_up() queue_position_bottom() queue_position_down() queue_position_top()

    │ │ │ │
    │ │ │ │ -void queue_position_up () const;
    │ │ │ │ -queue_position_t queue_position () const;
    │ │ │ │  void queue_position_bottom () const;
    │ │ │ │ +queue_position_t queue_position () const;
    │ │ │ │ +void queue_position_up () const;
    │ │ │ │  void queue_position_down () const;
    │ │ │ │  void queue_position_top () const;
    │ │ │ │  
    │ │ │ │

    Every torrent that is added is assigned a queue position exactly one │ │ │ │ greater than the greatest queue position of all existing torrents. │ │ │ │ Torrents that are being seeded have -1 as their queue position, since │ │ │ │ they're no longer in line to be downloaded.

    │ │ │ │ @@ -7774,26 +7774,26 @@ │ │ │ │

    queue_position_set()

    │ │ │ │
    │ │ │ │  void queue_position_set (queue_position_t p) const;
    │ │ │ │  
    │ │ │ │

    updates the position in the queue for this torrent. The relative order │ │ │ │ of all other torrents remain intact but their numerical queue position │ │ │ │ shifts to make space for this torrent's new position

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

    set_ssl_certificate_buffer() set_ssl_certificate()

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

    set_ssl_certificate() set_ssl_certificate_buffer()

    │ │ │ │
    │ │ │ │ +void set_ssl_certificate_buffer (std::string const& certificate
    │ │ │ │ +      , std::string const& private_key
    │ │ │ │ +      , std::string const& dh_params);
    │ │ │ │  void set_ssl_certificate (std::string const& certificate
    │ │ │ │        , std::string const& private_key
    │ │ │ │        , std::string const& dh_params
    │ │ │ │        , std::string const& passphrase = "");
    │ │ │ │ -void set_ssl_certificate_buffer (std::string const& certificate
    │ │ │ │ -      , std::string const& private_key
    │ │ │ │ -      , std::string const& dh_params);
    │ │ │ │  
    │ │ │ │

    For SSL torrents, use this to specify a path to a .pem file to use as │ │ │ │ this client's certificate. The certificate must be signed by the │ │ │ │ certificate in the .torrent file to be valid.

    │ │ │ │

    The set_ssl_certificate_buffer() overload takes the actual certificate, │ │ │ │ private key and DH params as strings, rather than paths to files.

    │ │ │ │

    cert is a path to the (signed) certificate in .pem format │ │ │ │ @@ -7809,21 +7809,21 @@ │ │ │ │

    Note that when a torrent first starts up, and it needs a certificate, │ │ │ │ it will suspend connecting to any peers until it has one. It's │ │ │ │ typically desirable to resume the torrent after setting the SSL │ │ │ │ certificate.

    │ │ │ │

    If you receive a torrent_need_cert_alert, you need to call this to │ │ │ │ provide a valid cert. If you don't have a cert you won't be allowed to │ │ │ │ connect to any peers.

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

    torrent_file() torrent_file_with_hashes()

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

    torrent_file_with_hashes() torrent_file()

    │ │ │ │
    │ │ │ │ -std::shared_ptr<torrent_info> torrent_file_with_hashes () const;
    │ │ │ │  std::shared_ptr<const torrent_info> torrent_file () const;
    │ │ │ │ +std::shared_ptr<torrent_info> torrent_file_with_hashes () const;
    │ │ │ │  
    │ │ │ │

    torrent_file() returns a pointer to the torrent_info object │ │ │ │ associated with this torrent. The torrent_info object may be a copy │ │ │ │ of the internal object. If the torrent doesn't have metadata, the │ │ │ │ pointer will not be initialized (i.e. a nullptr). The torrent may be │ │ │ │ in a state without metadata only if it was started without a .torrent │ │ │ │ file, e.g. by being added by magnet link.

    │ │ │ │ @@ -7874,18 +7874,18 @@ │ │ │ │ that libtorrent uses in order to prefer picking rare pieces.

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

    piece_priority() prioritize_pieces() get_piece_priorities()

    │ │ │ │
    │ │ │ │ +void piece_priority (piece_index_t index, download_priority_t priority) const;
    │ │ │ │  std::vector<download_priority_t> get_piece_priorities () const;
    │ │ │ │  void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;
    │ │ │ │  download_priority_t piece_priority (piece_index_t index) const;
    │ │ │ │ -void piece_priority (piece_index_t index, download_priority_t priority) const;
    │ │ │ │  void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;
    │ │ │ │  
    │ │ │ │

    These functions are used to set and get the priority of individual │ │ │ │ pieces. By default all pieces have priority 4. That means that the │ │ │ │ random rarest first algorithm is effectively active for all pieces. │ │ │ │ You may however change the priority of individual pieces. There are 8 │ │ │ │ priority levels. 0 means not to download the piece at all. Otherwise, │ │ │ │ @@ -7914,18 +7914,18 @@ │ │ │ │ usage of file- and piece priorities.

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

    get_file_priorities() prioritize_files() file_priority()

    │ │ │ │
    │ │ │ │ -download_priority_t file_priority (file_index_t index) const;
    │ │ │ │  void file_priority (file_index_t index, download_priority_t priority) const;
    │ │ │ │ -void prioritize_files (std::vector<download_priority_t> const& files) const;
    │ │ │ │ +download_priority_t file_priority (file_index_t index) const;
    │ │ │ │  std::vector<download_priority_t> get_file_priorities () const;
    │ │ │ │ +void prioritize_files (std::vector<download_priority_t> const& files) const;
    │ │ │ │  
    │ │ │ │

    index must be in the range [0, number_of_files).

    │ │ │ │

    file_priority() queries or sets the priority of file index.

    │ │ │ │

    prioritize_files() takes a vector that has at as many elements as │ │ │ │ there are files in the torrent. Each entry is the priority of that │ │ │ │ file. The function sets the priorities of all the pieces in the │ │ │ │ torrent based on the vector.

    │ │ │ │ @@ -7948,23 +7948,23 @@ │ │ │ │ file_prio_alert.

    │ │ │ │

    When combining file- and piece priorities, the resume file will record │ │ │ │ both. When loading the resume data, the file priorities will be applied │ │ │ │ first, then the piece priorities.

    │ │ │ │

    Moving data from a file into the part file is currently not │ │ │ │ supported. If a file has its priority set to 0 after it has already │ │ │ │ been created, it will not be moved into the partfile.

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

    force_dht_announce() force_lsd_announce() force_reannounce()

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

    force_lsd_announce() force_reannounce() force_dht_announce()

    │ │ │ │
    │ │ │ │ -void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;
    │ │ │ │ -void force_dht_announce () const;
    │ │ │ │  void force_lsd_announce () const;
    │ │ │ │ +void force_dht_announce () const;
    │ │ │ │ +void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;
    │ │ │ │  
    │ │ │ │

    force_reannounce() will force this torrent to do another tracker │ │ │ │ request, to receive new peers. The seconds argument specifies how │ │ │ │ many seconds from now to issue the tracker announces.

    │ │ │ │

    If the tracker's min_interval has not passed since the last │ │ │ │ announce, the forced announce will be scheduled to happen immediately │ │ │ │ as the min_interval expires. This is to honor trackers minimum │ │ │ │ @@ -7996,17 +7996,17 @@ │ │ │ │ │ │ │ │ │ │ │ │ [report issue]

    │ │ │ │
    │ │ │ │

    upload_limit() set_download_limit() set_upload_limit() download_limit()

    │ │ │ │
    │ │ │ │  int upload_limit () const;
    │ │ │ │ -int download_limit () const;
    │ │ │ │  void set_upload_limit (int limit) const;
    │ │ │ │  void set_download_limit (int limit) const;
    │ │ │ │ +int download_limit () const;
    │ │ │ │  
    │ │ │ │

    set_upload_limit will limit the upload bandwidth used by this │ │ │ │ particular torrent to the limit you set. It is given as the number of │ │ │ │ bytes per second the torrent is allowed to upload. │ │ │ │ set_download_limit works the same way but for download bandwidth │ │ │ │ instead of upload bandwidth. Note that setting a higher limit on a │ │ │ │ torrent then the global limit │ │ │ │ @@ -8052,18 +8052,18 @@ │ │ │ │ │ │ │ │

    set_max_uploads() sets the maximum number of peers that's unchoked │ │ │ │ at the same time on this torrent. If you set this to -1, there will be │ │ │ │ no limit. This defaults to infinite. The primary setting controlling │ │ │ │ this is the global unchoke slots limit, set by unchoke_slots_limit in │ │ │ │ settings_pack.

    │ │ │ │

    max_uploads() returns the current settings.

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

    max_connections() set_max_connections()

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

    set_max_connections() max_connections()

    │ │ │ │
    │ │ │ │  int max_connections () const;
    │ │ │ │  void set_max_connections (int max_connections) const;
    │ │ │ │  
    │ │ │ │

    set_max_connections() sets the maximum number of connection this │ │ │ │ torrent will open. If all connections are used up, incoming │ │ │ │ connections may be refused or poor connections may be closed. This │ │ │ │ @@ -8143,23 +8143,23 @@ │ │ │ │ │ │ │ │

    returns the info-hash(es) of the torrent. If this handle is to a │ │ │ │ torrent that hasn't loaded yet (for instance by being added) by a │ │ │ │ URL, the returned value is undefined. │ │ │ │ The info_hash() returns the SHA-1 info-hash for v1 torrents and a │ │ │ │ truncated hash for v2 torrents. For the full v2 info-hash, use │ │ │ │ info_hashes() instead.

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

    operator<() operator!=() operator==()

    │ │ │ │ +

    operator==() operator!=() operator<()

    │ │ │ │
    │ │ │ │ -bool operator< (const torrent_handle& h) const;
    │ │ │ │ -bool operator== (const torrent_handle& h) const;
    │ │ │ │  bool operator!= (const torrent_handle& h) const;
    │ │ │ │ +bool operator== (const torrent_handle& h) const;
    │ │ │ │ +bool operator< (const torrent_handle& h) const;
    │ │ │ │  
    │ │ │ │

    comparison operators. The order of the torrents is unspecified │ │ │ │ but stable.

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

    id()

    │ │ │ │
    │ │ │ │ @@ -8433,18 +8433,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 void async_read (storage_index_t storage, peer_request const& r
    │ │ │ │        , std::function<void(disk_buffer_holder, storage_error const&)> handler
    │ │ │ │        , disk_job_flags_t flags = {}) = 0;
    │ │ │ │  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
    │ │ │ │ @@ -8704,16 +8704,16 @@
    │ │ │ │  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_holder () = default;
    │ │ │ │     explicit operator bool () const;
    │ │ │ │     operator storage_index_t () const;
    │ │ │ │     void reset ();
    │ │ │ │     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;
    │ │ │ │ @@ -8844,21 +8844,21 @@
    │ │ │ │  

    settings_interface

    │ │ │ │

    Declared in "libtorrent/settings_pack.hpp"

    │ │ │ │

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

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

    file_open_mode_t

    │ │ │ │

    Declared in "libtorrent/disk_interface.hpp"

    │ │ │ │
    │ │ │ │ @@ -9218,17 +9218,17 @@ │ │ │ │ char const* new_name () const; │ │ │ │ char const* old_name () const; │ │ │ │ │ │ │ │ static constexpr alert_category_t static_category = alert_category::storage; │ │ │ │ file_index_t const index; │ │ │ │ }; │ │ │ │ │ │ │ │ - │ │ │ │ -[report issue]
    │ │ │ │ -

    old_name() new_name()

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

    new_name() old_name()

    │ │ │ │
    │ │ │ │  char const* new_name () const;
    │ │ │ │  char const* old_name () const;
    │ │ │ │  
    │ │ │ │

    returns the new and previous file name, respectively.

    │ │ │ │ [report issue]
    │ │ │ │
    index
    │ │ │ │ @@ -9960,17 +9960,17 @@ │ │ │ │ std::string message () const override; │ │ │ │ char const* old_path () const; │ │ │ │ char const* storage_path () const; │ │ │ │ │ │ │ │ static constexpr alert_category_t static_category = alert_category::storage; │ │ │ │ }; │ │ │ │ │ │ │ │ - │ │ │ │ -[report issue]
    │ │ │ │ -

    old_path() storage_path()

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

    storage_path() old_path()

    │ │ │ │
    │ │ │ │  char const* old_path () const;
    │ │ │ │  char const* storage_path () const;
    │ │ │ │  
    │ │ │ │

    the path the torrent was moved to and from, respectively.

    │ │ │ │ [report issue]
    │ │ │ │
    │ │ │ │ @@ -11618,17 +11618,17 @@ │ │ │ │ std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const; │ │ │ │ int num_nodes () const; │ │ │ │ │ │ │ │ static constexpr alert_category_t static_category = alert_category::dht; │ │ │ │ sha1_hash node_id; │ │ │ │ }; │ │ │ │ │ │ │ │ - │ │ │ │ -[report issue]
    │ │ │ │ -

    num_nodes() nodes()

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

    nodes() num_nodes()

    │ │ │ │
    │ │ │ │  std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;
    │ │ │ │  int num_nodes () const;
    │ │ │ │  
    │ │ │ │

    the number of nodes in the routing table and the actual nodes.

    │ │ │ │ [report issue]
    │ │ │ │
    node_id
    │ │ │ │ @@ -11660,32 +11660,32 @@ │ │ │ │

    Declared in "libtorrent/alert_types.hpp"

    │ │ │ │

    posted as a response to a call to session::dht_sample_infohashes() with │ │ │ │ the information from the DHT response message.

    │ │ │ │
    │ │ │ │  struct dht_sample_infohashes_alert final : alert
    │ │ │ │  {
    │ │ │ │     std::string message () const override;
    │ │ │ │ -   std::vector<sha1_hash> samples () const;
    │ │ │ │     int num_samples () const;
    │ │ │ │ +   std::vector<sha1_hash> samples () const;
    │ │ │ │     int num_nodes () const;
    │ │ │ │     std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;
    │ │ │ │  
    │ │ │ │     static constexpr alert_category_t static_category  = alert_category::dht_operation;
    │ │ │ │     sha1_hash node_id;
    │ │ │ │     aux::noexcept_movable<udp::endpoint> endpoint;
    │ │ │ │     time_duration const interval;
    │ │ │ │     int const num_infohashes;
    │ │ │ │  };
    │ │ │ │  
    │ │ │ │ - │ │ │ │ -[report issue]
    │ │ │ │ -

    num_samples() samples()

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

    samples() num_samples()

    │ │ │ │
    │ │ │ │ -std::vector<sha1_hash> samples () const;
    │ │ │ │  int num_samples () const;
    │ │ │ │ +std::vector<sha1_hash> samples () const;
    │ │ │ │  
    │ │ │ │

    returns the number of info-hashes returned by the node, as well as the │ │ │ │ actual info-hashes. num_samples() is more efficient than │ │ │ │ samples().size().

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

    num_nodes()

    │ │ │ │ @@ -11871,16 +11871,16 @@ │ │ │ │ and re-add it using this metadata │ │ │ │
    │ │ │ │ [report issue]
    │ │ │ │
    │ │ │ │

    alert_cast()

    │ │ │ │

    Declared in "libtorrent/alert.hpp"

    │ │ │ │
    │ │ │ │ -template <typename T> T* alert_cast (alert* a);
    │ │ │ │  template <typename T> T const* alert_cast (alert const* a);
    │ │ │ │ +template <typename T> T* alert_cast (alert* a);
    │ │ │ │  
    │ │ │ │

    When you get an alert, you can use alert_cast<> to attempt to cast the │ │ │ │ pointer to a specific alert type, in order to query it for more │ │ │ │ information.

    │ │ │ │
    │ │ │ │

    Note

    │ │ │ │

    alert_cast<> can only cast to an exact alert type, not a base class

    │ │ │ │ @@ -12259,26 +12259,26 @@ │ │ │ │

    Declared in "libtorrent/performance_counters.hpp"

    │ │ │ │
    │ │ │ │  struct counters
    │ │ │ │  {
    │ │ │ │     counters () ;
    │ │ │ │     counters& operator= (counters const&) & ;
    │ │ │ │     counters (counters const&) ;
    │ │ │ │ -   std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;
    │ │ │ │     std::int64_t operator[] (int i) const ;
    │ │ │ │ +   std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;
    │ │ │ │     void blend_stats_counter (int c, std::int64_t value, int ratio) ;
    │ │ │ │     void set_value (int c, std::int64_t value) ;
    │ │ │ │  };
    │ │ │ │  
    │ │ │ │ - │ │ │ │ -[report issue]
    │ │ │ │ -

    inc_stats_counter() operator[]()

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

    operator[]() inc_stats_counter()

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

    returns the new value

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

    stats_metric

    │ │ │ │

    Declared in "libtorrent/session_stats.hpp"

    │ │ │ │ @@ -12361,20 +12361,20 @@ │ │ │ │ a single rule that allows all addresses (0.0.0.0 - 255.255.255.255 for │ │ │ │ the IPv4 range, and the equivalent range covering all addresses for the │ │ │ │ IPv6 range).

    │ │ │ │

    A default constructed ip_filter does not filter any address.

    │ │ │ │
    │ │ │ │  struct ip_filter
    │ │ │ │  {
    │ │ │ │ +   ip_filter& operator= (ip_filter const&);
    │ │ │ │     ip_filter ();
    │ │ │ │     ip_filter& operator= (ip_filter&&);
    │ │ │ │ -   ~ip_filter ();
    │ │ │ │ -   ip_filter (ip_filter&&);
    │ │ │ │     ip_filter (ip_filter const&);
    │ │ │ │ -   ip_filter& operator= (ip_filter const&);
    │ │ │ │ +   ip_filter (ip_filter&&);
    │ │ │ │ +   ~ip_filter ();
    │ │ │ │     bool empty () const;
    │ │ │ │     void add_rule (address const& first, address const& last, std::uint32_t flags);
    │ │ │ │     std::uint32_t access (address const& addr) const;
    │ │ │ │     filter_tuple_t export_filter () const;
    │ │ │ │  
    │ │ │ │     enum access_flags
    │ │ │ │     {
    │ │ │ │ @@ -12459,19 +12459,19 @@
    │ │ │ │  is primarily used to indicate whether a range of ports should
    │ │ │ │  be connected to or not. The default is to have the full port
    │ │ │ │  range (0-65535) set to flag 0.

    │ │ │ │
    │ │ │ │  class port_filter
    │ │ │ │  {
    │ │ │ │     port_filter ();
    │ │ │ │ -   port_filter (port_filter&&);
    │ │ │ │ -   port_filter& operator= (port_filter&&);
    │ │ │ │     port_filter (port_filter const&);
    │ │ │ │ +   port_filter (port_filter&&);
    │ │ │ │     ~port_filter ();
    │ │ │ │     port_filter& operator= (port_filter const&);
    │ │ │ │ +   port_filter& operator= (port_filter&&);
    │ │ │ │     void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);
    │ │ │ │     std::uint32_t access (std::uint16_t port) const;
    │ │ │ │  
    │ │ │ │     enum access_flags
    │ │ │ │     {
    │ │ │ │        blocked,
    │ │ │ │     };
    │ │ │ │ @@ -12539,46 +12539,46 @@
    │ │ │ │  

    The entry class represents one node in a bencoded hierarchy. It works as a │ │ │ │ variant type, it can be either a list, a dictionary (std::map), an integer │ │ │ │ or a string.

    │ │ │ │
    │ │ │ │  class entry
    │ │ │ │  {
    │ │ │ │     data_type type () const;
    │ │ │ │ +   entry (preformatted_type);
    │ │ │ │     entry (dictionary_type);
    │ │ │ │ -   entry (integer_type);
    │ │ │ │ -   entry (list_type);
    │ │ │ │     entry (span<char const>);
    │ │ │ │ -   entry (preformatted_type);
    │ │ │ │ +   entry (list_type);
    │ │ │ │ +   entry (integer_type);
    │ │ │ │     entry (U v);
    │ │ │ │     entry (data_type t);
    │ │ │ │     entry (bdecode_node const& n);
    │ │ │ │     entry& operator= (span<char const>) &;
    │ │ │ │ -   entry& operator= (entry&&) & noexcept;
    │ │ │ │ +   entry& operator= (bdecode_node const&) &;
    │ │ │ │     entry& operator= (list_type) &;
    │ │ │ │     entry& operator= (preformatted_type) &;
    │ │ │ │ -   entry& operator= (bdecode_node const&) &;
    │ │ │ │ -   entry& operator= (integer_type) &;
    │ │ │ │ -   entry& operator= (entry const&) &;
    │ │ │ │     entry& operator= (dictionary_type) &;
    │ │ │ │ +   entry& operator= (entry const&) &;
    │ │ │ │ +   entry& operator= (integer_type) &;
    │ │ │ │ +   entry& operator= (entry&&) & noexcept;
    │ │ │ │     entry& operator= (U v) &;
    │ │ │ │     integer_type& integer ();
    │ │ │ │ -   integer_type const& integer () const;
    │ │ │ │     string_type& string ();
    │ │ │ │     dictionary_type& dict ();
    │ │ │ │ +   dictionary_type const& dict () const;
    │ │ │ │     preformatted_type const& preformatted () const;
    │ │ │ │     list_type& list ();
    │ │ │ │     preformatted_type& preformatted ();
    │ │ │ │ -   string_type const& string () const;
    │ │ │ │ -   dictionary_type const& dict () const;
    │ │ │ │     list_type const& list () const;
    │ │ │ │ +   integer_type const& integer () const;
    │ │ │ │ +   string_type const& string () const;
    │ │ │ │     void swap (entry& e);
    │ │ │ │ -   entry& operator[] (string_view key);
    │ │ │ │     entry const& operator[] (string_view key) const;
    │ │ │ │ -   entry const* find_key (string_view key) const;
    │ │ │ │ +   entry& operator[] (string_view key);
    │ │ │ │     entry* find_key (string_view key);
    │ │ │ │ +   entry const* find_key (string_view key) const;
    │ │ │ │     std::string to_string (bool single_line = false) const;
    │ │ │ │  
    │ │ │ │     enum data_type
    │ │ │ │     {
    │ │ │ │        int_t,
    │ │ │ │        string_t,
    │ │ │ │        list_t,
    │ │ │ │ @@ -12594,19 +12594,19 @@
    │ │ │ │  data_type type () const;
    │ │ │ │  
    │ │ │ │

    returns the concrete type of the entry

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

    entry()

    │ │ │ │
    │ │ │ │ +entry (preformatted_type);
    │ │ │ │  entry (dictionary_type);
    │ │ │ │ -entry (integer_type);
    │ │ │ │ -entry (list_type);
    │ │ │ │  entry (span<char const>);
    │ │ │ │ -entry (preformatted_type);
    │ │ │ │ +entry (list_type);
    │ │ │ │ +entry (integer_type);
    │ │ │ │  
    │ │ │ │

    constructors directly from a specific type. │ │ │ │ The content of the argument is copied into the │ │ │ │ newly constructed entry

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

    entry()

    │ │ │ │ @@ -12623,42 +12623,42 @@ │ │ │ │ │ │ │ │

    construct from bdecode_node parsed form (see bdecode())

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

    operator=()

    │ │ │ │
    │ │ │ │  entry& operator= (span<char const>) &;
    │ │ │ │ -entry& operator= (entry&&) & noexcept;
    │ │ │ │ +entry& operator= (bdecode_node const&) &;
    │ │ │ │  entry& operator= (list_type) &;
    │ │ │ │  entry& operator= (preformatted_type) &;
    │ │ │ │ -entry& operator= (bdecode_node const&) &;
    │ │ │ │ -entry& operator= (integer_type) &;
    │ │ │ │ -entry& operator= (entry const&) &;
    │ │ │ │  entry& operator= (dictionary_type) &;
    │ │ │ │ +entry& operator= (entry const&) &;
    │ │ │ │ +entry& operator= (integer_type) &;
    │ │ │ │ +entry& operator= (entry&&) & noexcept;
    │ │ │ │  
    │ │ │ │

    copies the structure of the right hand side into this │ │ │ │ entry.

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

    dict() preformatted() integer() list() string()

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

    integer() string() list() preformatted() dict()

    │ │ │ │
    │ │ │ │  integer_type& integer ();
    │ │ │ │ -integer_type const& integer () const;
    │ │ │ │  string_type& string ();
    │ │ │ │  dictionary_type& dict ();
    │ │ │ │ +dictionary_type const& dict () const;
    │ │ │ │  preformatted_type const& preformatted () const;
    │ │ │ │  list_type& list ();
    │ │ │ │  preformatted_type& preformatted ();
    │ │ │ │ -string_type const& string () const;
    │ │ │ │ -dictionary_type const& dict () const;
    │ │ │ │  list_type const& list () const;
    │ │ │ │ +integer_type const& integer () const;
    │ │ │ │ +string_type const& string () const;
    │ │ │ │  
    │ │ │ │

    The integer(), string(), list() and dict() functions │ │ │ │ are accessors that return the respective type. If the entry object │ │ │ │ isn't of the type you request, the accessor will throw │ │ │ │ system_error. You can ask an entry for its type through the │ │ │ │ type() function.

    │ │ │ │

    If you want to create an entry you give it the type you want it to │ │ │ │ @@ -12702,32 +12702,32 @@ │ │ │ │ void swap (entry& e); │ │ │ │ │ │ │ │

    swaps the content of this with e.

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

    operator[]()

    │ │ │ │
    │ │ │ │ -entry& operator[] (string_view key);
    │ │ │ │  entry const& operator[] (string_view key) const;
    │ │ │ │ +entry& operator[] (string_view key);
    │ │ │ │  
    │ │ │ │

    All of these functions requires the entry to be a dictionary, if it │ │ │ │ isn't they will throw system_error.

    │ │ │ │

    The non-const versions of the operator[] will return a reference │ │ │ │ to either the existing element at the given key or, if there is no │ │ │ │ element with the given key, a reference to a newly inserted element at │ │ │ │ that key.

    │ │ │ │

    The const version of operator[] will only return a reference to an │ │ │ │ existing element at the given key. If the key is not found, it will │ │ │ │ throw system_error.

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

    find_key()

    │ │ │ │
    │ │ │ │ -entry const* find_key (string_view key) const;
    │ │ │ │  entry* find_key (string_view key);
    │ │ │ │ +entry const* find_key (string_view key) const;
    │ │ │ │  
    │ │ │ │

    These functions requires the entry to be a dictionary, if it isn't │ │ │ │ they will throw system_error.

    │ │ │ │

    They will look for an element at the given key in the dictionary, if │ │ │ │ the element cannot be found, they will return nullptr. If an element │ │ │ │ with the given key is found, the return a pointer to it.

    │ │ │ │ [report issue]
    │ │ │ │ @@ -12857,27 +12857,27 @@ │ │ │ │

    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 = {});
    │ │ │ │ -   entry generate () const;
    │ │ │ │ +   explicit create_torrent (torrent_info const& ti);
    │ │ │ │     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_http_seed (string_view url);
    │ │ │ │     void add_url_seed (string_view url);
    │ │ │ │ +   void add_http_seed (string_view url);
    │ │ │ │     void add_node (std::pair<std::string, int> node);
    │ │ │ │     void add_tracker (string_view url, int tier = 0);
    │ │ │ │     void set_root_cert (string_view cert);
    │ │ │ │     bool priv () const;
    │ │ │ │     void set_priv (bool p);
    │ │ │ │     bool is_v1_only () const;
    │ │ │ │     bool is_v2_only () const;
    │ │ │ │ @@ -12901,17 +12901,17 @@
    │ │ │ │     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.

    │ │ │ │

    The flags arguments specifies options for the torrent creation. It can │ │ │ │ be any combination of the flags defined by create_flags_t.

    │ │ │ │

    The file_storage (fs) parameter defines the files, sizes and │ │ │ │ @@ -12925,21 +12925,21 @@ │ │ │ │ have any affect. Instead of using this overload, consider using │ │ │ │ write_torrent_file() instead.

    │ │ │ │
    │ │ │ │

    Warning

    │ │ │ │

    The file_storage and torrent_info objects must stay alive for the │ │ │ │ entire duration of the create_torrent object.

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

    generate() generate_buf()

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

    generate_buf() generate()

    │ │ │ │
    │ │ │ │ -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 │ │ │ │ @@ -13022,21 +13022,21 @@ │ │ │ │ 16 kiB blocks. Note that piece sizes must be powers-of-2, so all │ │ │ │ per-piece merkle trees are complete. │ │ │ │ A SHA-256 hash of all zeros is internally used to indicate a hash │ │ │ │ that has not been set. Setting such hash will not be considered set │ │ │ │ when calling generate(). │ │ │ │ This function will throw std::system_error if it is called on an │ │ │ │ object constructed with the v1_only flag.

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

    add_url_seed() add_http_seed()

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

    add_http_seed() add_url_seed()

    │ │ │ │
    │ │ │ │ -void add_http_seed (string_view url);
    │ │ │ │  void add_url_seed (string_view url);
    │ │ │ │ +void add_http_seed (string_view url);
    │ │ │ │  
    │ │ │ │

    This adds a url seed to the torrent. You can have any number of url seeds. For a │ │ │ │ single file torrent, this should be an HTTP url, pointing to a file with identical │ │ │ │ content as the file of the torrent. For a multi-file torrent, it should point to │ │ │ │ a directory containing a directory with the same name as this torrent, and all the │ │ │ │ files of the torrent in it.

    │ │ │ │

    The second function, add_http_seed() adds an HTTP seed instead.

    │ │ │ │ @@ -13232,29 +13232,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"

    │ │ │ │
    │ │ │ │ -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);
    │ │ │ │  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);
    │ │ │ │ -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
    │ │ │ │     , settings_interface const& settings
    │ │ │ │     , std::function<void(piece_index_t)> const& f);
    │ │ │ │  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);
    │ │ │ │ +inline void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │ │ +   , std::function<void(piece_index_t)> const& f);
    │ │ │ │ +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);
    │ │ │ │ +void set_piece_hashes (create_torrent& t, std::string const& p
    │ │ │ │ +   , std::function<void(piece_index_t)> const& f, 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);
    │ │ │ │ @@ -13269,24 +13269,24 @@
    │ │ │ │  

    Declared in "libtorrent/bitfield.hpp"

    │ │ │ │

    The bitfield type stores any number of bits as a bitfield │ │ │ │ in a heap allocated array.

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

    bitfield()

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

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

    │ │ │ │

    The constructor taking a pointer b and bits copies a bitfield │ │ │ │ from the specified buffer, and bits number of bits (rounded up to │ │ │ │ @@ -13317,30 +13317,30 @@ │ │ │ │

    │ │ │ │

    assign()

    │ │ │ │
    │ │ │ │  void assign (char const* b, int const bits);
    │ │ │ │  
    │ │ │ │

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

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

    operator[]() get_bit()

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

    get_bit() operator[]()

    │ │ │ │
    │ │ │ │  bool get_bit (int index) const noexcept;
    │ │ │ │  bool operator[] (int index) const noexcept;
    │ │ │ │  
    │ │ │ │

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

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

    clear_bit() set_bit()

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

    set_bit() clear_bit()

    │ │ │ │
    │ │ │ │ -void clear_bit (int index) noexcept;
    │ │ │ │  void set_bit (int index) noexcept;
    │ │ │ │ +void clear_bit (int index) noexcept;
    │ │ │ │  
    │ │ │ │

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

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

    all_set()

    │ │ │ │
    │ │ │ │  bool all_set () const noexcept;
    │ │ │ │ @@ -13430,41 +13430,41 @@
    │ │ │ │  

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

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

    operator=() hasher()

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

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

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

    update()

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

    append the following bytes to what is being hashed

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

    final()

    │ │ │ │
    │ │ │ │  sha1_hash final ();
    │ │ │ │ @@ -13484,42 +13484,42 @@
    │ │ │ │  
    │ │ │ │

    hasher256

    │ │ │ │

    Declared in "libtorrent/hasher.hpp"

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

    operator=() hasher256()

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

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

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

    update()

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

    append the following bytes to what is being hashed

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

    final()

    │ │ │ │
    │ │ │ │  sha256_hash final ();
    │ │ │ │ @@ -14203,19 +14203,19 @@
    │ │ │ │  

    announce_entry

    │ │ │ │

    Declared in "libtorrent/announce_entry.hpp"

    │ │ │ │

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

    │ │ │ │
    │ │ │ │  struct announce_entry
    │ │ │ │  {
    │ │ │ │ -   ~announce_entry ();
    │ │ │ │ -   announce_entry (announce_entry const&);
    │ │ │ │ +   announce_entry& operator= (announce_entry const&) &;
    │ │ │ │     announce_entry ();
    │ │ │ │ +   announce_entry (announce_entry const&);
    │ │ │ │     explicit announce_entry (string_view u);
    │ │ │ │ -   announce_entry& operator= (announce_entry const&) &;
    │ │ │ │ +   ~announce_entry ();
    │ │ │ │  
    │ │ │ │     enum tracker_source
    │ │ │ │     {
    │ │ │ │        source_torrent,
    │ │ │ │        source_client,
    │ │ │ │        source_magnet_link,
    │ │ │ │        source_tex,
    │ │ │ │ @@ -14231,19 +14231,19 @@
    │ │ │ │  };
    │ │ │ │  
    │ │ │ │ │ │ │ │ │ │ │ │ [report issue]
    │ │ │ │

    operator=() announce_entry() ~announce_entry()

    │ │ │ │
    │ │ │ │ -~announce_entry ();
    │ │ │ │ -announce_entry (announce_entry const&);
    │ │ │ │ +announce_entry& operator= (announce_entry const&) &;
    │ │ │ │  announce_entry ();
    │ │ │ │ +announce_entry (announce_entry const&);
    │ │ │ │  explicit announce_entry (string_view u);
    │ │ │ │ -announce_entry& operator= (announce_entry const&) &;
    │ │ │ │ +~announce_entry ();
    │ │ │ │  
    │ │ │ │

    constructs a tracker announce entry with u as the URL.

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

    enum tracker_source

    │ │ │ │

    Declared in "libtorrent/announce_entry.hpp"

    │ │ │ │
    │ │ │ │ @@ -18770,24 +18770,24 @@ │ │ │ │ operations. This file size limit is specified in 16 kiB blocks.

    │ │ │ │
    │ │ │ │  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_int (int name, flags::bitfield_flag<Type, Tag> const val);
    │ │ │ │ -   void set_int (int name, int val) override;
    │ │ │ │ +   void set_str (int name, std::string val) override;
    │ │ │ │     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);
    │ │ │ │ +   int get_int (int name) const override;
    │ │ │ │     std::string const& get_str (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,
    │ │ │ │ @@ -18858,23 +18858,23 @@
    │ │ │ │        socks5_pw,
    │ │ │ │        http,
    │ │ │ │        http_pw,
    │ │ │ │        i2p_proxy,
    │ │ │ │     };
    │ │ │ │  };
    │ │ │ │  
    │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ -[report issue]
    │ │ │ │ -

    set_bool() set_int() set_str()

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

    set_str() set_int() set_bool()

    │ │ │ │
    │ │ │ │ -void set_str (int name, std::string val) override;
    │ │ │ │  void set_int (int name, flags::bitfield_flag<Type, Tag> const val);
    │ │ │ │ -void set_int (int name, int val) override;
    │ │ │ │ +void set_str (int name, std::string val) override;
    │ │ │ │  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]
    │ │ │ │
    │ │ │ │

    has_val()

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

    clear()

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

    clear a specific setting from the pack

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

    get_int() get_str() get_bool()

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

    get_bool() get_int() get_str()

    │ │ │ │
    │ │ │ │ +int get_int (int name) const override;
    │ │ │ │  std::string const& get_str (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]
    │ │ │ │ @@ -19331,18 +19331,18 @@ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │
    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()

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

    high_performance_seed() min_memory_usage()

    │ │ │ │

    Declared in "libtorrent/session.hpp"

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

    The default values of the session settings are set for a regular │ │ │ │ bittorrent client running on a desktop system. There are functions that │ │ │ │ @@ -19391,45 +19391,45 @@ │ │ │ │ to be able to copy it as a reference for instance). For that, use the │ │ │ │ non_owning() member function.

    │ │ │ │

    There are 5 different types of nodes, see type_t.

    │ │ │ │
    │ │ │ │  struct bdecode_node
    │ │ │ │  {
    │ │ │ │     bdecode_node () = default;
    │ │ │ │ -   bdecode_node (bdecode_node const&);
    │ │ │ │     bdecode_node& operator= (bdecode_node&&) & = default;
    │ │ │ │ -   bdecode_node& operator= (bdecode_node const&) &;
    │ │ │ │     bdecode_node (bdecode_node&&) noexcept;
    │ │ │ │ +   bdecode_node& operator= (bdecode_node const&) &;
    │ │ │ │ +   bdecode_node (bdecode_node const&);
    │ │ │ │     type_t type () const noexcept;
    │ │ │ │     explicit operator bool () const noexcept;
    │ │ │ │     bdecode_node non_owning () const;
    │ │ │ │ -   span<char const> data_section () const noexcept;
    │ │ │ │     std::ptrdiff_t data_offset () const noexcept;
    │ │ │ │ +   span<char const> data_section () const noexcept;
    │ │ │ │     std::int64_t list_int_value_at (int i
    │ │ │ │        , std::int64_t default_val = 0) const;
    │ │ │ │ +   bdecode_node list_at (int i) const;
    │ │ │ │     int list_size () const;
    │ │ │ │     string_view list_string_value_at (int i
    │ │ │ │        , string_view default_val = string_view()) const;
    │ │ │ │ -   bdecode_node list_at (int i) const;
    │ │ │ │ +   std::pair<string_view, bdecode_node> dict_at (int i) const;
    │ │ │ │ +   bdecode_node dict_find_int (string_view key) const;
    │ │ │ │     bdecode_node dict_find_list (string_view key) const;
    │ │ │ │ +   std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;
    │ │ │ │ +   bdecode_node dict_find (string_view key) const;
    │ │ │ │     string_view dict_find_string_value (string_view key
    │ │ │ │        , string_view default_value = string_view()) const;
    │ │ │ │ -   bdecode_node dict_find_int (string_view key) const;
    │ │ │ │ -   std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;
    │ │ │ │     std::int64_t dict_find_int_value (string_view key
    │ │ │ │        , std::int64_t default_val = 0) const;
    │ │ │ │ -   bdecode_node dict_find (string_view key) const;
    │ │ │ │ +   int dict_size () const;
    │ │ │ │     bdecode_node dict_find_dict (string_view key) const;
    │ │ │ │     bdecode_node dict_find_string (string_view key) const;
    │ │ │ │ -   int dict_size () const;
    │ │ │ │ -   std::pair<string_view, bdecode_node> dict_at (int i) const;
    │ │ │ │     std::int64_t int_value () const;
    │ │ │ │ -   string_view string_value () const;
    │ │ │ │     std::ptrdiff_t string_offset () const;
    │ │ │ │     int string_length () const;
    │ │ │ │ +   string_view string_value () const;
    │ │ │ │     char const* string_ptr () const;
    │ │ │ │     void clear ();
    │ │ │ │     void swap (bdecode_node& n);
    │ │ │ │     void reserve (int tokens);
    │ │ │ │     void switch_underlying_buffer (char const* buf) noexcept;
    │ │ │ │     bool has_soft_error (span<char> error) const;
    │ │ │ │  
    │ │ │ │ @@ -19450,18 +19450,18 @@
    │ │ │ │  
    │ │ │ │

    creates a default constructed node, it will have the type none_t.

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

    bdecode_node() operator=()

    │ │ │ │
    │ │ │ │ -bdecode_node (bdecode_node const&);
    │ │ │ │  bdecode_node& operator= (bdecode_node&&) & = default;
    │ │ │ │ -bdecode_node& operator= (bdecode_node const&) &;
    │ │ │ │  bdecode_node (bdecode_node&&) noexcept;
    │ │ │ │ +bdecode_node& operator= (bdecode_node const&) &;
    │ │ │ │ +bdecode_node (bdecode_node const&);
    │ │ │ │  
    │ │ │ │

    For owning nodes, the copy will create a copy of the tree, but the │ │ │ │ underlying buffer remains the same.

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

    type()

    │ │ │ │
    │ │ │ │ @@ -19484,66 +19484,66 @@
    │ │ │ │  

    return a non-owning reference to this node. This is useful to refer to │ │ │ │ the root node without copying it in assignments.

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

    data_section() data_offset()

    │ │ │ │
    │ │ │ │ -span<char const> data_section () const noexcept;
    │ │ │ │  std::ptrdiff_t data_offset () const noexcept;
    │ │ │ │ +span<char const> data_section () const noexcept;
    │ │ │ │  
    │ │ │ │

    returns the buffer and length of the section in the original bencoded │ │ │ │ buffer where this node is defined. For a dictionary for instance, this │ │ │ │ starts with d and ends with e, and has all the content of the │ │ │ │ dictionary in between. │ │ │ │ the data_offset() function returns the byte-offset to this node in, │ │ │ │ starting from the beginning of the buffer that was parsed.

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

    list_at() list_int_value_at() list_size() list_string_value_at()

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

    list_at() list_string_value_at() list_int_value_at() list_size()

    │ │ │ │
    │ │ │ │  std::int64_t list_int_value_at (int i
    │ │ │ │        , std::int64_t default_val = 0) const;
    │ │ │ │ +bdecode_node list_at (int i) const;
    │ │ │ │  int list_size () const;
    │ │ │ │  string_view list_string_value_at (int i
    │ │ │ │        , string_view default_val = string_view()) const;
    │ │ │ │ -bdecode_node list_at (int i) const;
    │ │ │ │  
    │ │ │ │

    functions with the list_ prefix operate on lists. These functions are │ │ │ │ only valid if type() == list_t. list_at() returns the item │ │ │ │ in the list at index i. i may not be greater than or equal to the │ │ │ │ size of the list. size() returns the size of the list.

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

    dict_find_int_value() dict_find() dict_size() dict_find_string() dict_find_int() dict_at() dict_find_list() dict_find_string_value() dict_find_dict() dict_at_node()

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

    dict_find() dict_at_node() dict_find_int_value() dict_find_string_value() dict_at() dict_find_string() dict_size() dict_find_list() dict_find_int() dict_find_dict()

    │ │ │ │
    │ │ │ │ +std::pair<string_view, bdecode_node> dict_at (int i) const;
    │ │ │ │ +bdecode_node dict_find_int (string_view key) const;
    │ │ │ │  bdecode_node dict_find_list (string_view key) const;
    │ │ │ │ +std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;
    │ │ │ │ +bdecode_node dict_find (string_view key) const;
    │ │ │ │  string_view dict_find_string_value (string_view key
    │ │ │ │        , string_view default_value = string_view()) const;
    │ │ │ │ -bdecode_node dict_find_int (string_view key) const;
    │ │ │ │ -std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;
    │ │ │ │  std::int64_t dict_find_int_value (string_view key
    │ │ │ │        , std::int64_t default_val = 0) const;
    │ │ │ │ -bdecode_node dict_find (string_view key) const;
    │ │ │ │ +int dict_size () const;
    │ │ │ │  bdecode_node dict_find_dict (string_view key) const;
    │ │ │ │  bdecode_node dict_find_string (string_view key) const;
    │ │ │ │ -int dict_size () const;
    │ │ │ │ -std::pair<string_view, bdecode_node> dict_at (int i) const;
    │ │ │ │  
    │ │ │ │

    Functions with the dict_ prefix operates on dictionaries. They are │ │ │ │ only valid if type() == dict_t. In case a key you're looking up │ │ │ │ contains a 0 byte, you cannot use the 0-terminated string overloads, │ │ │ │ but have to use string_view instead. dict_find_list will return a │ │ │ │ valid bdecode_node if the key is found _and_ it is a list. Otherwise │ │ │ │ it will return a default-constructed bdecode_node.

    │ │ │ │ @@ -19558,24 +19558,24 @@ │ │ │ │
    │ │ │ │

    int_value()

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

    this function is only valid if type() == int_t. It returns the │ │ │ │ value of the integer.

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

    string_length() string_ptr() string_offset() string_value()

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

    string_ptr() string_offset() string_length() string_value()

    │ │ │ │
    │ │ │ │ -string_view string_value () const;
    │ │ │ │  std::ptrdiff_t string_offset () const;
    │ │ │ │  int string_length () const;
    │ │ │ │ +string_view string_value () const;
    │ │ │ │  char const* string_ptr () const;
    │ │ │ │  
    │ │ │ │

    these functions are only valid if type() == string_t. They return │ │ │ │ the string values. Note that string_ptr() is not 0-terminated. │ │ │ │ string_length() returns the number of bytes in the string. │ │ │ │ string_offset() returns the byte offset from the start of the parsed │ │ │ │ bencoded buffer this string can be found.

    │ │ │ │ @@ -20014,22 +20014,22 @@ │ │ │ │
    Specify the port number for the SSL listen socket in the DHT announce.
    │ │ │ │ │ │ │ │ [report issue]
    │ │ │ │
    │ │ │ │

    read_resume_data()

    │ │ │ │

    Declared in "libtorrent/read_resume_data.hpp"

    │ │ │ │
    │ │ │ │ -add_torrent_params read_resume_data (span<char const> buffer
    │ │ │ │ -   , 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
    │ │ │ │ -   , error_code& ec, load_torrent_limits const& cfg = {});
    │ │ │ │ +   , 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 = {});
    │ │ │ │  
    │ │ │ │

    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 │ │ │ │ the actual torrent_info object to and pass to session::add_torrent() or │ │ │ │ session::async_add_torrent().

    │ │ │ │

    If the client wants to override any field that was loaded from the resume │ │ │ │ data, e.g. save_path, those fields must be changed after loading resume │ │ │ │ @@ -20037,35 +20037,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);
    │ │ │ │  
    │ │ │ │

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

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

    write_torrent_file_buf() write_torrent_file()

    │ │ │ │

    Declared in "libtorrent/write_resume_data.hpp"

    │ │ │ │
    │ │ │ │ +entry write_torrent_file (add_torrent_params const& atp, write_torrent_flags_t flags);
    │ │ │ │  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 {} │ │ │ │ │ @@ -27,108 +27,108 @@ │ │ │ │ │ * enum_socks_error_code │ │ │ │ │ * enum_pcp_errors │ │ │ │ │ * enum_error_code_enum │ │ │ │ │ * session_params │ │ │ │ │ o session_params() │ │ │ │ │ o session_params() │ │ │ │ │ * session_proxy │ │ │ │ │ - o ~session_proxy()_operator=()_session_proxy() │ │ │ │ │ + o operator=()_session_proxy()_~session_proxy() │ │ │ │ │ * session │ │ │ │ │ o session() │ │ │ │ │ o session() │ │ │ │ │ o ~session() │ │ │ │ │ o abort() │ │ │ │ │ * session_handle │ │ │ │ │ o is_valid() │ │ │ │ │ o session_state() │ │ │ │ │ - o refresh_torrent_status()_get_torrent_status() │ │ │ │ │ + o get_torrent_status()_refresh_torrent_status() │ │ │ │ │ o post_torrent_updates() │ │ │ │ │ o post_session_stats() │ │ │ │ │ o post_dht_stats() │ │ │ │ │ o set_dht_state() │ │ │ │ │ - o find_torrent()_get_torrents() │ │ │ │ │ - o async_add_torrent()_add_torrent() │ │ │ │ │ - o resume()_is_paused()_pause() │ │ │ │ │ + o get_torrents()_find_torrent() │ │ │ │ │ + o add_torrent()_async_add_torrent() │ │ │ │ │ + o resume()_pause()_is_paused() │ │ │ │ │ o is_dht_running() │ │ │ │ │ o set_dht_storage() │ │ │ │ │ o add_dht_node() │ │ │ │ │ o dht_get_item() │ │ │ │ │ o dht_get_item() │ │ │ │ │ o dht_put_item() │ │ │ │ │ o dht_put_item() │ │ │ │ │ - o dht_announce()_dht_get_peers() │ │ │ │ │ + o dht_get_peers()_dht_announce() │ │ │ │ │ o dht_live_nodes() │ │ │ │ │ o dht_sample_infohashes() │ │ │ │ │ o dht_direct_request() │ │ │ │ │ o add_extension() │ │ │ │ │ o set_ip_filter()_get_ip_filter() │ │ │ │ │ o set_port_filter() │ │ │ │ │ - o listen_port()_ssl_listen_port()_is_listening() │ │ │ │ │ - o get_peer_class_filter()_set_peer_class_filter() │ │ │ │ │ + o is_listening()_listen_port()_ssl_listen_port() │ │ │ │ │ + o set_peer_class_filter()_get_peer_class_filter() │ │ │ │ │ o get_peer_class_type_filter()_set_peer_class_type_filter() │ │ │ │ │ o create_peer_class() │ │ │ │ │ o delete_peer_class() │ │ │ │ │ - o set_peer_class()_get_peer_class() │ │ │ │ │ + o get_peer_class()_set_peer_class() │ │ │ │ │ o remove_torrent() │ │ │ │ │ o apply_settings()_get_settings() │ │ │ │ │ - o set_alert_notify()_wait_for_alert()_pop_alerts() │ │ │ │ │ - o delete_port_mapping()_add_port_mapping() │ │ │ │ │ + o pop_alerts()_set_alert_notify()_wait_for_alert() │ │ │ │ │ + o add_port_mapping()_delete_port_mapping() │ │ │ │ │ o reopen_network_sockets() │ │ │ │ │ o native_handle() │ │ │ │ │ - * write_session_params()_read_session_params()_write_session_params_buf() │ │ │ │ │ + * read_session_params()_write_session_params_buf()_write_session_params() │ │ │ │ │ * web_seed_entry │ │ │ │ │ o operator==() │ │ │ │ │ o operator<() │ │ │ │ │ o enum_type_t │ │ │ │ │ * load_torrent_limits │ │ │ │ │ * torrent_info │ │ │ │ │ o torrent_info() │ │ │ │ │ o ~torrent_info() │ │ │ │ │ - o files()_orig_files() │ │ │ │ │ + o orig_files()_files() │ │ │ │ │ o rename_file() │ │ │ │ │ o remap_files() │ │ │ │ │ - o trackers()_add_tracker()_clear_trackers() │ │ │ │ │ - o collections()_similar_torrents() │ │ │ │ │ - o set_web_seeds()_add_url_seed()_web_seeds()_add_http_seed() │ │ │ │ │ + o trackers()_clear_trackers()_add_tracker() │ │ │ │ │ + o similar_torrents()_collections() │ │ │ │ │ + o set_web_seeds()_web_seeds()_add_http_seed()_add_url_seed() │ │ │ │ │ o total_size() │ │ │ │ │ o piece_length()_num_pieces() │ │ │ │ │ - o end_piece()_piece_range()_last_piece() │ │ │ │ │ + o last_piece()_end_piece()_piece_range() │ │ │ │ │ o info_hashes()_info_hash() │ │ │ │ │ - o v2()_v1() │ │ │ │ │ + o v1()_v2() │ │ │ │ │ o num_files() │ │ │ │ │ o map_block() │ │ │ │ │ o map_file() │ │ │ │ │ o ssl_cert() │ │ │ │ │ o is_valid() │ │ │ │ │ o priv() │ │ │ │ │ o is_i2p() │ │ │ │ │ o piece_size() │ │ │ │ │ - o hash_for_piece()_hash_for_piece_ptr() │ │ │ │ │ + o hash_for_piece_ptr()_hash_for_piece() │ │ │ │ │ o name() │ │ │ │ │ o creation_date() │ │ │ │ │ o creator() │ │ │ │ │ o comment() │ │ │ │ │ o nodes() │ │ │ │ │ o add_node() │ │ │ │ │ o parse_info_section() │ │ │ │ │ o info() │ │ │ │ │ o info_section() │ │ │ │ │ o piece_layer() │ │ │ │ │ o free_piece_layers() │ │ │ │ │ * peer_info │ │ │ │ │ * info_hash_t │ │ │ │ │ o info_hash_t() │ │ │ │ │ - o has_v1()_has()_has_v2() │ │ │ │ │ + o has_v1()_has_v2()_has() │ │ │ │ │ o get() │ │ │ │ │ o get_best() │ │ │ │ │ o for_each() │ │ │ │ │ * piece_block │ │ │ │ │ * peer_request │ │ │ │ │ o operator==() │ │ │ │ │ - * load_torrent_parsed()_load_torrent_file()_load_torrent_buffer() │ │ │ │ │ + * load_torrent_file()_load_torrent_parsed()_load_torrent_buffer() │ │ │ │ │ * make_magnet_uri() │ │ │ │ │ * parse_magnet_uri() │ │ │ │ │ * truncate_files() │ │ │ │ │ * version() │ │ │ │ │ * enum_socket_type_t │ │ │ │ │ * enum_protocol_version │ │ │ │ │ * enum_portmap_transport │ │ │ │ │ @@ -155,31 +155,31 @@ │ │ │ │ │ o on_tick() │ │ │ │ │ o get_unchoke_priority() │ │ │ │ │ o load_state() │ │ │ │ │ * torrent_plugin │ │ │ │ │ o new_connection() │ │ │ │ │ o on_piece_pass()_on_piece_failed() │ │ │ │ │ o tick() │ │ │ │ │ - o on_pause()_on_resume() │ │ │ │ │ + o on_resume()_on_pause() │ │ │ │ │ o on_files_checked() │ │ │ │ │ o on_state() │ │ │ │ │ o on_add_peer() │ │ │ │ │ * peer_plugin │ │ │ │ │ o type() │ │ │ │ │ o add_handshake() │ │ │ │ │ o on_disconnect() │ │ │ │ │ o on_connected() │ │ │ │ │ o on_handshake() │ │ │ │ │ o on_extension_handshake() │ │ │ │ │ - o on_have()_on_unchoke()_on_dont_have()_on_request()_on_have_none() │ │ │ │ │ - on_have_all()_on_allowed_fast()_on_choke()_on_interested() │ │ │ │ │ - on_not_interested()_on_bitfield() │ │ │ │ │ + o on_have_none()_on_allowed_fast()_on_dont_have()_on_have_all() │ │ │ │ │ + on_not_interested()_on_unchoke()_on_interested()_on_choke()_on_have │ │ │ │ │ + ()_on_request()_on_bitfield() │ │ │ │ │ o on_piece() │ │ │ │ │ - o sent_interested()_sent_unchoke()_sent_have()_sent_not_interested() │ │ │ │ │ - sent_piece() │ │ │ │ │ + o sent_not_interested()_sent_unchoke()_sent_piece()_sent_interested() │ │ │ │ │ + sent_have() │ │ │ │ │ o sent_payload() │ │ │ │ │ o can_disconnect() │ │ │ │ │ o on_extended() │ │ │ │ │ o on_unknown_message() │ │ │ │ │ o on_piece_pass()_on_piece_failed() │ │ │ │ │ o tick() │ │ │ │ │ o write_request() │ │ │ │ │ @@ -190,123 +190,123 @@ │ │ │ │ │ * create_ut_pex_plugin() │ │ │ │ │ * create_smart_ban_plugin() │ │ │ │ │ * create_ut_metadata_plugin() │ │ │ │ │ * file_slice │ │ │ │ │ * file_storage │ │ │ │ │ o is_valid() │ │ │ │ │ o reserve() │ │ │ │ │ - o add_file()_add_file_borrow() │ │ │ │ │ + o add_file_borrow()_add_file() │ │ │ │ │ o rename_file() │ │ │ │ │ o map_block() │ │ │ │ │ o map_file() │ │ │ │ │ o num_files() │ │ │ │ │ o end_file() │ │ │ │ │ o file_range() │ │ │ │ │ o total_size() │ │ │ │ │ o set_num_pieces()_num_pieces() │ │ │ │ │ o end_piece() │ │ │ │ │ o last_piece() │ │ │ │ │ o piece_range() │ │ │ │ │ - o piece_length()_set_piece_length() │ │ │ │ │ + o set_piece_length()_piece_length() │ │ │ │ │ o piece_size() │ │ │ │ │ o piece_size2() │ │ │ │ │ o blocks_in_piece2() │ │ │ │ │ - o set_name()_name() │ │ │ │ │ + o name()_set_name() │ │ │ │ │ o swap() │ │ │ │ │ o canonicalize() │ │ │ │ │ - o file_name()_file_size()_root_ptr()_symlink()_pad_file_at()_root() │ │ │ │ │ - file_offset()_hash()_mtime()_file_path() │ │ │ │ │ - o file_num_pieces()_file_num_blocks()_file_piece_range() │ │ │ │ │ - o file_first_block_node()_file_first_piece_node() │ │ │ │ │ + o mtime()_file_name()_file_offset()_file_size()_file_path()_root() │ │ │ │ │ + symlink()_pad_file_at()_root_ptr()_hash() │ │ │ │ │ + o file_piece_range()_file_num_pieces()_file_num_blocks() │ │ │ │ │ + o file_first_piece_node()_file_first_block_node() │ │ │ │ │ o file_path_hash() │ │ │ │ │ o all_path_hashes() │ │ │ │ │ o file_flags() │ │ │ │ │ o file_absolute_path() │ │ │ │ │ - o file_index_at_offset()_file_index_at_piece() │ │ │ │ │ + o file_index_at_piece()_file_index_at_offset() │ │ │ │ │ o file_index_for_root() │ │ │ │ │ o piece_index_at_file() │ │ │ │ │ o sanitize_symlinks() │ │ │ │ │ o v2() │ │ │ │ │ * storage_params │ │ │ │ │ * disabled_disk_io_constructor() │ │ │ │ │ * mmap_disk_io_constructor() │ │ │ │ │ * posix_disk_io_constructor() │ │ │ │ │ * default_disk_io_constructor() │ │ │ │ │ * enum_storage_mode_t │ │ │ │ │ * enum_status_t │ │ │ │ │ * enum_move_flags_t │ │ │ │ │ * client_data_t │ │ │ │ │ o client_data_t() │ │ │ │ │ - o const*()_operator=()_void*() │ │ │ │ │ + o void*()_operator=()_const*() │ │ │ │ │ * add_torrent_params │ │ │ │ │ * peer_class_info │ │ │ │ │ * peer_class_type_filter │ │ │ │ │ - o remove()_add() │ │ │ │ │ + o add()_remove() │ │ │ │ │ o disallow()_allow() │ │ │ │ │ o apply() │ │ │ │ │ o enum_socket_type_t │ │ │ │ │ * block_info │ │ │ │ │ - o set_peer()_peer() │ │ │ │ │ + o peer()_set_peer() │ │ │ │ │ o enum_block_state_t │ │ │ │ │ * partial_piece_info │ │ │ │ │ * torrent_handle │ │ │ │ │ o torrent_handle() │ │ │ │ │ o add_piece() │ │ │ │ │ o read_piece() │ │ │ │ │ o have_piece() │ │ │ │ │ o get_peer_info() │ │ │ │ │ o status() │ │ │ │ │ o get_download_queue() │ │ │ │ │ - o clear_piece_deadlines()_reset_piece_deadline()_set_piece_deadline() │ │ │ │ │ + o set_piece_deadline()_clear_piece_deadlines()_reset_piece_deadline() │ │ │ │ │ o file_progress() │ │ │ │ │ o file_status() │ │ │ │ │ o clear_error() │ │ │ │ │ - o replace_trackers()_trackers()_add_tracker() │ │ │ │ │ - o url_seeds()_add_url_seed()_remove_url_seed() │ │ │ │ │ - o remove_http_seed()_http_seeds()_add_http_seed() │ │ │ │ │ + o trackers()_replace_trackers()_add_tracker() │ │ │ │ │ + o url_seeds()_remove_url_seed()_add_url_seed() │ │ │ │ │ + o http_seeds()_add_http_seed()_remove_http_seed() │ │ │ │ │ o add_extension() │ │ │ │ │ o set_metadata() │ │ │ │ │ o is_valid() │ │ │ │ │ o resume()_pause() │ │ │ │ │ o unset_flags()_set_flags()_flags() │ │ │ │ │ o flush_cache() │ │ │ │ │ o force_recheck() │ │ │ │ │ o save_resume_data() │ │ │ │ │ o need_save_resume_data() │ │ │ │ │ - o queue_position_up()_queue_position_down()_queue_position_top() │ │ │ │ │ - queue_position_bottom()_queue_position() │ │ │ │ │ + o queue_position()_queue_position_up()_queue_position_bottom() │ │ │ │ │ + queue_position_down()_queue_position_top() │ │ │ │ │ o queue_position_set() │ │ │ │ │ - o set_ssl_certificate_buffer()_set_ssl_certificate() │ │ │ │ │ - o torrent_file()_torrent_file_with_hashes() │ │ │ │ │ + o set_ssl_certificate()_set_ssl_certificate_buffer() │ │ │ │ │ + o torrent_file_with_hashes()_torrent_file() │ │ │ │ │ o piece_layers() │ │ │ │ │ o piece_availability() │ │ │ │ │ o piece_priority()_prioritize_pieces()_get_piece_priorities() │ │ │ │ │ o get_file_priorities()_prioritize_files()_file_priority() │ │ │ │ │ - o force_dht_announce()_force_lsd_announce()_force_reannounce() │ │ │ │ │ + o force_lsd_announce()_force_reannounce()_force_dht_announce() │ │ │ │ │ o scrape_tracker() │ │ │ │ │ o upload_limit()_set_download_limit()_set_upload_limit() │ │ │ │ │ download_limit() │ │ │ │ │ o connect_peer() │ │ │ │ │ o clear_peers() │ │ │ │ │ o set_max_uploads()_max_uploads() │ │ │ │ │ - o max_connections()_set_max_connections() │ │ │ │ │ + o set_max_connections()_max_connections() │ │ │ │ │ o move_storage() │ │ │ │ │ o rename_file() │ │ │ │ │ o info_hashes()_info_hash() │ │ │ │ │ - o operator<()_operator!=()_operator==() │ │ │ │ │ + o operator==()_operator!=()_operator<() │ │ │ │ │ o id() │ │ │ │ │ o native_handle() │ │ │ │ │ o userdata() │ │ │ │ │ o in_session() │ │ │ │ │ * hash_value() │ │ │ │ │ * open_file_state │ │ │ │ │ * disk_interface │ │ │ │ │ o new_torrent() │ │ │ │ │ o remove_torrent() │ │ │ │ │ - o async_write()_async_read() │ │ │ │ │ + o async_read()_async_write() │ │ │ │ │ o async_hash() │ │ │ │ │ o async_hash2() │ │ │ │ │ o async_move_storage() │ │ │ │ │ o async_release_files() │ │ │ │ │ o async_check_files() │ │ │ │ │ o async_stop_torrent() │ │ │ │ │ o async_rename_file() │ │ │ │ │ @@ -345,15 +345,15 @@ │ │ │ │ │ * peer_alert │ │ │ │ │ * tracker_alert │ │ │ │ │ o tracker_url() │ │ │ │ │ * torrent_removed_alert │ │ │ │ │ * read_piece_alert │ │ │ │ │ * file_completed_alert │ │ │ │ │ * file_renamed_alert │ │ │ │ │ - o old_name()_new_name() │ │ │ │ │ + o new_name()_old_name() │ │ │ │ │ * file_rename_failed_alert │ │ │ │ │ * performance_alert │ │ │ │ │ o enum_performance_warning_t │ │ │ │ │ * state_changed_alert │ │ │ │ │ * tracker_error_alert │ │ │ │ │ o failure_reason() │ │ │ │ │ * tracker_warning_alert │ │ │ │ │ @@ -377,15 +377,15 @@ │ │ │ │ │ * piece_finished_alert │ │ │ │ │ * request_dropped_alert │ │ │ │ │ * block_timeout_alert │ │ │ │ │ * block_finished_alert │ │ │ │ │ * block_downloading_alert │ │ │ │ │ * unwanted_block_alert │ │ │ │ │ * storage_moved_alert │ │ │ │ │ - o old_path()_storage_path() │ │ │ │ │ + o storage_path()_old_path() │ │ │ │ │ * storage_moved_failed_alert │ │ │ │ │ o file_path() │ │ │ │ │ * torrent_deleted_alert │ │ │ │ │ * torrent_delete_failed_alert │ │ │ │ │ * save_resume_data_alert │ │ │ │ │ * save_resume_data_failed_alert │ │ │ │ │ * torrent_paused_alert │ │ │ │ │ @@ -450,33 +450,33 @@ │ │ │ │ │ o pkt_buf() │ │ │ │ │ o enum_direction_t │ │ │ │ │ * dht_get_peers_reply_alert │ │ │ │ │ * dht_direct_response_alert │ │ │ │ │ * picker_log_alert │ │ │ │ │ * session_error_alert │ │ │ │ │ * dht_live_nodes_alert │ │ │ │ │ - o num_nodes()_nodes() │ │ │ │ │ + o nodes()_num_nodes() │ │ │ │ │ * session_stats_header_alert │ │ │ │ │ * dht_sample_infohashes_alert │ │ │ │ │ - o num_samples()_samples() │ │ │ │ │ + o samples()_num_samples() │ │ │ │ │ o num_nodes() │ │ │ │ │ o nodes() │ │ │ │ │ * block_uploaded_alert │ │ │ │ │ * alerts_dropped_alert │ │ │ │ │ * socks5_alert │ │ │ │ │ * file_prio_alert │ │ │ │ │ * oversized_file_alert │ │ │ │ │ * torrent_conflict_alert │ │ │ │ │ * alert_cast() │ │ │ │ │ * operation_name() │ │ │ │ │ * enum_operation_t │ │ │ │ │ * alert_category_t │ │ │ │ │ * int │ │ │ │ │ * counters │ │ │ │ │ - o inc_stats_counter()_operator[]() │ │ │ │ │ + o operator[]()_inc_stats_counter() │ │ │ │ │ * stats_metric │ │ │ │ │ * session_stats_metrics() │ │ │ │ │ * find_metric_idx() │ │ │ │ │ * enum_metric_type_t │ │ │ │ │ * ip_filter │ │ │ │ │ o empty() │ │ │ │ │ o add_rule() │ │ │ │ │ @@ -489,32 +489,32 @@ │ │ │ │ │ o enum_access_flags │ │ │ │ │ * entry │ │ │ │ │ o type() │ │ │ │ │ o entry() │ │ │ │ │ o entry() │ │ │ │ │ o entry() │ │ │ │ │ o operator=() │ │ │ │ │ - o dict()_preformatted()_integer()_list()_string() │ │ │ │ │ + o integer()_string()_list()_preformatted()_dict() │ │ │ │ │ o swap() │ │ │ │ │ o operator[]() │ │ │ │ │ o find_key() │ │ │ │ │ o to_string() │ │ │ │ │ o enum_data_type │ │ │ │ │ * operator<<() │ │ │ │ │ * bencode() │ │ │ │ │ * create_torrent │ │ │ │ │ o create_torrent() │ │ │ │ │ - o generate()_generate_buf() │ │ │ │ │ + o generate_buf()_generate() │ │ │ │ │ o files() │ │ │ │ │ o set_comment() │ │ │ │ │ o set_creator() │ │ │ │ │ o set_creation_date() │ │ │ │ │ o set_hash() │ │ │ │ │ o set_hash2() │ │ │ │ │ - o add_url_seed()_add_http_seed() │ │ │ │ │ + o add_http_seed()_add_url_seed() │ │ │ │ │ o add_node() │ │ │ │ │ o add_tracker() │ │ │ │ │ o set_root_cert() │ │ │ │ │ o priv()_set_priv() │ │ │ │ │ o num_pieces() │ │ │ │ │ o piece_range() │ │ │ │ │ o file_range() │ │ │ │ │ @@ -523,16 +523,16 @@ │ │ │ │ │ o piece_size()_piece_length() │ │ │ │ │ o add_similar_torrent()_add_collection() │ │ │ │ │ * add_files() │ │ │ │ │ * set_piece_hashes() │ │ │ │ │ * bitfield │ │ │ │ │ o bitfield() │ │ │ │ │ o assign() │ │ │ │ │ - o operator[]()_get_bit() │ │ │ │ │ - o clear_bit()_set_bit() │ │ │ │ │ + o get_bit()_operator[]() │ │ │ │ │ + o set_bit()_clear_bit() │ │ │ │ │ o all_set() │ │ │ │ │ o none_set() │ │ │ │ │ o size() │ │ │ │ │ o num_words() │ │ │ │ │ o empty() │ │ │ │ │ o data() │ │ │ │ │ o swap() │ │ │ │ │ @@ -554,46 +554,46 @@ │ │ │ │ │ o enum_state_t │ │ │ │ │ * announce_infohash │ │ │ │ │ * announce_endpoint │ │ │ │ │ * announce_entry │ │ │ │ │ o operator=()_announce_entry()_~announce_entry() │ │ │ │ │ o enum_tracker_source │ │ │ │ │ * settings_pack │ │ │ │ │ - o set_bool()_set_int()_set_str() │ │ │ │ │ + o set_str()_set_int()_set_bool() │ │ │ │ │ o has_val() │ │ │ │ │ o clear() │ │ │ │ │ o clear() │ │ │ │ │ - o get_int()_get_str()_get_bool() │ │ │ │ │ + o get_bool()_get_int()_get_str() │ │ │ │ │ o enum_type_bases │ │ │ │ │ o enum_mmap_write_mode_t │ │ │ │ │ o enum_suggest_mode_t │ │ │ │ │ o enum_choking_algorithm_t │ │ │ │ │ o enum_seed_choking_algorithm_t │ │ │ │ │ o enum_io_buffer_mode_t │ │ │ │ │ o enum_bandwidth_mixed_algo_t │ │ │ │ │ o enum_enc_policy │ │ │ │ │ o enum_enc_level │ │ │ │ │ o enum_proxy_type_t │ │ │ │ │ * generate_fingerprint() │ │ │ │ │ - * min_memory_usage()_high_performance_seed() │ │ │ │ │ + * high_performance_seed()_min_memory_usage() │ │ │ │ │ * name_for_setting()_setting_by_name() │ │ │ │ │ * default_settings() │ │ │ │ │ * bdecode_node │ │ │ │ │ o bdecode_node() │ │ │ │ │ o bdecode_node()_operator=() │ │ │ │ │ o type() │ │ │ │ │ o bool() │ │ │ │ │ o non_owning() │ │ │ │ │ o data_section()_data_offset() │ │ │ │ │ - o list_at()_list_int_value_at()_list_size()_list_string_value_at() │ │ │ │ │ - o dict_find_int_value()_dict_find()_dict_size()_dict_find_string() │ │ │ │ │ - dict_find_int()_dict_at()_dict_find_list()_dict_find_string_value() │ │ │ │ │ - dict_find_dict()_dict_at_node() │ │ │ │ │ + o list_at()_list_string_value_at()_list_int_value_at()_list_size() │ │ │ │ │ + o dict_find()_dict_at_node()_dict_find_int_value() │ │ │ │ │ + dict_find_string_value()_dict_at()_dict_find_string()_dict_size() │ │ │ │ │ + dict_find_list()_dict_find_int()_dict_find_dict() │ │ │ │ │ o int_value() │ │ │ │ │ - o string_length()_string_ptr()_string_offset()_string_value() │ │ │ │ │ + o string_ptr()_string_offset()_string_length()_string_value() │ │ │ │ │ o clear() │ │ │ │ │ o swap() │ │ │ │ │ o reserve() │ │ │ │ │ o switch_underlying_buffer() │ │ │ │ │ o has_soft_error() │ │ │ │ │ o enum_type_t │ │ │ │ │ * print_entry() │ │ │ │ │ @@ -613,15 +613,15 @@ │ │ │ │ │ o get_infohashes_sample() │ │ │ │ │ o tick() │ │ │ │ │ o counters() │ │ │ │ │ * sign_mutable_item() │ │ │ │ │ * dht_default_storage_constructor() │ │ │ │ │ * announce_flags_t │ │ │ │ │ * read_resume_data() │ │ │ │ │ - * write_resume_data_buf()_write_resume_data() │ │ │ │ │ + * write_resume_data()_write_resume_data_buf() │ │ │ │ │ * write_torrent_file_buf()_write_torrent_file() │ │ │ │ │ * write_torrent_flags_t │ │ │ │ │ * ed25519_create_seed() │ │ │ │ │ * ed25519_create_keypair() │ │ │ │ │ * ed25519_sign() │ │ │ │ │ * ed25519_verify() │ │ │ │ │ * ed25519_add_scalar() │ │ │ │ │ @@ -1234,18 +1234,18 @@ │ │ │ │ │ The session_params is a parameters pack for configuring the session before it's │ │ │ │ │ started. │ │ │ │ │ struct session_params │ │ │ │ │ { │ │ │ │ │ session_params (settings_pack const& sp); │ │ │ │ │ session_params (settings_pack&& sp); │ │ │ │ │ session_params (); │ │ │ │ │ - session_params (settings_pack&& sp │ │ │ │ │ - , std::vector> exts); │ │ │ │ │ session_params (settings_pack const& sp │ │ │ │ │ , std::vector> exts); │ │ │ │ │ + session_params (settings_pack&& sp │ │ │ │ │ + , std::vector> exts); │ │ │ │ │ │ │ │ │ │ settings_pack settings; │ │ │ │ │ std::vector> extensions; │ │ │ │ │ dht::dht_state dht_state; │ │ │ │ │ dht::dht_storage_constructor_type dht_storage_constructor; │ │ │ │ │ disk_io_constructor_type disk_io_constructor; │ │ │ │ │ std::map ext_state; │ │ │ │ │ @@ -1257,18 +1257,18 @@ │ │ │ │ │ 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() ***** │ │ │ │ │ -session_params (settings_pack&& sp │ │ │ │ │ - , std::vector> exts); │ │ │ │ │ session_params (settings_pack const& sp │ │ │ │ │ , std::vector> exts); │ │ │ │ │ +session_params (settings_pack&& sp │ │ │ │ │ + , std::vector> exts); │ │ │ │ │ This constructor helps to configure the set of initial plugins to be added to │ │ │ │ │ the session before it's started. │ │ │ │ │ [report_issue] │ │ │ │ │ settings │ │ │ │ │ The settings to configure the session with │ │ │ │ │ [report_issue] │ │ │ │ │ extensions │ │ │ │ │ @@ -1300,28 +1300,28 @@ │ │ │ │ │ the completion of the shutdown. The lifetime of this object 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& operator= (session_proxy const&) &; │ │ │ │ │ - ~session_proxy (); │ │ │ │ │ - session_proxy& operator= (session_proxy&&) & noexcept; │ │ │ │ │ session_proxy (session_proxy&&) noexcept; │ │ │ │ │ + session_proxy& operator= (session_proxy&&) & noexcept; │ │ │ │ │ + ~session_proxy (); │ │ │ │ │ session_proxy (); │ │ │ │ │ + session_proxy& operator= (session_proxy const&) &; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** ~session_proxy() operator=() session_proxy() ***** │ │ │ │ │ +***** operator=() session_proxy() ~session_proxy() ***** │ │ │ │ │ session_proxy (session_proxy const&); │ │ │ │ │ -session_proxy& operator= (session_proxy const&) &; │ │ │ │ │ -~session_proxy (); │ │ │ │ │ -session_proxy& operator= (session_proxy&&) & noexcept; │ │ │ │ │ session_proxy (session_proxy&&) noexcept; │ │ │ │ │ +session_proxy& operator= (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 ****** │ │ │ │ │ Declared in "libtorrent/session.hpp" │ │ │ │ │ The session holds all state that spans multiple torrents. Among other things it │ │ │ │ │ runs the network loop and manages all torrents. Once it's created, the session │ │ │ │ │ object will spawn the main thread that will do all the work. The main thread │ │ │ │ │ @@ -1329,47 +1329,47 @@ │ │ │ │ │ You have some control over session configuration through the 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 (session_params&& params, session_flags_t flags); │ │ │ │ │ - session (session_params const& params, session_flags_t flags); │ │ │ │ │ explicit session (session_params&& params); │ │ │ │ │ explicit session (session_params const& params); │ │ │ │ │ - session (session_params const& 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 (session_params const& params, session_flags_t flags); │ │ │ │ │ + session (session_params&& params, session_flags_t flags); │ │ │ │ │ session (session_params&& params, io_context& ios); │ │ │ │ │ + session (session_params&& params, io_context& ios, session_flags_t); │ │ │ │ │ + session (session_params const& params, io_context& ios); │ │ │ │ │ + session (session_params const& params, io_context& ios, session_flags_t); │ │ │ │ │ ~session (); │ │ │ │ │ session_proxy abort (); │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** session() ***** │ │ │ │ │ -session (); │ │ │ │ │ -session (session_params&& params, session_flags_t flags); │ │ │ │ │ -session (session_params const& params, session_flags_t flags); │ │ │ │ │ explicit session (session_params&& params); │ │ │ │ │ explicit session (session_params const& params); │ │ │ │ │ +session (); │ │ │ │ │ +session (session_params const& params, session_flags_t flags); │ │ │ │ │ +session (session_params&& 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 const& 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&& params, io_context& ios); │ │ │ │ │ +session (session_params&& params, io_context& ios, session_flags_t); │ │ │ │ │ +session (session_params const& params, io_context& ios); │ │ │ │ │ +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. │ │ │ │ │ Warning │ │ │ │ │ The session object does not cleanly terminate with an external io_context. The │ │ │ │ │ @@ -1409,36 +1409,36 @@ │ │ │ │ │ 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; │ │ │ │ │ - void refresh_torrent_status (std::vector* ret │ │ │ │ │ - , status_flags_t flags = {}) const; │ │ │ │ │ std::vector get_torrent_status ( │ │ │ │ │ std::function const& pred │ │ │ │ │ , status_flags_t flags = {}) const; │ │ │ │ │ + void refresh_torrent_status (std::vector* ret │ │ │ │ │ + , status_flags_t flags = {}) const; │ │ │ │ │ void post_torrent_updates (status_flags_t flags = status_flags_t::all()); │ │ │ │ │ void post_session_stats (); │ │ │ │ │ void post_dht_stats (); │ │ │ │ │ void set_dht_state (dht::dht_state const& st); │ │ │ │ │ void set_dht_state (dht::dht_state&& st); │ │ │ │ │ - torrent_handle find_torrent (sha1_hash const& info_hash) const; │ │ │ │ │ std::vector get_torrents () const; │ │ │ │ │ + torrent_handle find_torrent (sha1_hash const& info_hash) const; │ │ │ │ │ + void async_add_torrent (add_torrent_params const& params); │ │ │ │ │ + torrent_handle add_torrent (add_torrent_params&& params, error_code& ec); │ │ │ │ │ + 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); │ │ │ │ │ - torrent_handle add_torrent (add_torrent_params&& params); │ │ │ │ │ - void async_add_torrent (add_torrent_params const& params); │ │ │ │ │ torrent_handle add_torrent (add_torrent_params const& params); │ │ │ │ │ - torrent_handle add_torrent (add_torrent_params&& params, error_code& ec); │ │ │ │ │ - bool is_paused () const; │ │ │ │ │ void pause (); │ │ │ │ │ void resume (); │ │ │ │ │ + bool is_paused () const; │ │ │ │ │ bool is_dht_running () const; │ │ │ │ │ void set_dht_storage (dht::dht_storage_constructor_type sc); │ │ │ │ │ void add_dht_node (std::pair const& node); │ │ │ │ │ void dht_get_item (sha1_hash const& target); │ │ │ │ │ void dht_get_item (std::array key │ │ │ │ │ , std::string salt = std::string()); │ │ │ │ │ sha1_hash dht_put_item (entry data); │ │ │ │ │ @@ -1450,41 +1450,41 @@ │ │ │ │ │ void dht_announce (sha1_hash const& info_hash, int port = 0, dht:: │ │ │ │ │ announce_flags_t flags = {}); │ │ │ │ │ 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 ext); │ │ │ │ │ void add_extension (std::function( │ │ │ │ │ torrent_handle const&, client_data_t)> ext); │ │ │ │ │ - void set_ip_filter (ip_filter f); │ │ │ │ │ + void add_extension (std::shared_ptr ext); │ │ │ │ │ ip_filter get_ip_filter () const; │ │ │ │ │ + void set_ip_filter (ip_filter f); │ │ │ │ │ void set_port_filter (port_filter const& f); │ │ │ │ │ unsigned short listen_port () const; │ │ │ │ │ unsigned short ssl_listen_port () const; │ │ │ │ │ bool is_listening () const; │ │ │ │ │ - void set_peer_class_filter (ip_filter const& f); │ │ │ │ │ ip_filter get_peer_class_filter () const; │ │ │ │ │ + void set_peer_class_filter (ip_filter const& f); │ │ │ │ │ peer_class_type_filter get_peer_class_type_filter () const; │ │ │ │ │ void set_peer_class_type_filter (peer_class_type_filter const& f); │ │ │ │ │ peer_class_t create_peer_class (char const* name); │ │ │ │ │ void delete_peer_class (peer_class_t cid); │ │ │ │ │ - peer_class_info get_peer_class (peer_class_t cid) const; │ │ │ │ │ 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&); │ │ │ │ │ + settings_pack get_settings () const; │ │ │ │ │ void set_alert_notify (std::function const& fun); │ │ │ │ │ alert* wait_for_alert (time_duration max_wait); │ │ │ │ │ void pop_alerts (std::vector* alerts); │ │ │ │ │ - void delete_port_mapping (port_mapping_t handle); │ │ │ │ │ std::vector 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 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; │ │ │ │ │ @@ -1510,20 +1510,20 @@ │ │ │ │ │ all()) const; │ │ │ │ │ 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] │ │ │ │ │ -***** refresh_torrent_status() get_torrent_status() ***** │ │ │ │ │ -void refresh_torrent_status (std::vector* ret │ │ │ │ │ - , status_flags_t flags = {}) const; │ │ │ │ │ +***** get_torrent_status() refresh_torrent_status() ***** │ │ │ │ │ std::vector get_torrent_status ( │ │ │ │ │ std::function const& pred │ │ │ │ │ , status_flags_t flags = {}) const; │ │ │ │ │ +void refresh_torrent_status (std::vector* ret │ │ │ │ │ + , status_flags_t flags = {}) const; │ │ │ │ │ Note │ │ │ │ │ these calls are potentially expensive and won't scale well with lots of │ │ │ │ │ torrents. If you're concerned about performance, consider using │ │ │ │ │ post_torrent_updates() instead. │ │ │ │ │ get_torrent_status returns a vector of the torrent_status for every torrent │ │ │ │ │ which satisfies pred, which is a predicate function which determines if a │ │ │ │ │ torrent should be included in the returned set or not. Returning true means it │ │ │ │ │ @@ -1574,31 +1574,31 @@ │ │ │ │ │ ***** set_dht_state() ***** │ │ │ │ │ void set_dht_state (dht::dht_state const& st); │ │ │ │ │ void set_dht_state (dht::dht_state&& 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() ***** │ │ │ │ │ -torrent_handle find_torrent (sha1_hash const& info_hash) const; │ │ │ │ │ +***** get_torrents() find_torrent() ***** │ │ │ │ │ std::vector 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 torrent_handle 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 session. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** async_add_torrent() add_torrent() ***** │ │ │ │ │ +***** add_torrent() async_add_torrent() ***** │ │ │ │ │ +void async_add_torrent (add_torrent_params const& params); │ │ │ │ │ +torrent_handle add_torrent (add_torrent_params&& params, error_code& ec); │ │ │ │ │ +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); │ │ │ │ │ -torrent_handle add_torrent (add_torrent_params&& params); │ │ │ │ │ -void async_add_torrent (add_torrent_params const& params); │ │ │ │ │ torrent_handle add_torrent (add_torrent_params const& params); │ │ │ │ │ -torrent_handle add_torrent (add_torrent_params&& params, error_code& ec); │ │ │ │ │ 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 the torrent being added is sent as add_torrent_alert. │ │ │ │ │ The overload that does not take an error_code throws an exception on error and │ │ │ │ │ @@ -1615,18 +1615,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 BitTorrent_v2_torrents. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** resume() is_paused() pause() ***** │ │ │ │ │ -bool is_paused () const; │ │ │ │ │ +***** resume() pause() is_paused() ***** │ │ │ │ │ void pause (); │ │ │ │ │ void resume (); │ │ │ │ │ +bool is_paused () const; │ │ │ │ │ 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. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** is_dht_running() ***** │ │ │ │ │ @@ -1702,15 +1702,15 @@ │ │ │ │ │ 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_announce() dht_get_peers() ***** │ │ │ │ │ +***** dht_get_peers() dht_announce() ***** │ │ │ │ │ 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 = {}); │ │ │ │ │ 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 │ │ │ │ │ @@ -1744,17 +1744,17 @@ │ │ │ │ │ Send an arbitrary DHT request directly to the specified endpoint. This function │ │ │ │ │ is intended for use by plugins. When a response is received or the request │ │ │ │ │ times out, a dht_direct_response_alert will be posted with the response (if │ │ │ │ │ any) and the userdata pointer passed in here. Since this alert is a response to │ │ │ │ │ an explicit call, it will always be posted, regardless of the alert mask. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** add_extension() ***** │ │ │ │ │ -void add_extension (std::shared_ptr ext); │ │ │ │ │ void add_extension (std::function( │ │ │ │ │ torrent_handle const&, client_data_t)> ext); │ │ │ │ │ +void add_extension (std::shared_ptr ext); │ │ │ │ │ This function adds an extension to this session. The argument is a function │ │ │ │ │ object that is called with a torrent_handle and which should return a std:: │ │ │ │ │ shared_ptr. To write custom plugins, see libtorrent_plugins. │ │ │ │ │ For the typical bittorrent client all of these extensions should be added. The │ │ │ │ │ main plugins implemented in libtorrent are: │ │ │ │ │ uTorrent metadata │ │ │ │ │ Allows peers to download the metadata (.torrent files) from the swarm │ │ │ │ │ @@ -1770,16 +1770,16 @@ │ │ │ │ │ A plugin 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); │ │ │ │ │ [report_issue] │ │ │ │ │ ***** set_ip_filter() get_ip_filter() ***** │ │ │ │ │ -void set_ip_filter (ip_filter f); │ │ │ │ │ ip_filter get_ip_filter () const; │ │ │ │ │ +void set_ip_filter (ip_filter f); │ │ │ │ │ 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 ip_filter currently in the session. See │ │ │ │ │ ip_filter. │ │ │ │ │ @@ -1787,27 +1787,27 @@ │ │ │ │ │ ***** set_port_filter() ***** │ │ │ │ │ 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] │ │ │ │ │ -***** listen_port() ssl_listen_port() is_listening() ***** │ │ │ │ │ +***** is_listening() listen_port() ssl_listen_port() ***** │ │ │ │ │ unsigned short listen_port () const; │ │ │ │ │ unsigned short ssl_listen_port () const; │ │ │ │ │ bool is_listening () 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] │ │ │ │ │ -***** get_peer_class_filter() set_peer_class_filter() ***** │ │ │ │ │ -void set_peer_class_filter (ip_filter const& f); │ │ │ │ │ +***** set_peer_class_filter() get_peer_class_filter() ***** │ │ │ │ │ ip_filter get_peer_class_filter () const; │ │ │ │ │ +void set_peer_class_filter (ip_filter const& f); │ │ │ │ │ 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. │ │ │ │ │ For more info, see ip_filter. │ │ │ │ │ @@ -1862,17 +1862,17 @@ │ │ │ │ │ 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 session object destructs. │ │ │ │ │ For more information on peer classes, see peer_classes. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** set_peer_class() get_peer_class() ***** │ │ │ │ │ -peer_class_info get_peer_class (peer_class_t cid) const; │ │ │ │ │ +***** get_peer_class() set_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 return value of │ │ │ │ │ get_peer_class() is undefined. │ │ │ │ │ set_peer_class() sets all the information in the peer_class_info object in the │ │ │ │ │ specified peer class. There is no option to only update a single property. │ │ │ │ │ A peer or torrent belonging to more than one class, the highest priority among │ │ │ │ │ @@ -1903,22 +1903,22 @@ │ │ │ │ │ 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. │ │ │ │ │ [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() ***** │ │ │ │ │ +***** pop_alerts() set_alert_notify() wait_for_alert() ***** │ │ │ │ │ void set_alert_notify (std::function const& fun); │ │ │ │ │ alert* wait_for_alert (time_duration max_wait); │ │ │ │ │ void pop_alerts (std::vector* alerts); │ │ │ │ │ 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. │ │ │ │ │ @@ -1960,18 +1960,18 @@ │ │ │ │ │ alerts should not be done in the callback. In fact, the callback should not │ │ │ │ │ block. It should not perform any expensive work. It really should just notify │ │ │ │ │ the main application thread. │ │ │ │ │ The type of an alert 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. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** delete_port_mapping() add_port_mapping() ***** │ │ │ │ │ -void delete_port_mapping (port_mapping_t handle); │ │ │ │ │ +***** add_port_mapping() delete_port_mapping() ***** │ │ │ │ │ std::vector 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] │ │ │ │ │ ***** reopen_network_sockets() ***** │ │ │ │ │ void reopen_network_sockets (reopen_network_flags_t options = │ │ │ │ │ @@ -2017,25 +2017,25 @@ │ │ │ │ │ protocols used by add_port_mapping() │ │ │ │ │ [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] │ │ │ │ │ -****** write_session_params() read_session_params() write_session_params_buf() │ │ │ │ │ +****** read_session_params() write_session_params_buf() write_session_params() │ │ │ │ │ ****** │ │ │ │ │ Declared in "libtorrent/session_params.hpp" │ │ │ │ │ session_params read_session_params (bdecode_node const& e │ │ │ │ │ , 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 write_session_params_buf (session_params const& sp │ │ │ │ │ , save_state_flags_t flags = save_state_flags_t::all()); │ │ │ │ │ session_params read_session_params (span 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()); │ │ │ │ │ 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 session's state. The _buf suffix indicates the function │ │ │ │ │ operates on buffer rather than the bencoded structure. The torrents in a │ │ │ │ │ session are not part of the session_params state, they have to be restored │ │ │ │ │ @@ -2117,56 +2117,56 @@ │ │ │ │ │ the max number of bdecode tokens │ │ │ │ │ [report_issue] │ │ │ │ │ ****** torrent_info ****** │ │ │ │ │ Declared in "libtorrent/torrent_info.hpp" │ │ │ │ │ the torrent_info class holds the information found in a .torrent file. │ │ │ │ │ class torrent_info │ │ │ │ │ { │ │ │ │ │ - explicit torrent_info (bdecode_node const& torrent_file); │ │ │ │ │ - torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& │ │ │ │ │ -cfg); │ │ │ │ │ - torrent_info (char const* buffer, int size); │ │ │ │ │ + torrent_info (std::string const& filename, error_code& ec); │ │ │ │ │ explicit torrent_info (span buffer, from_span_t); │ │ │ │ │ - torrent_info (span buffer, load_torrent_limits const& cfg, │ │ │ │ │ -from_span_t); │ │ │ │ │ + explicit torrent_info (bdecode_node const& torrent_file); │ │ │ │ │ torrent_info (char const* buffer, int size, error_code& ec); │ │ │ │ │ - explicit torrent_info (info_hash_t const& info_hash); │ │ │ │ │ + torrent_info (torrent_info const& t); │ │ │ │ │ torrent_info (span buffer, error_code& ec, from_span_t); │ │ │ │ │ + explicit torrent_info (info_hash_t const& info_hash); │ │ │ │ │ torrent_info (std::string const& filename, load_torrent_limits const& cfg); │ │ │ │ │ + torrent_info (char const* buffer, int size); │ │ │ │ │ explicit torrent_info (std::string const& filename); │ │ │ │ │ - torrent_info (torrent_info const& t); │ │ │ │ │ - torrent_info (std::string const& filename, error_code& ec); │ │ │ │ │ torrent_info (bdecode_node const& torrent_file, error_code& ec); │ │ │ │ │ + torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& │ │ │ │ │ +cfg); │ │ │ │ │ + torrent_info (span buffer, load_torrent_limits const& cfg, │ │ │ │ │ +from_span_t); │ │ │ │ │ ~torrent_info (); │ │ │ │ │ file_storage const& files () const; │ │ │ │ │ file_storage const& orig_files () const; │ │ │ │ │ void rename_file (file_index_t index, std::string const& new_filename); │ │ │ │ │ void remap_files (file_storage const& f); │ │ │ │ │ + void clear_trackers (); │ │ │ │ │ + void add_tracker (std::string const& url, int tier = 0); │ │ │ │ │ void add_tracker (std::string const& url, int tier │ │ │ │ │ , announce_entry::tracker_source source); │ │ │ │ │ - void clear_trackers (); │ │ │ │ │ std::vector const& trackers () const; │ │ │ │ │ - void add_tracker (std::string const& url, int tier = 0); │ │ │ │ │ - std::vector similar_torrents () const; │ │ │ │ │ std::vector collections () const; │ │ │ │ │ + std::vector similar_torrents () const; │ │ │ │ │ std::vector const& web_seeds () const; │ │ │ │ │ + void set_web_seeds (std::vector seeds); │ │ │ │ │ void add_url_seed (std::string const& url │ │ │ │ │ , std::string const& ext_auth = std::string() │ │ │ │ │ , web_seed_entry::headers_t const& ext_headers = web_seed_entry:: │ │ │ │ │ headers_t()); │ │ │ │ │ - void set_web_seeds (std::vector seeds); │ │ │ │ │ void add_http_seed (std::string const& url │ │ │ │ │ , std::string const& extern_auth = std::string() │ │ │ │ │ , web_seed_entry::headers_t const& extra_headers = web_seed_entry:: │ │ │ │ │ headers_t()); │ │ │ │ │ std::int64_t total_size () const; │ │ │ │ │ int piece_length () const; │ │ │ │ │ int num_pieces () const; │ │ │ │ │ - piece_index_t end_piece () const; │ │ │ │ │ piece_index_t last_piece () const; │ │ │ │ │ + piece_index_t end_piece () const; │ │ │ │ │ index_range piece_range () const; │ │ │ │ │ info_hash_t const& info_hashes () const; │ │ │ │ │ sha1_hash info_hash () const noexcept; │ │ │ │ │ bool v2 () const; │ │ │ │ │ bool v1 () const; │ │ │ │ │ int num_files () const; │ │ │ │ │ std::vector map_block (piece_index_t const piece │ │ │ │ │ @@ -2192,29 +2192,29 @@ │ │ │ │ │ bdecode_node info (char const* key) const; │ │ │ │ │ span info_section () const; │ │ │ │ │ span piece_layer (file_index_t) const; │ │ │ │ │ void free_piece_layers (); │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** torrent_info() ***** │ │ │ │ │ -explicit torrent_info (bdecode_node const& torrent_file); │ │ │ │ │ -torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& │ │ │ │ │ -cfg); │ │ │ │ │ -torrent_info (char const* buffer, int size); │ │ │ │ │ +torrent_info (std::string const& filename, error_code& ec); │ │ │ │ │ explicit torrent_info (span buffer, from_span_t); │ │ │ │ │ -torrent_info (span buffer, load_torrent_limits const& cfg, │ │ │ │ │ -from_span_t); │ │ │ │ │ +explicit torrent_info (bdecode_node const& torrent_file); │ │ │ │ │ torrent_info (char const* buffer, int size, error_code& ec); │ │ │ │ │ -explicit torrent_info (info_hash_t const& info_hash); │ │ │ │ │ +torrent_info (torrent_info const& t); │ │ │ │ │ torrent_info (span buffer, error_code& ec, from_span_t); │ │ │ │ │ +explicit torrent_info (info_hash_t const& info_hash); │ │ │ │ │ torrent_info (std::string const& filename, load_torrent_limits const& cfg); │ │ │ │ │ +torrent_info (char const* buffer, int size); │ │ │ │ │ explicit torrent_info (std::string const& filename); │ │ │ │ │ -torrent_info (torrent_info const& t); │ │ │ │ │ -torrent_info (std::string const& filename, error_code& ec); │ │ │ │ │ torrent_info (bdecode_node const& torrent_file, error_code& ec); │ │ │ │ │ +torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& │ │ │ │ │ +cfg); │ │ │ │ │ +torrent_info (span buffer, load_torrent_limits const& cfg, │ │ │ │ │ +from_span_t); │ │ │ │ │ The constructor that takes an info-hash will initialize the info-hash to the │ │ │ │ │ given value, but leave all other fields empty. This is used internally when │ │ │ │ │ downloading torrents without the metadata. The metadata will be created by │ │ │ │ │ libtorrent as soon as it has been downloaded from the swarm. │ │ │ │ │ The constructor that takes a bdecode_node will create a torrent_info object │ │ │ │ │ from the information found in the given torrent_file. The bdecode_node │ │ │ │ │ represents a tree node in an bencoded file. To load an ordinary .torrent file │ │ │ │ │ @@ -2237,15 +2237,15 @@ │ │ │ │ │ from_span_t to disambiguate the std::string overload for string literals. There │ │ │ │ │ is an object in the libtorrent namespace of this type called from_span. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** ~torrent_info() ***** │ │ │ │ │ ~torrent_info (); │ │ │ │ │ frees all storage associated with this torrent_info object │ │ │ │ │ [report_issue] │ │ │ │ │ -***** files() orig_files() ***** │ │ │ │ │ +***** orig_files() files() ***** │ │ │ │ │ file_storage const& files () const; │ │ │ │ │ file_storage const& orig_files () const; │ │ │ │ │ The file_storage object contains the information on how to map the pieces to │ │ │ │ │ files. It is separated from the torrent_info object because when creating │ │ │ │ │ torrents a storage object needs to be created without having a torrent file. │ │ │ │ │ When renaming files in a storage, the storage needs to make its own copy of the │ │ │ │ │ file_storage in order to make its mapping differ from the one in the torrent │ │ │ │ │ @@ -2280,45 +2280,45 @@ │ │ │ │ │ Remaps the file storage to a new file layout. This can be used to, for │ │ │ │ │ instance, download all data in a torrent to a single file, or to a number of │ │ │ │ │ fixed size sector aligned files, regardless of the number and sizes of the │ │ │ │ │ files in the torrent. │ │ │ │ │ The new specified file_storage must have the exact same size as the current │ │ │ │ │ one. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** trackers() add_tracker() clear_trackers() ***** │ │ │ │ │ +***** trackers() clear_trackers() add_tracker() ***** │ │ │ │ │ +void clear_trackers (); │ │ │ │ │ +void add_tracker (std::string const& url, int tier = 0); │ │ │ │ │ void add_tracker (std::string const& url, int tier │ │ │ │ │ , announce_entry::tracker_source source); │ │ │ │ │ -void clear_trackers (); │ │ │ │ │ std::vector const& trackers () const; │ │ │ │ │ -void add_tracker (std::string const& url, int tier = 0); │ │ │ │ │ add_tracker() adds a tracker to the announce-list. The tier determines the │ │ │ │ │ order in which the trackers are to be tried. The trackers() function will │ │ │ │ │ return a sorted vector of announce_entry. Each announce entry contains a │ │ │ │ │ string, which is the tracker url, and a tier index. The tier index is the high- │ │ │ │ │ level priority. No matter which trackers that works or not, the ones with lower │ │ │ │ │ tier will always be tried before the one with higher tier number. For more │ │ │ │ │ information, see announce_entry. │ │ │ │ │ trackers() returns all entries from announce-list. │ │ │ │ │ clear_trackers() removes all trackers from announce-list. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** collections() similar_torrents() ***** │ │ │ │ │ -std::vector similar_torrents () const; │ │ │ │ │ +***** similar_torrents() collections() ***** │ │ │ │ │ std::vector collections () const; │ │ │ │ │ +std::vector similar_torrents () const; │ │ │ │ │ These two functions are related to BEP_38 (mutable torrents). The vectors │ │ │ │ │ returned from these correspond to the "similar" and "collections" keys in the │ │ │ │ │ .torrent file. Both info-hashes and collections from within the info-dict and │ │ │ │ │ from outside of it are included. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** set_web_seeds() add_url_seed() web_seeds() add_http_seed() ***** │ │ │ │ │ +***** set_web_seeds() web_seeds() add_http_seed() add_url_seed() ***** │ │ │ │ │ std::vector const& web_seeds () const; │ │ │ │ │ +void set_web_seeds (std::vector seeds); │ │ │ │ │ void add_url_seed (std::string const& url │ │ │ │ │ , std::string const& ext_auth = std::string() │ │ │ │ │ , web_seed_entry::headers_t const& ext_headers = web_seed_entry:: │ │ │ │ │ headers_t()); │ │ │ │ │ -void set_web_seeds (std::vector seeds); │ │ │ │ │ void add_http_seed (std::string const& url │ │ │ │ │ , std::string const& extern_auth = std::string() │ │ │ │ │ , web_seed_entry::headers_t const& extra_headers = web_seed_entry:: │ │ │ │ │ headers_t()); │ │ │ │ │ web_seeds() returns all url seeds and http seeds in the torrent. Each entry is │ │ │ │ │ a web_seed_entry and may refer to either a url seed or http seed. │ │ │ │ │ add_url_seed() and add_http_seed() adds one url to the list of url/http seeds. │ │ │ │ │ @@ -2344,31 +2344,31 @@ │ │ │ │ │ int num_pieces () const; │ │ │ │ │ piece_length() and num_pieces() returns the number of byte for each piece and │ │ │ │ │ the total number of pieces, respectively. The difference between piece_size() │ │ │ │ │ and piece_length() is that piece_size() takes the piece index as argument and │ │ │ │ │ gives you the exact size of that piece. It will always be the same as │ │ │ │ │ piece_length() except in the case of the last piece, which may be smaller. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** end_piece() piece_range() last_piece() ***** │ │ │ │ │ -piece_index_t end_piece () const; │ │ │ │ │ +***** last_piece() end_piece() piece_range() ***** │ │ │ │ │ piece_index_t last_piece () const; │ │ │ │ │ +piece_index_t end_piece () const; │ │ │ │ │ index_range piece_range () const; │ │ │ │ │ last_piece() returns the index to the last piece in the torrent and end_piece() │ │ │ │ │ returns the index to the one-past-end piece in the torrent piece_range() │ │ │ │ │ returns an implementation-defined type that can be used as the container in a │ │ │ │ │ range-for loop. Where the values are the indices of all pieces in the │ │ │ │ │ file_storage. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** info_hashes() info_hash() ***** │ │ │ │ │ info_hash_t const& info_hashes () const; │ │ │ │ │ sha1_hash info_hash () const noexcept; │ │ │ │ │ returns the info-hash of the torrent. For BitTorrent v2 support, use │ │ │ │ │ info_hashes() to get an object that may hold both a v1 and v2 info-hash │ │ │ │ │ [report_issue] │ │ │ │ │ -***** v2() v1() ***** │ │ │ │ │ +***** v1() v2() ***** │ │ │ │ │ bool v2 () const; │ │ │ │ │ bool v1 () const; │ │ │ │ │ returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid │ │ │ │ │ torrents have both. These are shortcuts for info_hashes().has_v1() and │ │ │ │ │ info_hashes().has_v2() calls. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** num_files() ***** │ │ │ │ │ @@ -2418,15 +2418,15 @@ │ │ │ │ │ than the i2p network. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** piece_size() ***** │ │ │ │ │ int piece_size (piece_index_t index) const; │ │ │ │ │ returns the piece size of file with index. This will be the same as │ │ │ │ │ piece_length(), except for the last piece, which may be shorter. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** hash_for_piece() hash_for_piece_ptr() ***** │ │ │ │ │ +***** hash_for_piece_ptr() hash_for_piece() ***** │ │ │ │ │ char const* hash_for_piece_ptr (piece_index_t const index) const; │ │ │ │ │ sha1_hash hash_for_piece (piece_index_t index) const; │ │ │ │ │ hash_for_piece() takes a piece-index and returns the 20-bytes sha1-hash for │ │ │ │ │ that piece and info_hash() returns the 20-bytes sha1-hash for the info-section │ │ │ │ │ of the torrent file. hash_for_piece_ptr() returns a pointer to the 20 byte sha1 │ │ │ │ │ digest for the piece. Note that the string is not 0-terminated. │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -2871,19 +2871,19 @@ │ │ │ │ │ a v2 info-hash (SHA-256) or both. │ │ │ │ │ Note │ │ │ │ │ If has_v2() is false then the v1 hash might actually be a truncated v2 hash │ │ │ │ │ struct info_hash_t │ │ │ │ │ { │ │ │ │ │ info_hash_t () noexcept = default; │ │ │ │ │ explicit info_hash_t (sha256_hash h2) noexcept; │ │ │ │ │ - explicit info_hash_t (sha1_hash h1) noexcept; │ │ │ │ │ info_hash_t (sha1_hash h1, sha256_hash h2) noexcept; │ │ │ │ │ - bool has (protocol_version v) const; │ │ │ │ │ + explicit info_hash_t (sha1_hash h1) noexcept; │ │ │ │ │ bool has_v1 () const; │ │ │ │ │ bool has_v2 () const; │ │ │ │ │ + bool has (protocol_version v) const; │ │ │ │ │ sha1_hash get (protocol_version v) const; │ │ │ │ │ sha1_hash get_best () const; │ │ │ │ │ friend bool operator!= (info_hash_t const& lhs, info_hash_t const& rhs); │ │ │ │ │ friend bool operator== (info_hash_t const& lhs, info_hash_t const& rhs) │ │ │ │ │ noexcept; │ │ │ │ │ template void for_each (F f) const; │ │ │ │ │ bool operator< (info_hash_t const& o) const; │ │ │ │ │ @@ -2892,25 +2892,25 @@ │ │ │ │ │ sha1_hash v1; │ │ │ │ │ sha256_hash v2; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** info_hash_t() ***** │ │ │ │ │ info_hash_t () noexcept = default; │ │ │ │ │ explicit info_hash_t (sha256_hash h2) noexcept; │ │ │ │ │ -explicit info_hash_t (sha1_hash h1) noexcept; │ │ │ │ │ info_hash_t (sha1_hash h1, sha256_hash h2) noexcept; │ │ │ │ │ +explicit info_hash_t (sha1_hash h1) noexcept; │ │ │ │ │ The default constructor creates an object that has neither a v1 or v2 hash. │ │ │ │ │ For backwards compatibility, make it possible to construct directly from a v1 │ │ │ │ │ hash. This constructor allows implicit conversion from a v1 hash, but the │ │ │ │ │ implicitness is deprecated. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** has_v1() has() has_v2() ***** │ │ │ │ │ -bool has (protocol_version v) const; │ │ │ │ │ +***** has_v1() has_v2() has() ***** │ │ │ │ │ bool has_v1 () const; │ │ │ │ │ bool has_v2 () const; │ │ │ │ │ +bool has (protocol_version v) const; │ │ │ │ │ returns true if the corresponding info hash is present in this object. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** get() ***** │ │ │ │ │ sha1_hash get (protocol_version v) const; │ │ │ │ │ returns the has for the specified protocol version │ │ │ │ │ [report_issue] │ │ │ │ │ ***** get_best() ***** │ │ │ │ │ @@ -2962,41 +2962,41 @@ │ │ │ │ │ [report_issue] │ │ │ │ │ start │ │ │ │ │ The byte offset within that piece where the range starts. │ │ │ │ │ [report_issue] │ │ │ │ │ length │ │ │ │ │ The size of the range, in bytes. │ │ │ │ │ [report_issue] │ │ │ │ │ -****** load_torrent_parsed() load_torrent_file() load_torrent_buffer() ****** │ │ │ │ │ +****** load_torrent_file() load_torrent_parsed() load_torrent_buffer() ****** │ │ │ │ │ Declared in "libtorrent/load_torrent.hpp" │ │ │ │ │ +add_torrent_params load_torrent_buffer ( │ │ │ │ │ + span buffer); │ │ │ │ │ add_torrent_params load_torrent_parsed ( │ │ │ │ │ bdecode_node const& torrent_file); │ │ │ │ │ add_torrent_params load_torrent_buffer ( │ │ │ │ │ - span buffer); │ │ │ │ │ + span buffer, load_torrent_limits const& cfg); │ │ │ │ │ +add_torrent_params load_torrent_parsed ( │ │ │ │ │ + bdecode_node const& torrent_file, load_torrent_limits const& cfg); │ │ │ │ │ add_torrent_params load_torrent_file ( │ │ │ │ │ std::string const& filename); │ │ │ │ │ add_torrent_params load_torrent_file ( │ │ │ │ │ std::string const& filename, load_torrent_limits const& cfg); │ │ │ │ │ -add_torrent_params load_torrent_buffer ( │ │ │ │ │ - span buffer, load_torrent_limits const& cfg); │ │ │ │ │ -add_torrent_params load_torrent_parsed ( │ │ │ │ │ - bdecode_node const& torrent_file, load_torrent_limits const& cfg); │ │ │ │ │ These functions load the content of a .torrent file into an add_torrent_params │ │ │ │ │ object. The immutable part of a torrent file (the info-dictionary) is stored in │ │ │ │ │ the ti field in the add_torrent_params object (as a torrent_info object). The │ │ │ │ │ returned object is suitable to be: │ │ │ │ │ * added to a session via add_torrent() or async_add_torrent() │ │ │ │ │ * saved as a .torrent_file via write_torrent_file() │ │ │ │ │ * turned into a magnet link via make_magnet_uri() │ │ │ │ │ [report_issue] │ │ │ │ │ ****** make_magnet_uri() ****** │ │ │ │ │ Declared in "libtorrent/magnet_uri.hpp" │ │ │ │ │ -std::string make_magnet_uri (torrent_info const& info); │ │ │ │ │ -std::string make_magnet_uri (torrent_handle const& handle); │ │ │ │ │ std::string make_magnet_uri (add_torrent_params const& atp); │ │ │ │ │ +std::string make_magnet_uri (torrent_handle const& handle); │ │ │ │ │ +std::string make_magnet_uri (torrent_info const& info); │ │ │ │ │ Generates a magnet URI from the specified torrent. │ │ │ │ │ Several fields from the add_torrent_params objects are recorded in the magnet │ │ │ │ │ link. In order to not include them, they have to be cleared before calling │ │ │ │ │ make_magnet_uri(). These fields are used: │ │ │ │ │ ti, info_hashes, url_seeds, dht_nodes, file_priorities, trackers, │ │ │ │ │ name, peers. │ │ │ │ │ Depending on what the use case for the resulting magnet link is, clearing peers │ │ │ │ │ @@ -3011,16 +3011,16 @@ │ │ │ │ │ The overload that takes a torrent_handle will make blocking calls to query │ │ │ │ │ information about the torrent. If the torrent handle is invalid, an empty │ │ │ │ │ string is returned. │ │ │ │ │ For more information about magnet links, see magnet_links. │ │ │ │ │ [report_issue] │ │ │ │ │ ****** parse_magnet_uri() ****** │ │ │ │ │ Declared in "libtorrent/magnet_uri.hpp" │ │ │ │ │ -add_torrent_params parse_magnet_uri (string_view uri); │ │ │ │ │ add_torrent_params parse_magnet_uri (string_view uri, error_code& ec); │ │ │ │ │ +add_torrent_params parse_magnet_uri (string_view uri); │ │ │ │ │ void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec); │ │ │ │ │ This function parses out information from the magnet link and populates the │ │ │ │ │ add_torrent_params object. The overload that does not take an error_code │ │ │ │ │ reference will throw a system_error on error The overload taking an │ │ │ │ │ add_torrent_params reference will fill in the fields specified in the magnet │ │ │ │ │ URI. │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -3505,16 +3505,16 @@ │ │ │ │ │ struct torrent_plugin │ │ │ │ │ { │ │ │ │ │ virtual std::shared_ptr new_connection (peer_connection_handle │ │ │ │ │ const&); │ │ │ │ │ virtual void on_piece_pass (piece_index_t); │ │ │ │ │ virtual void on_piece_failed (piece_index_t); │ │ │ │ │ virtual void tick (); │ │ │ │ │ - virtual bool on_resume (); │ │ │ │ │ virtual bool on_pause (); │ │ │ │ │ + virtual bool on_resume (); │ │ │ │ │ virtual void on_files_checked (); │ │ │ │ │ virtual void on_state (torrent_status::state_t); │ │ │ │ │ virtual void on_add_peer (tcp::endpoint const&, │ │ │ │ │ peer_source_flags_t, add_peer_flags_t); │ │ │ │ │ │ │ │ │ │ static constexpr add_peer_flags_t first_time = 1_bit; │ │ │ │ │ static constexpr add_peer_flags_t filtered = 2_bit; │ │ │ │ │ @@ -3544,17 +3544,17 @@ │ │ │ │ │ through the torrent and the piece_picker. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** tick() ***** │ │ │ │ │ virtual void tick (); │ │ │ │ │ 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. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** on_pause() on_resume() ***** │ │ │ │ │ -virtual bool on_resume (); │ │ │ │ │ +***** on_resume() on_pause() ***** │ │ │ │ │ virtual bool on_pause (); │ │ │ │ │ +virtual bool on_resume (); │ │ │ │ │ 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 plugin 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 │ │ │ │ │ @@ -3600,43 +3600,43 @@ │ │ │ │ │ { │ │ │ │ │ virtual string_view type () const; │ │ │ │ │ virtual void add_handshake (entry&); │ │ │ │ │ virtual void on_disconnect (error_code const&); │ │ │ │ │ virtual void on_connected (); │ │ │ │ │ virtual bool on_handshake (span); │ │ │ │ │ virtual bool on_extension_handshake (bdecode_node const&); │ │ │ │ │ + virtual bool on_request (peer_request const&); │ │ │ │ │ virtual bool on_have (piece_index_t); │ │ │ │ │ - virtual bool on_unchoke (); │ │ │ │ │ + virtual bool on_have_none (); │ │ │ │ │ + virtual bool on_bitfield (bitfield const& /*bitfield*/); │ │ │ │ │ + virtual bool on_choke (); │ │ │ │ │ + virtual bool on_allowed_fast (piece_index_t); │ │ │ │ │ virtual bool on_interested (); │ │ │ │ │ + virtual bool on_unchoke (); │ │ │ │ │ virtual bool on_not_interested (); │ │ │ │ │ - virtual bool on_allowed_fast (piece_index_t); │ │ │ │ │ - virtual bool on_choke (); │ │ │ │ │ - virtual bool on_bitfield (bitfield const& /*bitfield*/); │ │ │ │ │ - virtual bool on_have_all (); │ │ │ │ │ virtual bool on_dont_have (piece_index_t); │ │ │ │ │ - virtual bool on_have_none (); │ │ │ │ │ - virtual bool on_request (peer_request const&); │ │ │ │ │ + virtual bool on_have_all (); │ │ │ │ │ virtual bool on_piece (peer_request const& /*piece*/ │ │ │ │ │ , span /*buf*/); │ │ │ │ │ virtual bool on_cancel (peer_request const&); │ │ │ │ │ virtual bool on_suggest (piece_index_t); │ │ │ │ │ virtual bool on_reject (peer_request const&); │ │ │ │ │ - virtual void sent_allow_fast (piece_index_t); │ │ │ │ │ - virtual void sent_request (peer_request const&); │ │ │ │ │ + virtual void sent_have_all (); │ │ │ │ │ virtual void sent_have_none (); │ │ │ │ │ - virtual void sent_choke (); │ │ │ │ │ - virtual void sent_suggest (piece_index_t); │ │ │ │ │ + virtual void sent_request (peer_request const&); │ │ │ │ │ virtual void sent_cancel (peer_request const&); │ │ │ │ │ - virtual void sent_have_all (); │ │ │ │ │ + virtual void sent_choke (); │ │ │ │ │ virtual void sent_reject_request (peer_request const&); │ │ │ │ │ - virtual void sent_interested (); │ │ │ │ │ + virtual void sent_allow_fast (piece_index_t); │ │ │ │ │ + virtual void sent_suggest (piece_index_t); │ │ │ │ │ virtual void sent_not_interested (); │ │ │ │ │ - virtual void sent_have (piece_index_t); │ │ │ │ │ virtual void sent_piece (peer_request const&); │ │ │ │ │ + virtual void sent_have (piece_index_t); │ │ │ │ │ virtual void sent_unchoke (); │ │ │ │ │ + virtual void sent_interested (); │ │ │ │ │ virtual void sent_payload (int /* bytes */); │ │ │ │ │ virtual bool can_disconnect (error_code const& /*ec*/); │ │ │ │ │ virtual bool on_extended (int /*length*/, int /*msg*/, │ │ │ │ │ span /*body*/); │ │ │ │ │ virtual bool on_unknown_message (int /*length*/, int /*msg*/, │ │ │ │ │ span /*body*/); │ │ │ │ │ virtual void on_piece_pass (piece_index_t); │ │ │ │ │ @@ -3672,48 +3672,48 @@ │ │ │ │ │ ***** on_extension_handshake() ***** │ │ │ │ │ virtual bool on_extension_handshake (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 peer_plugin being removed from the peer_connection and │ │ │ │ │ destructed. this is not called for web seeds │ │ │ │ │ [report_issue] │ │ │ │ │ -***** on_have() on_unchoke() on_dont_have() on_request() on_have_none() │ │ │ │ │ -on_have_all() on_allowed_fast() on_choke() on_interested() on_not_interested() │ │ │ │ │ -on_bitfield() ***** │ │ │ │ │ +***** on_have_none() on_allowed_fast() on_dont_have() on_have_all() │ │ │ │ │ +on_not_interested() on_unchoke() on_interested() on_choke() on_have() │ │ │ │ │ +on_request() on_bitfield() ***** │ │ │ │ │ +virtual bool on_request (peer_request const&); │ │ │ │ │ virtual bool on_have (piece_index_t); │ │ │ │ │ -virtual bool on_unchoke (); │ │ │ │ │ +virtual bool on_have_none (); │ │ │ │ │ +virtual bool on_bitfield (bitfield const& /*bitfield*/); │ │ │ │ │ +virtual bool on_choke (); │ │ │ │ │ +virtual bool on_allowed_fast (piece_index_t); │ │ │ │ │ virtual bool on_interested (); │ │ │ │ │ +virtual bool on_unchoke (); │ │ │ │ │ virtual bool on_not_interested (); │ │ │ │ │ -virtual bool on_allowed_fast (piece_index_t); │ │ │ │ │ -virtual bool on_choke (); │ │ │ │ │ -virtual bool on_bitfield (bitfield const& /*bitfield*/); │ │ │ │ │ -virtual bool on_have_all (); │ │ │ │ │ virtual bool on_dont_have (piece_index_t); │ │ │ │ │ -virtual bool on_have_none (); │ │ │ │ │ -virtual bool on_request (peer_request const&); │ │ │ │ │ +virtual bool on_have_all (); │ │ │ │ │ returning true from any of the message handlers indicates that the plugin has │ │ │ │ │ handled the message. it will break the plugin chain traversing and not let │ │ │ │ │ anyone else handle the message, including the default handler. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** on_piece() ***** │ │ │ │ │ virtual bool on_piece (peer_request const& /*piece*/ │ │ │ │ │ , span /*buf*/); │ │ │ │ │ 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. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** sent_interested() sent_unchoke() sent_have() sent_not_interested() │ │ │ │ │ -sent_piece() ***** │ │ │ │ │ -virtual void sent_interested (); │ │ │ │ │ +***** sent_not_interested() sent_unchoke() sent_piece() sent_interested() │ │ │ │ │ +sent_have() ***** │ │ │ │ │ virtual void sent_not_interested (); │ │ │ │ │ -virtual void sent_have (piece_index_t); │ │ │ │ │ virtual void sent_piece (peer_request const&); │ │ │ │ │ +virtual void sent_have (piece_index_t); │ │ │ │ │ virtual void sent_unchoke (); │ │ │ │ │ +virtual void sent_interested (); │ │ │ │ │ called after a choke message has been sent to the peer │ │ │ │ │ [report_issue] │ │ │ │ │ ***** sent_payload() ***** │ │ │ │ │ virtual void sent_payload (int /* bytes */); │ │ │ │ │ called after piece data has been sent to the peer this can be used for stats │ │ │ │ │ book keeping │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -3756,16 +3756,16 @@ │ │ │ │ │ original request message won't be sent and no other plugin will have this │ │ │ │ │ function called. │ │ │ │ │ [report_issue] │ │ │ │ │ ****** crypto_plugin ****** │ │ │ │ │ Declared in "libtorrent/extensions.hpp" │ │ │ │ │ struct crypto_plugin │ │ │ │ │ { │ │ │ │ │ - virtual void set_incoming_key (span key) = 0; │ │ │ │ │ virtual void set_outgoing_key (span key) = 0; │ │ │ │ │ + virtual void set_incoming_key (span key) = 0; │ │ │ │ │ encrypt (span> /*send_vec*/) = 0; │ │ │ │ │ virtual std::tuple decrypt (span> /*receive_vec*/ │ │ │ │ │ ) = 0; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** decrypt() ***** │ │ │ │ │ virtual std::tuple decrypt (span> /*receive_vec*/) = │ │ │ │ │ @@ -3784,64 +3784,64 @@ │ │ │ │ │ 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 impl); │ │ │ │ │ connection_type type () const; │ │ │ │ │ - peer_plugin const* find_plugin (string_view type) const; │ │ │ │ │ void add_extension (std::shared_ptr); │ │ │ │ │ + peer_plugin const* find_plugin (string_view type) const; │ │ │ │ │ bool is_seed () const; │ │ │ │ │ bool upload_only () const; │ │ │ │ │ - bool has_piece (piece_index_t i) const; │ │ │ │ │ peer_id const& pid () const; │ │ │ │ │ - bool is_choked () const; │ │ │ │ │ + bool has_piece (piece_index_t i) const; │ │ │ │ │ bool is_interesting () const; │ │ │ │ │ - bool has_peer_choked () const; │ │ │ │ │ + bool is_choked () const; │ │ │ │ │ bool is_peer_interested () const; │ │ │ │ │ + bool has_peer_choked () const; │ │ │ │ │ void maybe_unchoke_this_peer (); │ │ │ │ │ void choke_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; │ │ │ │ │ - bool is_connecting () 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 ignore_unchoke_slots () const; │ │ │ │ │ bool on_local_network () 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 should_log (peer_log_alert::direction_t direction) const; │ │ │ │ │ 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; │ │ │ │ │ bool operator== (peer_connection_handle const& o) const; │ │ │ │ │ std::shared_ptr 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 packet_finished () const; │ │ │ │ │ bool supports_encryption () const; │ │ │ │ │ void switch_recv_crypto (std::shared_ptr crypto); │ │ │ │ │ void switch_send_crypto (std::shared_ptr crypto); │ │ │ │ │ std::shared_ptr native_handle () const; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ****** create_ut_pex_plugin() ****** │ │ │ │ │ @@ -3910,28 +3910,28 @@ │ │ │ │ │ bool is_valid () const; │ │ │ │ │ void reserve (int num_files); │ │ │ │ │ void add_file (error_code& ec, std::string const& path, std::int64_t │ │ │ │ │ file_size │ │ │ │ │ , file_flags_t file_flags = {} │ │ │ │ │ , std::time_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ │ - void add_file_borrow (error_code& ec, string_view filename │ │ │ │ │ - , std::string const& path, std::int64_t file_size │ │ │ │ │ - , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ │ - , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ - , char const* root_hash = nullptr); │ │ │ │ │ void add_file_borrow (string_view filename │ │ │ │ │ , std::string const& path, std::int64_t file_size │ │ │ │ │ , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ │ , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ │ void add_file (std::string const& path, std::int64_t file_size │ │ │ │ │ , file_flags_t file_flags = {} │ │ │ │ │ , std::time_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ │ + void add_file_borrow (error_code& ec, string_view filename │ │ │ │ │ + , std::string const& path, std::int64_t file_size │ │ │ │ │ + , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ │ + , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ + , char const* root_hash = nullptr); │ │ │ │ │ void rename_file (file_index_t index, std::string const& new_filename); │ │ │ │ │ std::vector map_block (piece_index_t piece, std::int64_t offset │ │ │ │ │ , std::int64_t size) const; │ │ │ │ │ peer_request map_file (file_index_t file, std::int64_t offset, int size) │ │ │ │ │ const; │ │ │ │ │ int num_files () const noexcept; │ │ │ │ │ file_index_t end_file () const noexcept; │ │ │ │ │ @@ -3947,28 +3947,28 @@ │ │ │ │ │ int piece_size (piece_index_t index) const; │ │ │ │ │ int piece_size2 (piece_index_t index) const; │ │ │ │ │ int blocks_in_piece2 (piece_index_t index) const; │ │ │ │ │ std::string const& name () const; │ │ │ │ │ void set_name (std::string const& n); │ │ │ │ │ void swap (file_storage& ti) noexcept; │ │ │ │ │ void canonicalize (); │ │ │ │ │ - sha1_hash hash (file_index_t index) const; │ │ │ │ │ - std::time_t mtime (file_index_t index) const; │ │ │ │ │ std::string symlink (file_index_t index) const; │ │ │ │ │ bool pad_file_at (file_index_t index) const; │ │ │ │ │ + sha256_hash root (file_index_t index) const; │ │ │ │ │ + std::int64_t file_offset (file_index_t index) const; │ │ │ │ │ + sha1_hash hash (file_index_t index) const; │ │ │ │ │ std::int64_t file_size (file_index_t index) const; │ │ │ │ │ std::string file_path (file_index_t index, std::string const& save_path = │ │ │ │ │ "") const; │ │ │ │ │ - std::int64_t file_offset (file_index_t index) const; │ │ │ │ │ char const* root_ptr (file_index_t const index) const; │ │ │ │ │ - sha256_hash root (file_index_t index) const; │ │ │ │ │ + std::time_t mtime (file_index_t index) const; │ │ │ │ │ string_view file_name (file_index_t index) const; │ │ │ │ │ + index_range file_piece_range (file_index_t) const; │ │ │ │ │ int file_num_blocks (file_index_t index) const; │ │ │ │ │ int file_num_pieces (file_index_t index) const; │ │ │ │ │ - index_range file_piece_range (file_index_t) const; │ │ │ │ │ int file_first_block_node (file_index_t index) const; │ │ │ │ │ int file_first_piece_node (file_index_t index) const; │ │ │ │ │ std::uint32_t file_path_hash (file_index_t index, std::string const& │ │ │ │ │ save_path) const; │ │ │ │ │ void all_path_hashes (std::unordered_set& table) const; │ │ │ │ │ file_flags_t file_flags (file_index_t index) const; │ │ │ │ │ bool file_absolute_path (file_index_t index) const; │ │ │ │ │ @@ -3993,33 +3993,33 @@ │ │ │ │ │ [report_issue] │ │ │ │ │ ***** reserve() ***** │ │ │ │ │ void reserve (int num_files); │ │ │ │ │ allocates space for num_files in the internal file list. This can be used to │ │ │ │ │ avoid reallocating the internal file list when the number of files to be added │ │ │ │ │ is known up-front. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** add_file() add_file_borrow() ***** │ │ │ │ │ +***** add_file_borrow() add_file() ***** │ │ │ │ │ void add_file (error_code& ec, std::string const& path, std::int64_t file_size │ │ │ │ │ , file_flags_t file_flags = {} │ │ │ │ │ , std::time_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ │ -void add_file_borrow (error_code& ec, string_view filename │ │ │ │ │ - , std::string const& path, std::int64_t file_size │ │ │ │ │ - , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ │ - , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ - , char const* root_hash = nullptr); │ │ │ │ │ void add_file_borrow (string_view filename │ │ │ │ │ , std::string const& path, std::int64_t file_size │ │ │ │ │ , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ │ , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ │ void add_file (std::string const& path, std::int64_t file_size │ │ │ │ │ , file_flags_t file_flags = {} │ │ │ │ │ , std::time_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ , char const* root_hash = nullptr); │ │ │ │ │ +void add_file_borrow (error_code& ec, string_view filename │ │ │ │ │ + , std::string const& path, std::int64_t file_size │ │ │ │ │ + , file_flags_t file_flags = {}, char const* filehash = nullptr │ │ │ │ │ + , std::int64_t mtime = 0, string_view symlink_path = string_view() │ │ │ │ │ + , char const* root_hash = nullptr); │ │ │ │ │ Adds a file to the file storage. The add_file_borrow version expects that │ │ │ │ │ filename is the file name (without a path) of the file that's being added. This │ │ │ │ │ memory is borrowed, i.e. it is the caller's responsibility to make sure it │ │ │ │ │ stays valid throughout the lifetime of this file_storage object or any copy of │ │ │ │ │ it. The same thing applies to filehash, which is an optional pointer to a 20 │ │ │ │ │ byte binary SHA-1 hash of the file. │ │ │ │ │ if filename is empty, the filename from path is used and not borrowed. │ │ │ │ │ @@ -4109,15 +4109,15 @@ │ │ │ │ │ [report_issue] │ │ │ │ │ ***** piece_range() ***** │ │ │ │ │ index_range piece_range () const noexcept; │ │ │ │ │ returns an implementation-defined type that can be used as the container in a │ │ │ │ │ range-for loop. Where the values are the indices of all pieces in the │ │ │ │ │ file_storage. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** piece_length() set_piece_length() ***** │ │ │ │ │ +***** set_piece_length() piece_length() ***** │ │ │ │ │ int piece_length () const; │ │ │ │ │ void set_piece_length (int l); │ │ │ │ │ set and get the size of each piece in this torrent. It must be a power of two │ │ │ │ │ and at least 16 kiB. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** piece_size() ***** │ │ │ │ │ int piece_size (piece_index_t index) const; │ │ │ │ │ @@ -4131,40 +4131,40 @@ │ │ │ │ │ where all files are piece aligned and padded. i.e. The pad files are not │ │ │ │ │ considered part of the piece for this purpose. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** blocks_in_piece2() ***** │ │ │ │ │ int blocks_in_piece2 (piece_index_t index) const; │ │ │ │ │ returns the number of blocks in the specified piece, for v2 torrents. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** set_name() name() ***** │ │ │ │ │ +***** name() set_name() ***** │ │ │ │ │ std::string const& name () const; │ │ │ │ │ void set_name (std::string const& n); │ │ │ │ │ set and get the name of this torrent. For multi-file torrents, this is also the │ │ │ │ │ name of the root directory all the files are stored in. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** swap() ***** │ │ │ │ │ void swap (file_storage& ti) noexcept; │ │ │ │ │ swap all content of this with ti. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** canonicalize() ***** │ │ │ │ │ void canonicalize (); │ │ │ │ │ arrange files and padding to match the canonical form required by BEP 52 │ │ │ │ │ [report_issue] │ │ │ │ │ -***** file_name() file_size() root_ptr() symlink() pad_file_at() root() │ │ │ │ │ -file_offset() hash() mtime() file_path() ***** │ │ │ │ │ -sha1_hash hash (file_index_t index) const; │ │ │ │ │ -std::time_t mtime (file_index_t index) const; │ │ │ │ │ +***** mtime() file_name() file_offset() file_size() file_path() root() symlink │ │ │ │ │ +() pad_file_at() root_ptr() hash() ***** │ │ │ │ │ std::string symlink (file_index_t index) const; │ │ │ │ │ bool pad_file_at (file_index_t index) const; │ │ │ │ │ +sha256_hash root (file_index_t index) const; │ │ │ │ │ +std::int64_t file_offset (file_index_t index) const; │ │ │ │ │ +sha1_hash hash (file_index_t index) const; │ │ │ │ │ std::int64_t file_size (file_index_t index) const; │ │ │ │ │ std::string file_path (file_index_t index, std::string const& save_path = "") │ │ │ │ │ const; │ │ │ │ │ -std::int64_t file_offset (file_index_t index) const; │ │ │ │ │ char const* root_ptr (file_index_t const index) const; │ │ │ │ │ -sha256_hash root (file_index_t index) const; │ │ │ │ │ +std::time_t mtime (file_index_t index) const; │ │ │ │ │ string_view file_name (file_index_t index) const; │ │ │ │ │ These functions are used to query attributes of files at a given index. │ │ │ │ │ The hash() is a SHA-1 hash of the file, or 0 if none was provided in the │ │ │ │ │ torrent file. This can potentially be used to join a bittorrent network with │ │ │ │ │ other file sharing networks. │ │ │ │ │ root() returns the SHA-256 merkle tree root of the specified file, in case this │ │ │ │ │ is a v2 torrent. Otherwise returns zeros. root_ptr() returns a pointer to the │ │ │ │ │ @@ -4178,24 +4178,24 @@ │ │ │ │ │ file_size() returns the size of a file. │ │ │ │ │ pad_file_at() returns true if the file at the given index is a pad-file. │ │ │ │ │ file_name() returns just the name of the file, whereas file_path() returns the │ │ │ │ │ path (inside the torrent file) with the filename appended. │ │ │ │ │ file_offset() returns the byte offset within the torrent file where this file │ │ │ │ │ starts. It can be used to map the file to a piece index (given the piece size). │ │ │ │ │ [report_issue] │ │ │ │ │ -***** file_num_pieces() file_num_blocks() file_piece_range() ***** │ │ │ │ │ +***** file_piece_range() file_num_pieces() file_num_blocks() ***** │ │ │ │ │ +index_range file_piece_range (file_index_t) const; │ │ │ │ │ int file_num_blocks (file_index_t index) const; │ │ │ │ │ int file_num_pieces (file_index_t index) const; │ │ │ │ │ -index_range file_piece_range (file_index_t) const; │ │ │ │ │ Returns the number of pieces or blocks the file atindexspans, under the │ │ │ │ │ assumption that the file is aligned to the start of a piece. This is only │ │ │ │ │ meaningful for v2 torrents, where files are guaranteed such alignment. These │ │ │ │ │ numbers are used to size and navigate the merkle hash tree for each file. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** file_first_block_node() file_first_piece_node() ***** │ │ │ │ │ +***** file_first_piece_node() file_first_block_node() ***** │ │ │ │ │ int file_first_block_node (file_index_t index) const; │ │ │ │ │ int file_first_piece_node (file_index_t index) const; │ │ │ │ │ index of first piece node in the merkle tree │ │ │ │ │ [report_issue] │ │ │ │ │ ***** file_path_hash() ***** │ │ │ │ │ std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) │ │ │ │ │ const; │ │ │ │ │ @@ -4214,15 +4214,15 @@ │ │ │ │ │ returns a bitmask of flags from file_flags_t that apply to file at index. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** file_absolute_path() ***** │ │ │ │ │ bool file_absolute_path (file_index_t index) const; │ │ │ │ │ returns true if the file at the specified index has been renamed to have an │ │ │ │ │ absolute path, i.e. is not anchored in the save path of the torrent. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** file_index_at_offset() file_index_at_piece() ***** │ │ │ │ │ +***** file_index_at_piece() file_index_at_offset() ***** │ │ │ │ │ file_index_t file_index_at_offset (std::int64_t offset) const; │ │ │ │ │ file_index_t file_index_at_piece (piece_index_t piece) const; │ │ │ │ │ returns the index of the file at the given offset in the torrent │ │ │ │ │ [report_issue] │ │ │ │ │ ***** file_index_for_root() ***** │ │ │ │ │ file_index_t file_index_for_root (sha256_hash const& root_hash) const; │ │ │ │ │ finds the file with the given root hash and returns its index if there is no │ │ │ │ │ @@ -4357,32 +4357,32 @@ │ │ │ │ │ struct client_data_t │ │ │ │ │ { │ │ │ │ │ client_data_t () = default; │ │ │ │ │ explicit client_data_t (T* v); │ │ │ │ │ client_data_t& operator= (T* v); │ │ │ │ │ T* get () const; │ │ │ │ │ explicit operator T () const; │ │ │ │ │ - operator void* () const = delete; │ │ │ │ │ operator void const* () const = delete; │ │ │ │ │ client_data_t& operator= (void*) = delete; │ │ │ │ │ client_data_t& operator= (void const*) = delete; │ │ │ │ │ + operator void* () const = delete; │ │ │ │ │ │ │ │ │ │ template ::value>::type> │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** client_data_t() ***** │ │ │ │ │ client_data_t () = default; │ │ │ │ │ construct a nullptr client data │ │ │ │ │ [report_issue] │ │ │ │ │ -***** const*() operator=() void*() ***** │ │ │ │ │ -operator void* () const = delete; │ │ │ │ │ +***** void*() operator=() const*() ***** │ │ │ │ │ operator void const* () const = delete; │ │ │ │ │ client_data_t& operator= (void*) = delete; │ │ │ │ │ client_data_t& operator= (void const*) = delete; │ │ │ │ │ +operator void* () const = delete; │ │ │ │ │ we don't allow type-unsafe operations │ │ │ │ │ [report_issue] │ │ │ │ │ ****** add_torrent_params ****** │ │ │ │ │ Declared in "libtorrent/add_torrent_params.hpp" │ │ │ │ │ The add_torrent_params contains all the information in a .torrent file along │ │ │ │ │ with all information necessary to add that torrent to a session. The key fields │ │ │ │ │ when adding a torrent are: │ │ │ │ │ @@ -4684,18 +4684,18 @@ │ │ │ │ │ ****** peer_class_type_filter ****** │ │ │ │ │ Declared in "libtorrent/peer_class_type_filter.hpp" │ │ │ │ │ peer_class_type_filter is a simple container for rules for adding and │ │ │ │ │ subtracting peer-classes from peers. It is applied after the peer class filter │ │ │ │ │ is applied (which is based on the peer's IP address). │ │ │ │ │ struct peer_class_type_filter │ │ │ │ │ { │ │ │ │ │ - void add (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ void remove (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ - void allow (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ + void add (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ void disallow (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ + void allow (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask); │ │ │ │ │ friend bool operator== (peer_class_type_filter const& lhs │ │ │ │ │ , peer_class_type_filter const& rhs); │ │ │ │ │ │ │ │ │ │ enum socket_type_t │ │ │ │ │ { │ │ │ │ │ tcp_socket, │ │ │ │ │ @@ -4703,23 +4703,23 @@ │ │ │ │ │ ssl_tcp_socket, │ │ │ │ │ ssl_utp_socket, │ │ │ │ │ i2p_socket, │ │ │ │ │ num_socket_types, │ │ │ │ │ }; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** remove() add() ***** │ │ │ │ │ -void add (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ +***** add() remove() ***** │ │ │ │ │ void remove (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ +void add (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ add() and remove() adds and removes a peer class to be added to new peers based │ │ │ │ │ on socket type. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** disallow() allow() ***** │ │ │ │ │ -void allow (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ void disallow (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ +void allow (socket_type_t const st, peer_class_t const peer_class); │ │ │ │ │ disallow() and allow() adds and removes a peer class to be removed from new │ │ │ │ │ peers based on socket type. │ │ │ │ │ The peer_class argument cannot be greater than 31. The bitmasks representing │ │ │ │ │ peer classes in the peer_class_type_filter are 32 bits. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** apply() ***** │ │ │ │ │ std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask); │ │ │ │ │ @@ -4740,16 +4740,16 @@ │ │ │ │ │ [report_issue] │ │ │ │ │ ****** block_info ****** │ │ │ │ │ Declared in "libtorrent/torrent_handle.hpp" │ │ │ │ │ holds the state of a block in a piece. Who we requested it from and how far │ │ │ │ │ along we are at downloading it. │ │ │ │ │ struct block_info │ │ │ │ │ { │ │ │ │ │ - tcp::endpoint peer () const; │ │ │ │ │ void set_peer (tcp::endpoint const& ep); │ │ │ │ │ + tcp::endpoint peer () const; │ │ │ │ │ │ │ │ │ │ enum block_state_t │ │ │ │ │ { │ │ │ │ │ none, │ │ │ │ │ requested, │ │ │ │ │ writing, │ │ │ │ │ finished, │ │ │ │ │ @@ -4757,17 +4757,17 @@ │ │ │ │ │ │ │ │ │ │ unsigned bytes_progress:15; │ │ │ │ │ unsigned block_size:15; │ │ │ │ │ unsigned state:2; │ │ │ │ │ unsigned num_peers:14; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** set_peer() peer() ***** │ │ │ │ │ -tcp::endpoint peer () const; │ │ │ │ │ +***** peer() set_peer() ***** │ │ │ │ │ void set_peer (tcp::endpoint const& ep); │ │ │ │ │ +tcp::endpoint peer () const; │ │ │ │ │ The peer is the ip address of the peer this block was downloaded from. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** enum block_state_t ***** │ │ │ │ │ Declared in "libtorrent/torrent_handle.hpp" │ │ │ │ │ ___________________________________________________________________________ │ │ │ │ │ |name_____|value|description________________________________________________| │ │ │ │ │ |none |0 |This block has not been downloaded or requested form any | │ │ │ │ │ @@ -4862,105 +4862,105 @@ │ │ │ │ │ flags = {}) const; │ │ │ │ │ void add_piece (piece_index_t piece, std::vector data, │ │ │ │ │ add_piece_flags_t flags = {}) const; │ │ │ │ │ void read_piece (piece_index_t piece) const; │ │ │ │ │ bool have_piece (piece_index_t piece) const; │ │ │ │ │ void get_peer_info (std::vector& v) const; │ │ │ │ │ torrent_status status (status_flags_t flags = status_flags_t::all()) const; │ │ │ │ │ - void get_download_queue (std::vector& queue) const; │ │ │ │ │ std::vector get_download_queue () const; │ │ │ │ │ + void get_download_queue (std::vector& queue) const; │ │ │ │ │ void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t │ │ │ │ │ flags = {}) const; │ │ │ │ │ - void clear_piece_deadlines () const; │ │ │ │ │ void reset_piece_deadline (piece_index_t index) const; │ │ │ │ │ + void clear_piece_deadlines () const; │ │ │ │ │ void file_progress (std::vector& progress, │ │ │ │ │ file_progress_flags_t flags = {}) const; │ │ │ │ │ std::vector file_progress (file_progress_flags_t flags = {}) │ │ │ │ │ const; │ │ │ │ │ std::vector file_status () const; │ │ │ │ │ void clear_error () const; │ │ │ │ │ - void replace_trackers (std::vector const&) const; │ │ │ │ │ void add_tracker (announce_entry const&) const; │ │ │ │ │ + void replace_trackers (std::vector const&) const; │ │ │ │ │ std::vector trackers () const; │ │ │ │ │ + void add_url_seed (std::string const& url) const; │ │ │ │ │ std::set url_seeds () const; │ │ │ │ │ void remove_url_seed (std::string const& url) const; │ │ │ │ │ - void add_url_seed (std::string const& url) const; │ │ │ │ │ - std::set http_seeds () const; │ │ │ │ │ void remove_http_seed (std::string const& url) const; │ │ │ │ │ void add_http_seed (std::string const& url) const; │ │ │ │ │ + std::set http_seeds () const; │ │ │ │ │ void add_extension ( │ │ │ │ │ std::function(torrent_handle const&, │ │ │ │ │ client_data_t)> const& ext │ │ │ │ │ , client_data_t userdata = client_data_t{}); │ │ │ │ │ bool set_metadata (span metadata) const; │ │ │ │ │ bool is_valid () const; │ │ │ │ │ void resume () const; │ │ │ │ │ void pause (pause_flags_t flags = {}) const; │ │ │ │ │ + void set_flags (torrent_flags_t flags) const; │ │ │ │ │ torrent_flags_t flags () const; │ │ │ │ │ - void unset_flags (torrent_flags_t flags) const; │ │ │ │ │ void set_flags (torrent_flags_t flags, torrent_flags_t mask) const; │ │ │ │ │ - void set_flags (torrent_flags_t flags) const; │ │ │ │ │ + void unset_flags (torrent_flags_t flags) const; │ │ │ │ │ void flush_cache () const; │ │ │ │ │ void force_recheck () const; │ │ │ │ │ void save_resume_data (resume_data_flags_t flags = {}) const; │ │ │ │ │ bool need_save_resume_data () const; │ │ │ │ │ - void queue_position_up () const; │ │ │ │ │ - queue_position_t queue_position () const; │ │ │ │ │ void queue_position_bottom () const; │ │ │ │ │ + queue_position_t queue_position () const; │ │ │ │ │ + void queue_position_up () const; │ │ │ │ │ void queue_position_down () const; │ │ │ │ │ void queue_position_top () const; │ │ │ │ │ void queue_position_set (queue_position_t p) const; │ │ │ │ │ + void set_ssl_certificate_buffer (std::string const& certificate │ │ │ │ │ + , std::string const& private_key │ │ │ │ │ + , std::string const& dh_params); │ │ │ │ │ void set_ssl_certificate (std::string const& certificate │ │ │ │ │ , std::string const& private_key │ │ │ │ │ , std::string const& dh_params │ │ │ │ │ , std::string const& passphrase = ""); │ │ │ │ │ - void set_ssl_certificate_buffer (std::string const& certificate │ │ │ │ │ - , std::string const& private_key │ │ │ │ │ - , std::string const& dh_params); │ │ │ │ │ - std::shared_ptr torrent_file_with_hashes () const; │ │ │ │ │ std::shared_ptr torrent_file () const; │ │ │ │ │ + std::shared_ptr torrent_file_with_hashes () const; │ │ │ │ │ std::vector> piece_layers () const; │ │ │ │ │ void piece_availability (std::vector& avail) const; │ │ │ │ │ + void piece_priority (piece_index_t index, download_priority_t priority) │ │ │ │ │ +const; │ │ │ │ │ std::vector get_piece_priorities () const; │ │ │ │ │ void prioritize_pieces (std::vector> const& pieces) const; │ │ │ │ │ download_priority_t piece_priority (piece_index_t index) const; │ │ │ │ │ - void piece_priority (piece_index_t index, download_priority_t priority) │ │ │ │ │ -const; │ │ │ │ │ void prioritize_pieces (std::vector const& pieces) │ │ │ │ │ const; │ │ │ │ │ - download_priority_t file_priority (file_index_t index) const; │ │ │ │ │ void file_priority (file_index_t index, download_priority_t priority) const; │ │ │ │ │ - void prioritize_files (std::vector const& files) const; │ │ │ │ │ + download_priority_t file_priority (file_index_t index) const; │ │ │ │ │ std::vector get_file_priorities () const; │ │ │ │ │ + void prioritize_files (std::vector const& files) const; │ │ │ │ │ + void force_lsd_announce () const; │ │ │ │ │ + void force_dht_announce () const; │ │ │ │ │ void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = │ │ │ │ │ {}) const; │ │ │ │ │ - void force_dht_announce () const; │ │ │ │ │ - void force_lsd_announce () const; │ │ │ │ │ void scrape_tracker (int idx = -1) const; │ │ │ │ │ int upload_limit () const; │ │ │ │ │ - int download_limit () const; │ │ │ │ │ void set_upload_limit (int limit) const; │ │ │ │ │ void set_download_limit (int limit) const; │ │ │ │ │ + int download_limit () const; │ │ │ │ │ void connect_peer (tcp::endpoint const& adr, peer_source_flags_t source = {} │ │ │ │ │ , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const; │ │ │ │ │ void clear_peers (); │ │ │ │ │ void set_max_uploads (int max_uploads) const; │ │ │ │ │ int max_uploads () const; │ │ │ │ │ int max_connections () const; │ │ │ │ │ void set_max_connections (int max_connections) const; │ │ │ │ │ void move_storage (std::string const& save_path │ │ │ │ │ , move_flags_t flags = move_flags_t::always_replace_files │ │ │ │ │ ) const; │ │ │ │ │ void rename_file (file_index_t index, std::string const& new_name) const; │ │ │ │ │ info_hash_t info_hashes () const; │ │ │ │ │ sha1_hash info_hash () const; │ │ │ │ │ - bool operator< (const torrent_handle& h) const; │ │ │ │ │ - bool operator== (const torrent_handle& h) const; │ │ │ │ │ bool operator!= (const torrent_handle& h) const; │ │ │ │ │ + bool operator== (const torrent_handle& h) const; │ │ │ │ │ + bool operator< (const torrent_handle& h) const; │ │ │ │ │ std::uint32_t id () const; │ │ │ │ │ std::shared_ptr native_handle () const; │ │ │ │ │ client_data_t userdata () const; │ │ │ │ │ bool in_session () const; │ │ │ │ │ │ │ │ │ │ static constexpr add_piece_flags_t overwrite_existing = 0_bit; │ │ │ │ │ static constexpr status_flags_t query_distributed_copies = 0_bit; │ │ │ │ │ @@ -5040,25 +5040,25 @@ │ │ │ │ │ returned in the torrent_status. Some information in there is relatively │ │ │ │ │ expensive to calculate, and if you're not interested in it (and see performance │ │ │ │ │ issues), you can filter them out. │ │ │ │ │ By default everything is included. The flags you can use to decide what to │ │ │ │ │ include are defined in this class. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** get_download_queue() ***** │ │ │ │ │ -void get_download_queue (std::vector& queue) const; │ │ │ │ │ std::vector get_download_queue () const; │ │ │ │ │ +void get_download_queue (std::vector& queue) const; │ │ │ │ │ get_download_queue() returns a vector with information about pieces that are │ │ │ │ │ partially downloaded or not downloaded but partially requested. See │ │ │ │ │ partial_piece_info for the fields in the returned vector. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** clear_piece_deadlines() reset_piece_deadline() set_piece_deadline() ***** │ │ │ │ │ +***** set_piece_deadline() clear_piece_deadlines() reset_piece_deadline() ***** │ │ │ │ │ void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t │ │ │ │ │ flags = {}) const; │ │ │ │ │ -void clear_piece_deadlines () const; │ │ │ │ │ void reset_piece_deadline (piece_index_t index) const; │ │ │ │ │ +void clear_piece_deadlines () const; │ │ │ │ │ This function sets or resets the deadline associated with a specific piece │ │ │ │ │ index (index). libtorrent will attempt to download this entire piece before the │ │ │ │ │ deadline expires. This is not necessarily possible, but pieces with a more │ │ │ │ │ recent deadline will always be prioritized over pieces with a deadline further │ │ │ │ │ ahead in time. The deadline (and flags) of a piece can be changed by calling │ │ │ │ │ this function again. │ │ │ │ │ If the piece is already downloaded when this call is made, nothing happens, │ │ │ │ │ @@ -5099,17 +5099,17 @@ │ │ │ │ │ See open_file_state │ │ │ │ │ [report_issue] │ │ │ │ │ ***** clear_error() ***** │ │ │ │ │ void clear_error () const; │ │ │ │ │ If the torrent is in an error state (i.e. torrent_status::error is non-empty), │ │ │ │ │ this will clear the error and start the torrent again. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** replace_trackers() trackers() add_tracker() ***** │ │ │ │ │ -void replace_trackers (std::vector const&) const; │ │ │ │ │ +***** trackers() replace_trackers() add_tracker() ***** │ │ │ │ │ void add_tracker (announce_entry const&) const; │ │ │ │ │ +void replace_trackers (std::vector const&) const; │ │ │ │ │ std::vector trackers () const; │ │ │ │ │ trackers() will return the list of trackers for this torrent. The announce │ │ │ │ │ entry contains both a string url which specify the announce url for the tracker │ │ │ │ │ as well as an int tier, which is specifies the order in which this tracker is │ │ │ │ │ tried. If you want libtorrent to use another list of trackers for this torrent, │ │ │ │ │ you can use replace_trackers() which takes a list of the same form as the one │ │ │ │ │ returned from trackers() and will replace it. If you want an immediate effect, │ │ │ │ │ @@ -5117,30 +5117,30 @@ │ │ │ │ │ add_tracker() will look if the specified tracker is already in the set. If it │ │ │ │ │ is, it doesn't do anything. If it's not in the current set of trackers, it will │ │ │ │ │ insert it in the tier specified in the announce_entry. │ │ │ │ │ The updated set of trackers will be saved in the resume data, and when a │ │ │ │ │ torrent is started with resume data, the trackers from the resume data will │ │ │ │ │ replace the original ones. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** url_seeds() add_url_seed() remove_url_seed() ***** │ │ │ │ │ +***** url_seeds() remove_url_seed() add_url_seed() ***** │ │ │ │ │ +void add_url_seed (std::string const& url) const; │ │ │ │ │ std::set url_seeds () const; │ │ │ │ │ void remove_url_seed (std::string const& url) const; │ │ │ │ │ -void add_url_seed (std::string const& url) const; │ │ │ │ │ add_url_seed() adds another url to the torrent's list of url seeds. If the │ │ │ │ │ given url already exists in that list, the call has no effect. The torrent will │ │ │ │ │ connect to the server and try to download pieces from it, unless it's paused, │ │ │ │ │ queued, checking or seeding. remove_url_seed() removes the given url if it │ │ │ │ │ exists already. url_seeds() return a set of the url seeds currently in this │ │ │ │ │ torrent. Note that URLs that fails may be removed automatically from the list. │ │ │ │ │ See http_seeding for more information. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** remove_http_seed() http_seeds() add_http_seed() ***** │ │ │ │ │ -std::set http_seeds () const; │ │ │ │ │ +***** http_seeds() add_http_seed() remove_http_seed() ***** │ │ │ │ │ void remove_http_seed (std::string const& url) const; │ │ │ │ │ void add_http_seed (std::string const& url) const; │ │ │ │ │ +std::set http_seeds () const; │ │ │ │ │ These functions are identical as the *_url_seed() variants, but they operate on │ │ │ │ │ BEP_17 web seeds instead of BEP_19. │ │ │ │ │ See http_seeding for more information. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** add_extension() ***** │ │ │ │ │ void add_extension ( │ │ │ │ │ std::function(torrent_handle const&, │ │ │ │ │ @@ -5189,18 +5189,18 @@ │ │ │ │ │ Note │ │ │ │ │ Torrents that are auto-managed may be automatically resumed again. It does not │ │ │ │ │ make sense to pause an auto-managed torrent without making it not auto-managed │ │ │ │ │ first. Torrents are auto-managed by default when added to the session. For more │ │ │ │ │ information, see queuing. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** unset_flags() set_flags() flags() ***** │ │ │ │ │ +void set_flags (torrent_flags_t flags) const; │ │ │ │ │ torrent_flags_t flags () const; │ │ │ │ │ -void unset_flags (torrent_flags_t flags) const; │ │ │ │ │ void set_flags (torrent_flags_t flags, torrent_flags_t mask) const; │ │ │ │ │ -void set_flags (torrent_flags_t flags) const; │ │ │ │ │ +void unset_flags (torrent_flags_t flags) const; │ │ │ │ │ sets and gets the torrent state flags. See torrent_flags_t. The set_flags │ │ │ │ │ overload that take a mask will affect all flags part of the mask, and set their │ │ │ │ │ values to what the flags argument is set to. This allows clearing and setting │ │ │ │ │ flags in a single function call. The set_flags overload that just takes flags, │ │ │ │ │ sets all the specified flags and leave any other flags unchanged. unset_flags │ │ │ │ │ clears the specified flags, while leaving any other flags unchanged. │ │ │ │ │ Theseed_modeflag is special, it can only be cleared once the torrent has been │ │ │ │ │ @@ -5320,19 +5320,19 @@ │ │ │ │ │ saving resume data periodically, it makes sense to skip any torrent which │ │ │ │ │ hasn't downloaded anything since the last time. │ │ │ │ │ Note │ │ │ │ │ A torrent's resume data is considered saved as soon as the │ │ │ │ │ save_resume_data_alert is posted. It is important to make sure this alert is │ │ │ │ │ received and handled in order for this function to be meaningful. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** queue_position_up() queue_position_down() queue_position_top() │ │ │ │ │ -queue_position_bottom() queue_position() ***** │ │ │ │ │ -void queue_position_up () const; │ │ │ │ │ -queue_position_t queue_position () const; │ │ │ │ │ +***** queue_position() queue_position_up() queue_position_bottom() │ │ │ │ │ +queue_position_down() queue_position_top() ***** │ │ │ │ │ void queue_position_bottom () const; │ │ │ │ │ +queue_position_t queue_position () const; │ │ │ │ │ +void queue_position_up () const; │ │ │ │ │ void queue_position_down () const; │ │ │ │ │ void queue_position_top () const; │ │ │ │ │ Every torrent that is added is assigned a queue position exactly one greater │ │ │ │ │ than the greatest queue position of all existing torrents. Torrents that are │ │ │ │ │ being seeded have -1 as their queue position, since they're no longer in line │ │ │ │ │ to be downloaded. │ │ │ │ │ When a torrent is removed or turns into a seed, all torrents with greater queue │ │ │ │ │ @@ -5348,22 +5348,22 @@ │ │ │ │ │ [report_issue] │ │ │ │ │ ***** queue_position_set() ***** │ │ │ │ │ void queue_position_set (queue_position_t p) const; │ │ │ │ │ updates the position in the queue for this torrent. The relative order of all │ │ │ │ │ other torrents remain intact but their numerical queue position shifts to make │ │ │ │ │ space for this torrent's new position │ │ │ │ │ [report_issue] │ │ │ │ │ -***** set_ssl_certificate_buffer() set_ssl_certificate() ***** │ │ │ │ │ +***** set_ssl_certificate() set_ssl_certificate_buffer() ***** │ │ │ │ │ +void set_ssl_certificate_buffer (std::string const& certificate │ │ │ │ │ + , std::string const& private_key │ │ │ │ │ + , std::string const& dh_params); │ │ │ │ │ void set_ssl_certificate (std::string const& certificate │ │ │ │ │ , std::string const& private_key │ │ │ │ │ , std::string const& dh_params │ │ │ │ │ , std::string const& passphrase = ""); │ │ │ │ │ -void set_ssl_certificate_buffer (std::string const& certificate │ │ │ │ │ - , std::string const& private_key │ │ │ │ │ - , std::string const& dh_params); │ │ │ │ │ For SSL torrents, use this to specify a path to a .pem file to use as this │ │ │ │ │ client's certificate. The certificate must be signed by the certificate in the │ │ │ │ │ .torrent file to be valid. │ │ │ │ │ The set_ssl_certificate_buffer() overload takes the actual certificate, private │ │ │ │ │ key and DH params as strings, rather than paths to files. │ │ │ │ │ cert is a path to the (signed) certificate in .pem format corresponding to this │ │ │ │ │ torrent. │ │ │ │ │ @@ -5377,17 +5377,17 @@ │ │ │ │ │ Note that when a torrent first starts up, and it needs a certificate, it will │ │ │ │ │ suspend connecting to any peers until it has one. It's typically desirable to │ │ │ │ │ resume the torrent after setting the SSL certificate. │ │ │ │ │ If you receive a torrent_need_cert_alert, you need to call this to provide a │ │ │ │ │ valid cert. If you don't have a cert you won't be allowed to connect to any │ │ │ │ │ peers. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** torrent_file() torrent_file_with_hashes() ***** │ │ │ │ │ -std::shared_ptr torrent_file_with_hashes () const; │ │ │ │ │ +***** torrent_file_with_hashes() torrent_file() ***** │ │ │ │ │ std::shared_ptr torrent_file () const; │ │ │ │ │ +std::shared_ptr torrent_file_with_hashes () const; │ │ │ │ │ torrent_file() returns a pointer to the torrent_info object associated with │ │ │ │ │ this torrent. The torrent_info object may be a copy of the internal object. If │ │ │ │ │ the torrent doesn't have metadata, the pointer will not be initialized (i.e. a │ │ │ │ │ nullptr). The torrent may be in a state without metadata only if it was started │ │ │ │ │ without a .torrent file, e.g. by being added by magnet link. │ │ │ │ │ Note that the torrent_info object returned here may be a different instance │ │ │ │ │ than the one added to the session, with different attributes like piece layers, │ │ │ │ │ @@ -5423,19 +5423,19 @@ │ │ │ │ │ this torrent. libtorrent does not keep track of availability for seeds, so if │ │ │ │ │ the torrent is seeding the availability for all pieces is reported as 0. │ │ │ │ │ The piece availability is the number of peers that we are connected that has │ │ │ │ │ advertised having a particular piece. This is the information that libtorrent │ │ │ │ │ uses in order to prefer picking rare pieces. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** piece_priority() prioritize_pieces() get_piece_priorities() ***** │ │ │ │ │ +void piece_priority (piece_index_t index, download_priority_t priority) const; │ │ │ │ │ std::vector get_piece_priorities () const; │ │ │ │ │ void prioritize_pieces (std::vector> const& pieces) const; │ │ │ │ │ download_priority_t piece_priority (piece_index_t index) const; │ │ │ │ │ -void piece_priority (piece_index_t index, download_priority_t priority) const; │ │ │ │ │ void prioritize_pieces (std::vector const& pieces) const; │ │ │ │ │ These functions are used to set and get the priority of individual pieces. By │ │ │ │ │ default all pieces have priority 4. That means that the random rarest first │ │ │ │ │ algorithm is effectively active for all pieces. You may however change the │ │ │ │ │ priority of individual pieces. There are 8 priority levels. 0 means not to │ │ │ │ │ download the piece at all. Otherwise, lower priority values means less likely │ │ │ │ │ to be picked. Piece priority takes precedence over piece availability. Every │ │ │ │ │ @@ -5457,18 +5457,18 @@ │ │ │ │ │ get_piece_priorities returns a vector with one element for each piece in the │ │ │ │ │ torrent. Each element is the current priority of that piece. │ │ │ │ │ It's possible to cancel the effect of file priorities by setting the priorities │ │ │ │ │ for the affected pieces. Care has to be taken when mixing usage of file- and │ │ │ │ │ piece priorities. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** get_file_priorities() prioritize_files() file_priority() ***** │ │ │ │ │ -download_priority_t file_priority (file_index_t index) const; │ │ │ │ │ void file_priority (file_index_t index, download_priority_t priority) const; │ │ │ │ │ -void prioritize_files (std::vector const& files) const; │ │ │ │ │ +download_priority_t file_priority (file_index_t index) const; │ │ │ │ │ std::vector get_file_priorities () const; │ │ │ │ │ +void prioritize_files (std::vector const& files) const; │ │ │ │ │ index must be in the range [0, number_of_files). │ │ │ │ │ file_priority() queries or sets the priority of file index. │ │ │ │ │ prioritize_files() takes a vector that has at as many elements as there are │ │ │ │ │ files in the torrent. Each entry is the priority of that file. The function │ │ │ │ │ sets the priorities of all the pieces in the torrent based on the vector. │ │ │ │ │ get_file_priorities() returns a vector with the priorities of all files. │ │ │ │ │ The priority values are the same as for piece_priority(). See │ │ │ │ │ @@ -5487,19 +5487,19 @@ │ │ │ │ │ When combining file- and piece priorities, the resume file will record both. │ │ │ │ │ When loading the resume data, the file priorities will be applied first, then │ │ │ │ │ the piece priorities. │ │ │ │ │ Moving data from a file into the part file is currently not supported. If a │ │ │ │ │ file has its priority set to 0 after it has already been created, it will not │ │ │ │ │ be moved into the partfile. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** force_dht_announce() force_lsd_announce() force_reannounce() ***** │ │ │ │ │ +***** force_lsd_announce() force_reannounce() force_dht_announce() ***** │ │ │ │ │ +void force_lsd_announce () const; │ │ │ │ │ +void force_dht_announce () const; │ │ │ │ │ void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) │ │ │ │ │ const; │ │ │ │ │ -void force_dht_announce () const; │ │ │ │ │ -void force_lsd_announce () const; │ │ │ │ │ force_reannounce() will force this torrent to do another tracker request, to │ │ │ │ │ receive new peers. The seconds argument specifies how many seconds from now to │ │ │ │ │ issue the tracker announces. │ │ │ │ │ If the tracker's min_interval has not passed since the last announce, the │ │ │ │ │ forced announce will be scheduled to happen immediately as the min_interval │ │ │ │ │ expires. This is to honor trackers minimum re-announce interval settings. │ │ │ │ │ The tracker_index argument specifies which tracker to re-announce. If set to - │ │ │ │ │ @@ -5520,17 +5520,17 @@ │ │ │ │ │ fields in the torrent_status struct once it completes. When it completes, it │ │ │ │ │ will generate a scrape_reply_alert. If it fails, it will generate a │ │ │ │ │ scrape_failed_alert. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** upload_limit() set_download_limit() set_upload_limit() download_limit() │ │ │ │ │ ***** │ │ │ │ │ int upload_limit () const; │ │ │ │ │ -int download_limit () const; │ │ │ │ │ void set_upload_limit (int limit) const; │ │ │ │ │ void set_download_limit (int limit) const; │ │ │ │ │ +int download_limit () const; │ │ │ │ │ set_upload_limit will limit the upload bandwidth used by this particular │ │ │ │ │ torrent to the limit you set. It is given as the number of bytes per second the │ │ │ │ │ torrent is allowed to upload. set_download_limit works the same way but for │ │ │ │ │ download bandwidth instead of upload bandwidth. Note that setting a higher │ │ │ │ │ limit on a torrent then the global limit (settings_pack::upload_rate_limit) │ │ │ │ │ will not override the global rate limit. The torrent can never upload more than │ │ │ │ │ the global rate limit. │ │ │ │ │ @@ -5562,15 +5562,15 @@ │ │ │ │ │ int max_uploads () const; │ │ │ │ │ set_max_uploads() sets the maximum number of peers that's unchoked at the same │ │ │ │ │ time on this torrent. If you set this to -1, there will be no limit. This │ │ │ │ │ defaults to infinite. The primary setting controlling this is the global │ │ │ │ │ unchoke slots limit, set by unchoke_slots_limit in settings_pack. │ │ │ │ │ max_uploads() returns the current settings. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** max_connections() set_max_connections() ***** │ │ │ │ │ +***** set_max_connections() max_connections() ***** │ │ │ │ │ int max_connections () const; │ │ │ │ │ void set_max_connections (int max_connections) const; │ │ │ │ │ set_max_connections() sets the maximum number of connection this torrent will │ │ │ │ │ open. If all connections are used up, incoming connections may be refused or │ │ │ │ │ poor connections may be closed. This must be at least 2. The default is │ │ │ │ │ unlimited number of connections. If -1 is given to the function, it means │ │ │ │ │ unlimited. There is also a global limit of the number of connections, set by │ │ │ │ │ @@ -5631,18 +5631,18 @@ │ │ │ │ │ sha1_hash info_hash () const; │ │ │ │ │ returns the info-hash(es) of the torrent. If this handle is to a torrent that │ │ │ │ │ hasn't loaded yet (for instance by being added) by a URL, the returned value is │ │ │ │ │ undefined. The info_hash() returns the SHA-1 info-hash for v1 torrents and a │ │ │ │ │ truncated hash for v2 torrents. For the full v2 info-hash, use info_hashes() │ │ │ │ │ instead. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** operator<() operator!=() operator==() ***** │ │ │ │ │ -bool operator< (const torrent_handle& h) const; │ │ │ │ │ -bool operator== (const torrent_handle& h) const; │ │ │ │ │ +***** operator==() operator!=() operator<() ***** │ │ │ │ │ bool operator!= (const torrent_handle& h) const; │ │ │ │ │ +bool operator== (const torrent_handle& h) const; │ │ │ │ │ +bool operator< (const torrent_handle& h) const; │ │ │ │ │ comparison operators. The order of the torrents is unspecified but stable. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** id() ***** │ │ │ │ │ std::uint32_t id () const; │ │ │ │ │ returns a unique identifier for this torrent. It's not a dense index. It's not │ │ │ │ │ preserved across sessions. │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -5873,15 +5873,15 @@ │ │ │ │ │ [report_issue] │ │ │ │ │ ***** 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() ***** │ │ │ │ │ +***** async_read() async_write() ***** │ │ │ │ │ virtual void async_read (storage_index_t storage, peer_request const& r │ │ │ │ │ , std::function handler │ │ │ │ │ , disk_job_flags_t flags = {}) = 0; │ │ │ │ │ virtual bool async_write (storage_index_t storage, peer_request const& r │ │ │ │ │ , char const* buf, std::shared_ptr o │ │ │ │ │ , std::function handler │ │ │ │ │ , disk_job_flags_t flags = {}) = 0; │ │ │ │ │ @@ -6076,16 +6076,16 @@ │ │ │ │ │ (class that implements disk_interface). 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 │ │ │ │ │ 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_holder () = default; │ │ │ │ │ explicit operator bool () const; │ │ │ │ │ operator storage_index_t () const; │ │ │ │ │ void reset (); │ │ │ │ │ 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; │ │ │ │ │ @@ -6174,21 +6174,21 @@ │ │ │ │ │ [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 bool has_val (int name) const = 0; │ │ │ │ │ + virtual void set_int (int name, int val) = 0; │ │ │ │ │ virtual void set_bool (int name, bool val) = 0; │ │ │ │ │ virtual void set_str (int name, std::string val) = 0; │ │ │ │ │ - virtual void set_int (int name, int val) = 0; │ │ │ │ │ - virtual bool get_bool (int name) const = 0; │ │ │ │ │ - virtual int get_int (int name) const = 0; │ │ │ │ │ + virtual bool has_val (int name) const = 0; │ │ │ │ │ virtual std::string const& get_str (int name) const = 0; │ │ │ │ │ + virtual int get_int (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 │ │ │ │ │ write_only │ │ │ │ │ @@ -6469,15 +6469,15 @@ │ │ │ │ │ char const* old_name () const; │ │ │ │ │ │ │ │ │ │ static constexpr alert_category_t static_category = alert_category:: │ │ │ │ │ storage; │ │ │ │ │ file_index_t const index; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** old_name() new_name() ***** │ │ │ │ │ +***** new_name() old_name() ***** │ │ │ │ │ char const* new_name () const; │ │ │ │ │ char const* old_name () const; │ │ │ │ │ returns the new and previous file name, respectively. │ │ │ │ │ [report_issue] │ │ │ │ │ index │ │ │ │ │ refers to the index of the file that was renamed, │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -7103,15 +7103,15 @@ │ │ │ │ │ char const* old_path () const; │ │ │ │ │ char const* storage_path () const; │ │ │ │ │ │ │ │ │ │ static constexpr alert_category_t static_category = alert_category:: │ │ │ │ │ storage; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** old_path() storage_path() ***** │ │ │ │ │ +***** storage_path() old_path() ***** │ │ │ │ │ char const* old_path () const; │ │ │ │ │ char const* storage_path () const; │ │ │ │ │ the path the torrent was moved to and from, respectively. │ │ │ │ │ [report_issue] │ │ │ │ │ ****** storage_moved_failed_alert ****** │ │ │ │ │ Declared in "libtorrent/alert_types.hpp" │ │ │ │ │ The storage_moved_failed_alert is generated when an attempt to move the │ │ │ │ │ @@ -8356,15 +8356,15 @@ │ │ │ │ │ std::vector> nodes () const; │ │ │ │ │ int num_nodes () const; │ │ │ │ │ │ │ │ │ │ static constexpr alert_category_t static_category = alert_category::dht; │ │ │ │ │ sha1_hash node_id; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** num_nodes() nodes() ***** │ │ │ │ │ +***** nodes() num_nodes() ***** │ │ │ │ │ std::vector> nodes () const; │ │ │ │ │ int num_nodes () const; │ │ │ │ │ the number of nodes in the routing table and the actual nodes. │ │ │ │ │ [report_issue] │ │ │ │ │ node_id │ │ │ │ │ the local DHT node's node-ID this routing table belongs to │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -8387,30 +8387,30 @@ │ │ │ │ │ ****** dht_sample_infohashes_alert ****** │ │ │ │ │ Declared in "libtorrent/alert_types.hpp" │ │ │ │ │ posted as a response to a call to session::dht_sample_infohashes() with the │ │ │ │ │ information from the DHT response message. │ │ │ │ │ struct dht_sample_infohashes_alert final : alert │ │ │ │ │ { │ │ │ │ │ std::string message () const override; │ │ │ │ │ - std::vector samples () const; │ │ │ │ │ int num_samples () const; │ │ │ │ │ + std::vector samples () const; │ │ │ │ │ int num_nodes () const; │ │ │ │ │ std::vector> nodes () const; │ │ │ │ │ │ │ │ │ │ static constexpr alert_category_t static_category = alert_category:: │ │ │ │ │ dht_operation; │ │ │ │ │ sha1_hash node_id; │ │ │ │ │ aux::noexcept_movable endpoint; │ │ │ │ │ time_duration const interval; │ │ │ │ │ int const num_infohashes; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** num_samples() samples() ***** │ │ │ │ │ -std::vector samples () const; │ │ │ │ │ +***** samples() num_samples() ***** │ │ │ │ │ int num_samples () const; │ │ │ │ │ +std::vector samples () const; │ │ │ │ │ returns the number of info-hashes returned by the node, as well as the actual │ │ │ │ │ info-hashes. num_samples() is more efficient than samples().size(). │ │ │ │ │ [report_issue] │ │ │ │ │ ***** num_nodes() ***** │ │ │ │ │ int num_nodes () const; │ │ │ │ │ The total number of nodes returned by nodes(). │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -8559,16 +8559,16 @@ │ │ │ │ │ metadata │ │ │ │ │ the metadata that was received by one of the torrents in conflict. One │ │ │ │ │ way to resolve the conflict is to remove both failing torrents and re-add │ │ │ │ │ it using this metadata │ │ │ │ │ [report_issue] │ │ │ │ │ ****** alert_cast() ****** │ │ │ │ │ Declared in "libtorrent/alert.hpp" │ │ │ │ │ -template T* alert_cast (alert* a); │ │ │ │ │ template T const* alert_cast (alert const* a); │ │ │ │ │ +template T* alert_cast (alert* a); │ │ │ │ │ When you get an alert, you can use alert_cast<> to attempt to cast the pointer │ │ │ │ │ to a specific alert type, in order to query it for more information. │ │ │ │ │ Note │ │ │ │ │ alert_cast<> can only cast to an exact alert type, not a base class │ │ │ │ │ [report_issue] │ │ │ │ │ ****** operation_name() ****** │ │ │ │ │ Declared in "libtorrent/operations.hpp" │ │ │ │ │ @@ -8726,23 +8726,23 @@ │ │ │ │ │ ****** counters ****** │ │ │ │ │ Declared in "libtorrent/performance_counters.hpp" │ │ │ │ │ struct counters │ │ │ │ │ { │ │ │ │ │ counters () ; │ │ │ │ │ counters& operator= (counters const&) & ; │ │ │ │ │ counters (counters const&) ; │ │ │ │ │ - std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ; │ │ │ │ │ std::int64_t operator[] (int i) const ; │ │ │ │ │ + std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ; │ │ │ │ │ void blend_stats_counter (int c, std::int64_t value, int ratio) ; │ │ │ │ │ void set_value (int c, std::int64_t value) ; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** inc_stats_counter() operator[]() ***** │ │ │ │ │ -std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ; │ │ │ │ │ +***** operator[]() inc_stats_counter() ***** │ │ │ │ │ std::int64_t operator[] (int i) const ; │ │ │ │ │ +std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ; │ │ │ │ │ returns the new value │ │ │ │ │ [report_issue] │ │ │ │ │ ****** stats_metric ****** │ │ │ │ │ Declared in "libtorrent/session_stats.hpp" │ │ │ │ │ describes one statistics metric from the session. For more information, see the │ │ │ │ │ session_statistics section. │ │ │ │ │ struct stats_metric │ │ │ │ │ @@ -8788,20 +8788,20 @@ │ │ │ │ │ The ip_filter class is a set of rules that uniquely categorizes all ip │ │ │ │ │ addresses as allowed or disallowed. The default constructor creates a single │ │ │ │ │ rule that allows all addresses (0.0.0.0 - 255.255.255.255 for the IPv4 range, │ │ │ │ │ and the equivalent range covering all addresses for the IPv6 range). │ │ │ │ │ A default constructed ip_filter does not filter any address. │ │ │ │ │ struct ip_filter │ │ │ │ │ { │ │ │ │ │ + ip_filter& operator= (ip_filter const&); │ │ │ │ │ ip_filter (); │ │ │ │ │ ip_filter& operator= (ip_filter&&); │ │ │ │ │ - ~ip_filter (); │ │ │ │ │ - ip_filter (ip_filter&&); │ │ │ │ │ ip_filter (ip_filter const&); │ │ │ │ │ - ip_filter& operator= (ip_filter const&); │ │ │ │ │ + ip_filter (ip_filter&&); │ │ │ │ │ + ~ip_filter (); │ │ │ │ │ bool empty () const; │ │ │ │ │ void add_rule (address const& first, address const& last, std::uint32_t │ │ │ │ │ flags); │ │ │ │ │ std::uint32_t access (address const& addr) const; │ │ │ │ │ filter_tuple_t export_filter () const; │ │ │ │ │ │ │ │ │ │ enum access_flags │ │ │ │ │ @@ -8851,19 +8851,19 @@ │ │ │ │ │ Declared in "libtorrent/ip_filter.hpp" │ │ │ │ │ the port filter maps non-overlapping port ranges to flags. This is primarily │ │ │ │ │ used to indicate whether a range of ports should be connected to or not. The │ │ │ │ │ default is to have the full port range (0-65535) set to flag 0. │ │ │ │ │ class port_filter │ │ │ │ │ { │ │ │ │ │ port_filter (); │ │ │ │ │ - port_filter (port_filter&&); │ │ │ │ │ - port_filter& operator= (port_filter&&); │ │ │ │ │ port_filter (port_filter const&); │ │ │ │ │ + port_filter (port_filter&&); │ │ │ │ │ ~port_filter (); │ │ │ │ │ port_filter& operator= (port_filter const&); │ │ │ │ │ + port_filter& operator= (port_filter&&); │ │ │ │ │ void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t │ │ │ │ │ flags); │ │ │ │ │ std::uint32_t access (std::uint16_t port) const; │ │ │ │ │ │ │ │ │ │ enum access_flags │ │ │ │ │ { │ │ │ │ │ blocked, │ │ │ │ │ @@ -8905,46 +8905,46 @@ │ │ │ │ │ Declared in "libtorrent/entry.hpp" │ │ │ │ │ The entry class represents one node in a bencoded hierarchy. It works as a │ │ │ │ │ variant type, it can be either a list, a dictionary (std::map), an integer or a │ │ │ │ │ string. │ │ │ │ │ class entry │ │ │ │ │ { │ │ │ │ │ data_type type () const; │ │ │ │ │ + entry (preformatted_type); │ │ │ │ │ entry (dictionary_type); │ │ │ │ │ - entry (integer_type); │ │ │ │ │ - entry (list_type); │ │ │ │ │ entry (span); │ │ │ │ │ - entry (preformatted_type); │ │ │ │ │ + entry (list_type); │ │ │ │ │ + entry (integer_type); │ │ │ │ │ entry (U v); │ │ │ │ │ entry (data_type t); │ │ │ │ │ entry (bdecode_node const& n); │ │ │ │ │ entry& operator= (span) &; │ │ │ │ │ - entry& operator= (entry&&) & noexcept; │ │ │ │ │ + entry& operator= (bdecode_node const&) &; │ │ │ │ │ entry& operator= (list_type) &; │ │ │ │ │ entry& operator= (preformatted_type) &; │ │ │ │ │ - entry& operator= (bdecode_node const&) &; │ │ │ │ │ - entry& operator= (integer_type) &; │ │ │ │ │ - entry& operator= (entry const&) &; │ │ │ │ │ entry& operator= (dictionary_type) &; │ │ │ │ │ + entry& operator= (entry const&) &; │ │ │ │ │ + entry& operator= (integer_type) &; │ │ │ │ │ + entry& operator= (entry&&) & noexcept; │ │ │ │ │ entry& operator= (U v) &; │ │ │ │ │ integer_type& integer (); │ │ │ │ │ - integer_type const& integer () const; │ │ │ │ │ string_type& string (); │ │ │ │ │ dictionary_type& dict (); │ │ │ │ │ + dictionary_type const& dict () const; │ │ │ │ │ preformatted_type const& preformatted () const; │ │ │ │ │ list_type& list (); │ │ │ │ │ preformatted_type& preformatted (); │ │ │ │ │ - string_type const& string () const; │ │ │ │ │ - dictionary_type const& dict () const; │ │ │ │ │ list_type const& list () const; │ │ │ │ │ + integer_type const& integer () const; │ │ │ │ │ + string_type const& string () const; │ │ │ │ │ void swap (entry& e); │ │ │ │ │ - entry& operator[] (string_view key); │ │ │ │ │ entry const& operator[] (string_view key) const; │ │ │ │ │ - entry const* find_key (string_view key) const; │ │ │ │ │ + entry& operator[] (string_view key); │ │ │ │ │ entry* find_key (string_view key); │ │ │ │ │ + entry const* find_key (string_view key) const; │ │ │ │ │ std::string to_string (bool single_line = false) const; │ │ │ │ │ │ │ │ │ │ enum data_type │ │ │ │ │ { │ │ │ │ │ int_t, │ │ │ │ │ string_t, │ │ │ │ │ list_t, │ │ │ │ │ @@ -8955,52 +8955,52 @@ │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** type() ***** │ │ │ │ │ data_type type () const; │ │ │ │ │ returns the concrete type of the entry │ │ │ │ │ [report_issue] │ │ │ │ │ ***** entry() ***** │ │ │ │ │ +entry (preformatted_type); │ │ │ │ │ entry (dictionary_type); │ │ │ │ │ -entry (integer_type); │ │ │ │ │ -entry (list_type); │ │ │ │ │ entry (span); │ │ │ │ │ -entry (preformatted_type); │ │ │ │ │ +entry (list_type); │ │ │ │ │ +entry (integer_type); │ │ │ │ │ constructors directly from a specific type. The content of the argument is │ │ │ │ │ copied into the newly constructed entry │ │ │ │ │ [report_issue] │ │ │ │ │ ***** entry() ***** │ │ │ │ │ entry (data_type t); │ │ │ │ │ construct an empty entry of the specified type. see data_type enum. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** entry() ***** │ │ │ │ │ entry (bdecode_node const& n); │ │ │ │ │ construct from bdecode_node parsed form (see bdecode()) │ │ │ │ │ [report_issue] │ │ │ │ │ ***** operator=() ***** │ │ │ │ │ entry& operator= (span) &; │ │ │ │ │ -entry& operator= (entry&&) & noexcept; │ │ │ │ │ +entry& operator= (bdecode_node const&) &; │ │ │ │ │ entry& operator= (list_type) &; │ │ │ │ │ entry& operator= (preformatted_type) &; │ │ │ │ │ -entry& operator= (bdecode_node const&) &; │ │ │ │ │ -entry& operator= (integer_type) &; │ │ │ │ │ -entry& operator= (entry const&) &; │ │ │ │ │ entry& operator= (dictionary_type) &; │ │ │ │ │ +entry& operator= (entry const&) &; │ │ │ │ │ +entry& operator= (integer_type) &; │ │ │ │ │ +entry& operator= (entry&&) & noexcept; │ │ │ │ │ copies the structure of the right hand side into this entry. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** dict() preformatted() integer() list() string() ***** │ │ │ │ │ +***** integer() string() list() preformatted() dict() ***** │ │ │ │ │ integer_type& integer (); │ │ │ │ │ -integer_type const& integer () const; │ │ │ │ │ string_type& string (); │ │ │ │ │ dictionary_type& dict (); │ │ │ │ │ +dictionary_type const& dict () const; │ │ │ │ │ preformatted_type const& preformatted () const; │ │ │ │ │ list_type& list (); │ │ │ │ │ preformatted_type& preformatted (); │ │ │ │ │ -string_type const& string () const; │ │ │ │ │ -dictionary_type const& dict () const; │ │ │ │ │ list_type const& list () const; │ │ │ │ │ +integer_type const& integer () const; │ │ │ │ │ +string_type const& string () const; │ │ │ │ │ The integer(), string(), list() and dict() functions are accessors that return │ │ │ │ │ the respective type. If the entry object isn't of the type you request, the │ │ │ │ │ accessor will throw system_error. You can ask an entry for its type through the │ │ │ │ │ type() function. │ │ │ │ │ If you want to create an entry you give it the type you want it to have in its │ │ │ │ │ constructor, and then use one of the non-const accessors to get a reference │ │ │ │ │ which you then can assign the value you want it to have. │ │ │ │ │ @@ -9031,27 +9031,27 @@ │ │ │ │ │ torrent_info exists. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** swap() ***** │ │ │ │ │ void swap (entry& e); │ │ │ │ │ swaps the content of this with e. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** operator[]() ***** │ │ │ │ │ -entry& operator[] (string_view key); │ │ │ │ │ entry const& operator[] (string_view key) const; │ │ │ │ │ +entry& operator[] (string_view key); │ │ │ │ │ All of these functions requires the entry to be a dictionary, if it isn't they │ │ │ │ │ will throw system_error. │ │ │ │ │ The non-const versions of the operator[] will return a reference to either the │ │ │ │ │ existing element at the given key or, if there is no element with the given │ │ │ │ │ key, a reference to a newly inserted element at that key. │ │ │ │ │ The const version of operator[] will only return a reference to an existing │ │ │ │ │ element at the given key. If the key is not found, it will throw system_error. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** find_key() ***** │ │ │ │ │ -entry const* find_key (string_view key) const; │ │ │ │ │ entry* find_key (string_view key); │ │ │ │ │ +entry const* find_key (string_view key) const; │ │ │ │ │ These functions requires the entry to be a dictionary, if it isn't they will │ │ │ │ │ throw system_error. │ │ │ │ │ They will look for an element at the given key in the dictionary, if the │ │ │ │ │ element cannot be found, they will return nullptr. If an element with the given │ │ │ │ │ key is found, the return a pointer to it. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** to_string() ***** │ │ │ │ │ @@ -9127,28 +9127,28 @@ │ │ │ │ │ Declared in "libtorrent/create_torrent.hpp" │ │ │ │ │ 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 = {}); │ │ │ │ │ - entry generate () const; │ │ │ │ │ + explicit create_torrent (torrent_info const& ti); │ │ │ │ │ std::vector 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_http_seed (string_view url); │ │ │ │ │ void add_url_seed (string_view url); │ │ │ │ │ + void add_http_seed (string_view url); │ │ │ │ │ void add_node (std::pair node); │ │ │ │ │ void add_tracker (string_view url, int tier = 0); │ │ │ │ │ void set_root_cert (string_view cert); │ │ │ │ │ bool priv () const; │ │ │ │ │ void set_priv (bool p); │ │ │ │ │ bool is_v1_only () const; │ │ │ │ │ bool is_v2_only () const; │ │ │ │ │ @@ -9170,17 +9170,17 @@ │ │ │ │ │ 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. │ │ │ │ │ The flags arguments specifies options for the torrent creation. It can be any │ │ │ │ │ combination of the flags defined by create_flags_t. │ │ │ │ │ The file_storage (fs) parameter defines the files, sizes and their properties │ │ │ │ │ for the torrent to be created. Set this up first, before passing it to the │ │ │ │ │ @@ -9191,17 +9191,17 @@ │ │ │ │ │ functions of create_torrent that affects the content of the info dictionary │ │ │ │ │ (such as set_hash()), will have any affect. Instead of using this overload, │ │ │ │ │ consider using write_torrent_file() instead. │ │ │ │ │ Warning │ │ │ │ │ The file_storage and torrent_info objects must stay alive for the entire │ │ │ │ │ duration of the create_torrent object. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** generate() generate_buf() ***** │ │ │ │ │ -entry generate () const; │ │ │ │ │ +***** generate_buf() generate() ***** │ │ │ │ │ std::vector 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 whether any │ │ │ │ │ of the v1_only or v2_only flags were set on the constructor. If neither were │ │ │ │ │ @@ -9258,17 +9258,17 @@ │ │ │ │ │ the merkle tree formed by the piece's 16 kiB blocks. Note that piece sizes must │ │ │ │ │ be powers-of-2, so all per-piece merkle trees are complete. A SHA-256 hash of │ │ │ │ │ all zeros is internally used to indicate a hash that has not been set. Setting │ │ │ │ │ such hash will not be considered set when calling generate(). This function │ │ │ │ │ will throw std::system_error if it is called on an object constructed with the │ │ │ │ │ v1_only flag. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** add_url_seed() add_http_seed() ***** │ │ │ │ │ -void add_http_seed (string_view url); │ │ │ │ │ +***** add_http_seed() add_url_seed() ***** │ │ │ │ │ void add_url_seed (string_view url); │ │ │ │ │ +void add_http_seed (string_view url); │ │ │ │ │ This adds a url seed to the torrent. You can have any number of url seeds. For │ │ │ │ │ a single file torrent, this should be an HTTP url, pointing to a file with │ │ │ │ │ identical content as the file of the torrent. For a multi-file torrent, it │ │ │ │ │ should point to a directory containing a directory with the same name as this │ │ │ │ │ torrent, and all the files of the torrent in it. │ │ │ │ │ The second function, add_http_seed() adds an HTTP seed instead. │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -9408,30 +9408,30 @@ │ │ │ │ │ directories are traversed. │ │ │ │ │ The ".." directory is never traversed. │ │ │ │ │ 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" │ │ │ │ │ -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 const& f, error_code& ec); │ │ │ │ │ void set_piece_hashes (create_torrent& t, std::string const& p │ │ │ │ │ , settings_interface const& settings │ │ │ │ │ , std::function const& f, error_code& ec); │ │ │ │ │ -void set_piece_hashes (create_torrent& t, std::string const& p │ │ │ │ │ - , std::function const& f, error_code& ec); │ │ │ │ │ -inline void set_piece_hashes (create_torrent& t, std::string const& p │ │ │ │ │ - , std::function const& f); │ │ │ │ │ inline void set_piece_hashes (create_torrent& t, std::string const& p │ │ │ │ │ , settings_interface const& settings │ │ │ │ │ , std::function const& f); │ │ │ │ │ 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); │ │ │ │ │ +inline void set_piece_hashes (create_torrent& t, std::string const& p │ │ │ │ │ + , std::function const& f); │ │ │ │ │ +void set_piece_hashes (create_torrent& t, std::string const& p │ │ │ │ │ + , settings_interface const& settings, disk_io_constructor_type disk_io │ │ │ │ │ + , std::function const& f, error_code& ec); │ │ │ │ │ +void set_piece_hashes (create_torrent& t, std::string const& p │ │ │ │ │ + , std::function const& f, 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 settings_pack may be used to configure the underlying │ │ │ │ │ disk access. Such as settings_pack::aio_threads. │ │ │ │ │ @@ -9442,24 +9442,24 @@ │ │ │ │ │ ****** bitfield ****** │ │ │ │ │ Declared in "libtorrent/bitfield.hpp" │ │ │ │ │ The bitfield type stores any number of bits as a bitfield in a heap allocated │ │ │ │ │ array. │ │ │ │ │ struct bitfield │ │ │ │ │ { │ │ │ │ │ bitfield (int bits, bool val); │ │ │ │ │ + bitfield (bitfield&& rhs) noexcept = default; │ │ │ │ │ bitfield () noexcept = default; │ │ │ │ │ bitfield (char const* b, int bits); │ │ │ │ │ - explicit bitfield (int bits); │ │ │ │ │ - bitfield (bitfield&& rhs) noexcept = default; │ │ │ │ │ bitfield (bitfield const& rhs); │ │ │ │ │ + explicit bitfield (int bits); │ │ │ │ │ void assign (char const* b, int const bits); │ │ │ │ │ bool get_bit (int index) const noexcept; │ │ │ │ │ bool operator[] (int index) const noexcept; │ │ │ │ │ - void clear_bit (int index) noexcept; │ │ │ │ │ void set_bit (int index) noexcept; │ │ │ │ │ + void clear_bit (int index) noexcept; │ │ │ │ │ bool all_set () const noexcept; │ │ │ │ │ bool none_set () const noexcept; │ │ │ │ │ int size () const noexcept; │ │ │ │ │ int num_words () const noexcept; │ │ │ │ │ bool empty () const noexcept; │ │ │ │ │ char const* data () const noexcept; │ │ │ │ │ char* data () noexcept; │ │ │ │ │ @@ -9467,39 +9467,39 @@ │ │ │ │ │ int count () const noexcept; │ │ │ │ │ int find_first_set () const noexcept; │ │ │ │ │ int find_last_clear () const noexcept; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** bitfield() ***** │ │ │ │ │ bitfield (int bits, bool val); │ │ │ │ │ +bitfield (bitfield&& rhs) noexcept = default; │ │ │ │ │ bitfield () noexcept = default; │ │ │ │ │ bitfield (char const* b, int bits); │ │ │ │ │ -explicit bitfield (int bits); │ │ │ │ │ -bitfield (bitfield&& rhs) noexcept = default; │ │ │ │ │ bitfield (bitfield const& rhs); │ │ │ │ │ +explicit bitfield (int bits); │ │ │ │ │ constructs a new bitfield. The default constructor creates an empty bitfield. │ │ │ │ │ bits is the size of the bitfield (specified in bits). val is the value to │ │ │ │ │ initialize the bits to. If not specified all bits are initialized to 0. │ │ │ │ │ The constructor taking a pointer b and bits copies a bitfield from the │ │ │ │ │ specified buffer, and bits number of bits (rounded up to the nearest byte │ │ │ │ │ boundary). │ │ │ │ │ [report_issue] │ │ │ │ │ ***** assign() ***** │ │ │ │ │ void assign (char const* b, int const bits); │ │ │ │ │ copy bitfield from buffer b of bits number of bits, rounded up to the nearest │ │ │ │ │ byte boundary. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** operator[]() get_bit() ***** │ │ │ │ │ +***** get_bit() operator[]() ***** │ │ │ │ │ bool get_bit (int index) const noexcept; │ │ │ │ │ bool operator[] (int index) const noexcept; │ │ │ │ │ query bit at index. Returns true if bit is 1, otherwise false. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** clear_bit() set_bit() ***** │ │ │ │ │ -void clear_bit (int index) noexcept; │ │ │ │ │ +***** set_bit() clear_bit() ***** │ │ │ │ │ void set_bit (int index) noexcept; │ │ │ │ │ +void clear_bit (int index) noexcept; │ │ │ │ │ set bit at index to 0 (clear_bit) or 1 (set_bit). │ │ │ │ │ [report_issue] │ │ │ │ │ ***** all_set() ***** │ │ │ │ │ bool all_set () const noexcept; │ │ │ │ │ returns true if all bits in the bitfield are set │ │ │ │ │ [report_issue] │ │ │ │ │ ***** none_set() ***** │ │ │ │ │ @@ -9554,35 +9554,35 @@ │ │ │ │ │ If you want to reuse the hasher object once you have created a hash, you have │ │ │ │ │ to call reset() to reinitialize it. │ │ │ │ │ The built-in software version of sha1-algorithm was implemented by Steve Reid │ │ │ │ │ and released as public domain. For more info, see src/sha1.cpp. │ │ │ │ │ class hasher │ │ │ │ │ { │ │ │ │ │ hasher (); │ │ │ │ │ - explicit hasher (span data); │ │ │ │ │ hasher (hasher const&); │ │ │ │ │ - hasher (char const* data, int len); │ │ │ │ │ hasher& operator= (hasher const&) &; │ │ │ │ │ - hasher& update (char const* data, int len); │ │ │ │ │ + explicit hasher (span data); │ │ │ │ │ + hasher (char const* data, int len); │ │ │ │ │ hasher& update (span data); │ │ │ │ │ + hasher& update (char const* data, int len); │ │ │ │ │ sha1_hash final (); │ │ │ │ │ void reset (); │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** operator=() hasher() ***** │ │ │ │ │ -explicit hasher (span data); │ │ │ │ │ hasher (hasher const&); │ │ │ │ │ -hasher (char const* data, int len); │ │ │ │ │ hasher& operator= (hasher const&) &; │ │ │ │ │ +explicit hasher (span data); │ │ │ │ │ +hasher (char const* data, int len); │ │ │ │ │ this is the same as default constructing followed by a call to update(data, │ │ │ │ │ len). │ │ │ │ │ [report_issue] │ │ │ │ │ ***** update() ***** │ │ │ │ │ -hasher& update (char const* data, int len); │ │ │ │ │ hasher& update (span data); │ │ │ │ │ +hasher& update (char const* data, int len); │ │ │ │ │ append the following bytes to what is being hashed │ │ │ │ │ [report_issue] │ │ │ │ │ ***** final() ***** │ │ │ │ │ sha1_hash final (); │ │ │ │ │ returns the SHA-1 digest of the buffers previously passed to update() and the │ │ │ │ │ hasher constructor. │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -9592,36 +9592,36 @@ │ │ │ │ │ constructed. │ │ │ │ │ [report_issue] │ │ │ │ │ ****** hasher256 ****** │ │ │ │ │ Declared in "libtorrent/hasher.hpp" │ │ │ │ │ class hasher256 │ │ │ │ │ { │ │ │ │ │ hasher256 (); │ │ │ │ │ - hasher256 (hasher256 const&); │ │ │ │ │ - explicit hasher256 (span data); │ │ │ │ │ hasher256 (char const* data, int len); │ │ │ │ │ + explicit hasher256 (span data); │ │ │ │ │ + hasher256 (hasher256 const&); │ │ │ │ │ hasher256& operator= (hasher256 const&) &; │ │ │ │ │ - hasher256& update (char const* data, int len); │ │ │ │ │ hasher256& update (span data); │ │ │ │ │ + hasher256& update (char const* data, int len); │ │ │ │ │ sha256_hash final (); │ │ │ │ │ void reset (); │ │ │ │ │ ~hasher256 (); │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** operator=() hasher256() ***** │ │ │ │ │ -hasher256 (hasher256 const&); │ │ │ │ │ -explicit hasher256 (span data); │ │ │ │ │ hasher256 (char const* data, int len); │ │ │ │ │ +explicit hasher256 (span data); │ │ │ │ │ +hasher256 (hasher256 const&); │ │ │ │ │ hasher256& operator= (hasher256 const&) &; │ │ │ │ │ this is the same as default constructing followed by a call to update(data, │ │ │ │ │ len). │ │ │ │ │ [report_issue] │ │ │ │ │ ***** update() ***** │ │ │ │ │ -hasher256& update (char const* data, int len); │ │ │ │ │ hasher256& update (span data); │ │ │ │ │ +hasher256& update (char const* data, int len); │ │ │ │ │ append the following bytes to what is being hashed │ │ │ │ │ [report_issue] │ │ │ │ │ ***** final() ***** │ │ │ │ │ sha256_hash final (); │ │ │ │ │ returns the SHA-1 digest of the buffers previously passed to update() and the │ │ │ │ │ hasher constructor. │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -10176,19 +10176,19 @@ │ │ │ │ │ [report_issue] │ │ │ │ │ ****** announce_entry ****** │ │ │ │ │ Declared in "libtorrent/announce_entry.hpp" │ │ │ │ │ this class holds information about one bittorrent tracker, as it relates to a │ │ │ │ │ specific torrent. │ │ │ │ │ struct announce_entry │ │ │ │ │ { │ │ │ │ │ - ~announce_entry (); │ │ │ │ │ - announce_entry (announce_entry const&); │ │ │ │ │ + announce_entry& operator= (announce_entry const&) &; │ │ │ │ │ announce_entry (); │ │ │ │ │ + announce_entry (announce_entry const&); │ │ │ │ │ explicit announce_entry (string_view u); │ │ │ │ │ - announce_entry& operator= (announce_entry const&) &; │ │ │ │ │ + ~announce_entry (); │ │ │ │ │ │ │ │ │ │ enum tracker_source │ │ │ │ │ { │ │ │ │ │ source_torrent, │ │ │ │ │ source_client, │ │ │ │ │ source_magnet_link, │ │ │ │ │ source_tex, │ │ │ │ │ @@ -10200,19 +10200,19 @@ │ │ │ │ │ std::uint8_t tier = 0; │ │ │ │ │ std::uint8_t fail_limit = 0; │ │ │ │ │ std::uint8_t source:4; │ │ │ │ │ bool verified:1; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** operator=() announce_entry() ~announce_entry() ***** │ │ │ │ │ -~announce_entry (); │ │ │ │ │ -announce_entry (announce_entry const&); │ │ │ │ │ +announce_entry& operator= (announce_entry const&) &; │ │ │ │ │ announce_entry (); │ │ │ │ │ +announce_entry (announce_entry const&); │ │ │ │ │ explicit announce_entry (string_view u); │ │ │ │ │ -announce_entry& operator= (announce_entry const&) &; │ │ │ │ │ +~announce_entry (); │ │ │ │ │ constructs a tracker announce entry with u as the URL. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** enum tracker_source ***** │ │ │ │ │ Declared in "libtorrent/announce_entry.hpp" │ │ │ │ │ ____________________________________________________________________________ │ │ │ │ │ |name______________|value|description________________________________________| │ │ │ │ │ |source_torrent____|1____|the_tracker_was_part_of_the_.torrent_file__________| │ │ │ │ │ @@ -11641,24 +11641,24 @@ │ │ │ │ │ memory mapped, but will use normal pread/pwrite operations. This file size │ │ │ │ │ limit is specified in 16 kiB blocks. │ │ │ │ │ struct settings_pack final : settings_interface │ │ │ │ │ { │ │ │ │ │ friend void apply_pack_impl (settings_pack const* │ │ │ │ │ , aux::session_settings_single_thread& │ │ │ │ │ , std::vector*); │ │ │ │ │ - void set_str (int name, std::string val) override; │ │ │ │ │ void set_int (int name, flags::bitfield_flag const val); │ │ │ │ │ - void set_int (int name, int val) override; │ │ │ │ │ + void set_str (int name, std::string val) override; │ │ │ │ │ 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); │ │ │ │ │ + int get_int (int name) const override; │ │ │ │ │ std::string const& get_str (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, │ │ │ │ │ @@ -11729,19 +11729,19 @@ │ │ │ │ │ socks5_pw, │ │ │ │ │ http, │ │ │ │ │ http_pw, │ │ │ │ │ i2p_proxy, │ │ │ │ │ }; │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ -***** set_bool() set_int() set_str() ***** │ │ │ │ │ -void set_str (int name, std::string val) override; │ │ │ │ │ +***** set_str() set_int() set_bool() ***** │ │ │ │ │ void set_int (int name, flags::bitfield_flag const val); │ │ │ │ │ -void set_int (int name, int val) override; │ │ │ │ │ +void set_str (int name, std::string val) override; │ │ │ │ │ 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] │ │ │ │ │ ***** has_val() ***** │ │ │ │ │ bool has_val (int name) const override; │ │ │ │ │ queries whether the specified configuration option has a value set in this │ │ │ │ │ @@ -11752,18 +11752,18 @@ │ │ │ │ │ void clear (); │ │ │ │ │ clear the settings pack from all settings │ │ │ │ │ [report_issue] │ │ │ │ │ ***** clear() ***** │ │ │ │ │ void clear (int name); │ │ │ │ │ clear a specific setting from the pack │ │ │ │ │ [report_issue] │ │ │ │ │ -***** get_int() get_str() get_bool() ***** │ │ │ │ │ +***** get_bool() get_int() get_str() ***** │ │ │ │ │ +int get_int (int name) const override; │ │ │ │ │ std::string const& get_str (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] │ │ │ │ │ ***** enum type_bases ***** │ │ │ │ │ Declared in "libtorrent/settings_pack.hpp" │ │ │ │ │ @@ -11916,15 +11916,15 @@ │ │ │ │ │ |DE______|Deluge______________| │ │ │ │ │ |AZ______|Azureus_____________| │ │ │ │ │ |TL______|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() ****** │ │ │ │ │ +****** high_performance_seed() min_memory_usage() ****** │ │ │ │ │ Declared in "libtorrent/session.hpp" │ │ │ │ │ settings_pack min_memory_usage (); │ │ │ │ │ settings_pack high_performance_seed (); │ │ │ │ │ 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. │ │ │ │ │ @@ -11961,45 +11961,45 @@ │ │ │ │ │ Sometimes it's important to get a non-owning reference to the root node ( to be │ │ │ │ │ able to copy it as a reference for instance). For that, use the non_owning() │ │ │ │ │ member function. │ │ │ │ │ There are 5 different types of nodes, see type_t. │ │ │ │ │ struct bdecode_node │ │ │ │ │ { │ │ │ │ │ bdecode_node () = default; │ │ │ │ │ - bdecode_node (bdecode_node const&); │ │ │ │ │ bdecode_node& operator= (bdecode_node&&) & = default; │ │ │ │ │ - bdecode_node& operator= (bdecode_node const&) &; │ │ │ │ │ bdecode_node (bdecode_node&&) noexcept; │ │ │ │ │ + bdecode_node& operator= (bdecode_node const&) &; │ │ │ │ │ + bdecode_node (bdecode_node const&); │ │ │ │ │ type_t type () const noexcept; │ │ │ │ │ explicit operator bool () const noexcept; │ │ │ │ │ bdecode_node non_owning () const; │ │ │ │ │ - span data_section () const noexcept; │ │ │ │ │ std::ptrdiff_t data_offset () const noexcept; │ │ │ │ │ + span data_section () const noexcept; │ │ │ │ │ std::int64_t list_int_value_at (int i │ │ │ │ │ , std::int64_t default_val = 0) const; │ │ │ │ │ + bdecode_node list_at (int i) const; │ │ │ │ │ int list_size () const; │ │ │ │ │ string_view list_string_value_at (int i │ │ │ │ │ , string_view default_val = string_view()) const; │ │ │ │ │ - bdecode_node list_at (int i) const; │ │ │ │ │ + std::pair dict_at (int i) const; │ │ │ │ │ + bdecode_node dict_find_int (string_view key) const; │ │ │ │ │ bdecode_node dict_find_list (string_view key) const; │ │ │ │ │ + std::pair dict_at_node (int i) const; │ │ │ │ │ + bdecode_node dict_find (string_view key) const; │ │ │ │ │ string_view dict_find_string_value (string_view key │ │ │ │ │ , string_view default_value = string_view()) const; │ │ │ │ │ - bdecode_node dict_find_int (string_view key) const; │ │ │ │ │ - std::pair dict_at_node (int i) const; │ │ │ │ │ std::int64_t dict_find_int_value (string_view key │ │ │ │ │ , std::int64_t default_val = 0) const; │ │ │ │ │ - bdecode_node dict_find (string_view key) const; │ │ │ │ │ + int dict_size () const; │ │ │ │ │ bdecode_node dict_find_dict (string_view key) const; │ │ │ │ │ bdecode_node dict_find_string (string_view key) const; │ │ │ │ │ - int dict_size () const; │ │ │ │ │ - std::pair dict_at (int i) const; │ │ │ │ │ std::int64_t int_value () const; │ │ │ │ │ - string_view string_value () const; │ │ │ │ │ std::ptrdiff_t string_offset () const; │ │ │ │ │ int string_length () const; │ │ │ │ │ + string_view string_value () const; │ │ │ │ │ char const* string_ptr () const; │ │ │ │ │ void clear (); │ │ │ │ │ void swap (bdecode_node& n); │ │ │ │ │ void reserve (int tokens); │ │ │ │ │ void switch_underlying_buffer (char const* buf) noexcept; │ │ │ │ │ bool has_soft_error (span error) const; │ │ │ │ │ │ │ │ │ │ @@ -12014,18 +12014,18 @@ │ │ │ │ │ }; │ │ │ │ │ [report_issue] │ │ │ │ │ ***** bdecode_node() ***** │ │ │ │ │ bdecode_node () = default; │ │ │ │ │ creates a default constructed node, it will have the type none_t. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** bdecode_node() operator=() ***** │ │ │ │ │ -bdecode_node (bdecode_node const&); │ │ │ │ │ bdecode_node& operator= (bdecode_node&&) & = default; │ │ │ │ │ -bdecode_node& operator= (bdecode_node const&) &; │ │ │ │ │ bdecode_node (bdecode_node&&) noexcept; │ │ │ │ │ +bdecode_node& operator= (bdecode_node const&) &; │ │ │ │ │ +bdecode_node (bdecode_node const&); │ │ │ │ │ For owning nodes, the copy will create a copy of the tree, but the underlying │ │ │ │ │ buffer remains the same. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** type() ***** │ │ │ │ │ type_t type () const noexcept; │ │ │ │ │ the type of this node. See type_t. │ │ │ │ │ [report_issue] │ │ │ │ │ @@ -12035,49 +12035,49 @@ │ │ │ │ │ [report_issue] │ │ │ │ │ ***** non_owning() ***** │ │ │ │ │ bdecode_node non_owning () const; │ │ │ │ │ return a non-owning reference to this node. This is useful to refer to the root │ │ │ │ │ node without copying it in assignments. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** data_section() data_offset() ***** │ │ │ │ │ -span data_section () const noexcept; │ │ │ │ │ std::ptrdiff_t data_offset () const noexcept; │ │ │ │ │ +span data_section () const noexcept; │ │ │ │ │ returns the buffer and length of the section in the original bencoded buffer │ │ │ │ │ where this node is defined. For a dictionary for instance, this starts with d │ │ │ │ │ and ends with e, and has all the content of the dictionary in between. the │ │ │ │ │ data_offset() function returns the byte-offset to this node in, starting from │ │ │ │ │ the beginning of the buffer that was parsed. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** list_at() list_int_value_at() list_size() list_string_value_at() ***** │ │ │ │ │ +***** list_at() list_string_value_at() list_int_value_at() list_size() ***** │ │ │ │ │ std::int64_t list_int_value_at (int i │ │ │ │ │ , std::int64_t default_val = 0) const; │ │ │ │ │ +bdecode_node list_at (int i) const; │ │ │ │ │ int list_size () const; │ │ │ │ │ string_view list_string_value_at (int i │ │ │ │ │ , string_view default_val = string_view()) const; │ │ │ │ │ -bdecode_node list_at (int i) const; │ │ │ │ │ functions with the list_ prefix operate on lists. These functions are only │ │ │ │ │ valid if type() == list_t. list_at() returns the item in the list at index i. i │ │ │ │ │ may not be greater than or equal to the size of the list. size() returns the │ │ │ │ │ size of the list. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** dict_find_int_value() dict_find() dict_size() dict_find_string() │ │ │ │ │ -dict_find_int() dict_at() dict_find_list() dict_find_string_value() │ │ │ │ │ -dict_find_dict() dict_at_node() ***** │ │ │ │ │ +***** dict_find() dict_at_node() dict_find_int_value() dict_find_string_value() │ │ │ │ │ +dict_at() dict_find_string() dict_size() dict_find_list() dict_find_int() │ │ │ │ │ +dict_find_dict() ***** │ │ │ │ │ +std::pair dict_at (int i) const; │ │ │ │ │ +bdecode_node dict_find_int (string_view key) const; │ │ │ │ │ bdecode_node dict_find_list (string_view key) const; │ │ │ │ │ +std::pair dict_at_node (int i) const; │ │ │ │ │ +bdecode_node dict_find (string_view key) const; │ │ │ │ │ string_view dict_find_string_value (string_view key │ │ │ │ │ , string_view default_value = string_view()) const; │ │ │ │ │ -bdecode_node dict_find_int (string_view key) const; │ │ │ │ │ -std::pair dict_at_node (int i) const; │ │ │ │ │ std::int64_t dict_find_int_value (string_view key │ │ │ │ │ , std::int64_t default_val = 0) const; │ │ │ │ │ -bdecode_node dict_find (string_view key) const; │ │ │ │ │ +int dict_size () const; │ │ │ │ │ bdecode_node dict_find_dict (string_view key) const; │ │ │ │ │ bdecode_node dict_find_string (string_view key) const; │ │ │ │ │ -int dict_size () const; │ │ │ │ │ -std::pair dict_at (int i) const; │ │ │ │ │ Functions with the dict_ prefix operates on dictionaries. They are only valid │ │ │ │ │ if type() == dict_t. In case a key you're looking up contains a 0 byte, you │ │ │ │ │ cannot use the 0-terminated string overloads, but have to use string_view │ │ │ │ │ instead. dict_find_list will return a valid bdecode_node if the key is found │ │ │ │ │ _and_ it is a list. Otherwise it will return a default-constructed │ │ │ │ │ bdecode_node. │ │ │ │ │ Functions with the _value suffix return the value of the node directly, rather │ │ │ │ │ @@ -12089,18 +12089,18 @@ │ │ │ │ │ string). │ │ │ │ │ [report_issue] │ │ │ │ │ ***** int_value() ***** │ │ │ │ │ std::int64_t int_value () const; │ │ │ │ │ this function is only valid if type() == int_t. It returns the value of the │ │ │ │ │ integer. │ │ │ │ │ [report_issue] │ │ │ │ │ -***** string_length() string_ptr() string_offset() string_value() ***** │ │ │ │ │ -string_view string_value () const; │ │ │ │ │ +***** string_ptr() string_offset() string_length() string_value() ***** │ │ │ │ │ std::ptrdiff_t string_offset () const; │ │ │ │ │ int string_length () const; │ │ │ │ │ +string_view string_value () const; │ │ │ │ │ char const* string_ptr () const; │ │ │ │ │ these functions are only valid if type() == string_t. They return the string │ │ │ │ │ values. Note that string_ptr() is not 0-terminated. string_length() returns the │ │ │ │ │ number of bytes in the string. string_offset() returns the byte offset from the │ │ │ │ │ start of the parsed bencoded buffer this string can be found. │ │ │ │ │ [report_issue] │ │ │ │ │ ***** clear() ***** │ │ │ │ │ @@ -12403,22 +12403,22 @@ │ │ │ │ │ specified in the message. This may improve the chances of traversing NATs │ │ │ │ │ when using uTP. │ │ │ │ │ ssl_torrent │ │ │ │ │ Specify the port number for the SSL listen socket in the DHT announce. │ │ │ │ │ [report_issue] │ │ │ │ │ ****** read_resume_data() ****** │ │ │ │ │ Declared in "libtorrent/read_resume_data.hpp" │ │ │ │ │ -add_torrent_params read_resume_data (span buffer │ │ │ │ │ - , 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 buffer │ │ │ │ │ - , error_code& ec, load_torrent_limits const& cfg = {}); │ │ │ │ │ + , 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 buffer │ │ │ │ │ + , error_code& ec, 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 the │ │ │ │ │ actual torrent_info object to and pass to session::add_torrent() or session:: │ │ │ │ │ async_add_torrent(). │ │ │ │ │ If the client wants to override any field that was loaded from the resume data, │ │ │ │ │ e.g. save_path, those fields must be changed after loading resume data but │ │ │ │ │ before adding the torrent. │ │ │ │ │ @@ -12426,28 +12426,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 │ │ │ │ │ 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() ****** │ │ │ │ │ +****** write_resume_data() write_resume_data_buf() ****** │ │ │ │ │ Declared in "libtorrent/write_resume_data.hpp" │ │ │ │ │ std::vector write_resume_data_buf (add_torrent_params const& atp); │ │ │ │ │ entry write_resume_data (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_buf() write_torrent_file() ****** │ │ │ │ │ Declared in "libtorrent/write_resume_data.hpp" │ │ │ │ │ +entry write_torrent_file (add_torrent_params const& atp, write_torrent_flags_t │ │ │ │ │ +flags); │ │ │ │ │ std::vector 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 │ │ │ │ │ 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