holds the state of a block in a piece. Who we requested
│ │ │ -it from and how far along we are at downloading it.
│ │ │
buffer_allocator_interface
│ │ │
Declared in "libtorrent/disk_buffer_holder.hpp"
│ │ │
the interface for freeing disk buffers, used by the disk_buffer_holder.
│ │ │ when implementing disk_interface, this must also be implemented in order
│ │ │ to return disk buffers back to libtorrent
│ │ │
│ │ │ @@ -4908,16 +2089,16 @@
│ │ │ The disk buffer holder acts like a unique_ptr that frees a disk buffer
│ │ │ when it's destructed
│ │ │ If this buffer holder is moved-from, default constructed or reset,
│ │ │ data() will return nullptr.
│ │ │
│ │ │ struct disk_buffer_holder
│ │ │ {
│ │ │ - disk_buffer_holder& operator= (disk_buffer_holder&&) & noexcept;
│ │ │ disk_buffer_holder (disk_buffer_holder&&) noexcept;
│ │ │ + disk_buffer_holder& operator= (disk_buffer_holder&&) & noexcept;
│ │ │ disk_buffer_holder (disk_buffer_holder const&) = delete;
│ │ │ disk_buffer_holder& operator= (disk_buffer_holder const&) = delete;
│ │ │ disk_buffer_holder (buffer_allocator_interface& alloc
│ │ │ , char* buf, int sz) noexcept;
│ │ │ disk_buffer_holder () noexcept = default;
│ │ │ ~disk_buffer_holder ();
│ │ │ char* data () const noexcept;
│ │ │ @@ -4948,22 +2129,22 @@
│ │ │
│ │ │
~disk_buffer_holder()
│ │ │
│ │ │ ~disk_buffer_holder ();
│ │ │
│ │ │
frees disk buffer held by this object
│ │ │
[report issue]
│ │ │ -
│ │ │ +
│ │ │
data()
│ │ │
│ │ │ char* data () const noexcept;
│ │ │
│ │ │
return a pointer to the held buffer, if any. Otherwise returns nullptr.
│ │ │
[report issue]
│ │ │ -
│ │ │ +
│ │ │
reset()
│ │ │
│ │ │ void reset ();
│ │ │
│ │ │
free the held disk buffer, if any, and clear the holder. This sets the
│ │ │ holder object to a default-constructed state
│ │ │
[report issue]
│ │ │ @@ -9735,22 +6916,22 @@
│ │ │
│ │ │ 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_int (int name, flags::bitfield_flag<Type, Tag> const val);
│ │ │ - void set_bool (int name, bool val) override;
│ │ │ void set_int (int name, int val) override;
│ │ │ + void set_bool (int name, bool val) override;
│ │ │ void set_str (int name, std::string val) override;
│ │ │ bool has_val (int name) const override;
│ │ │ void clear ();
│ │ │ void clear (int name);
│ │ │ - bool get_bool (int name) const override;
│ │ │ int get_int (int name) const override;
│ │ │ + bool get_bool (int name) const override;
│ │ │ std::string const& get_str (int name) const override;
│ │ │
│ │ │ enum type_bases
│ │ │ {
│ │ │ string_type_base,
│ │ │ int_type_base,
│ │ │ bool_type_base,
│ │ │ @@ -9826,16 +7007,16 @@
│ │ │
│ │ │
│ │ │
│ │ │
[report issue]
│ │ │
set_int() set_str() set_bool()
│ │ │
│ │ │ void set_int (int name, flags::bitfield_flag<Type, Tag> const val);
│ │ │ -void set_bool (int name, bool val) override;
│ │ │ void set_int (int name, int val) override;
│ │ │ +void set_bool (int name, bool val) override;
│ │ │ void set_str (int name, std::string 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]
│ │ │
│ │ │
│ │ │
clear()
│ │ │
│ │ │ void clear (int name);
│ │ │
│ │ │
clear a specific setting from the pack
│ │ │ -
│ │ │ +
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
get_str() get_int() get_bool()
│ │ │
│ │ │ -bool get_bool (int name) const override;
│ │ │ int get_int (int name) const override;
│ │ │ +bool get_bool (int name) const override;
│ │ │ std::string const& get_str (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.
│ │ │ @@ -10238,16 +7419,16 @@
│ │ │
│ │ │
[report issue]
│ │ │
│ │ │
│ │ │
name_for_setting() setting_by_name()
│ │ │
Declared in "libtorrent/settings_pack.hpp"
│ │ │
│ │ │ -char const* name_for_setting (int s);
│ │ │ int setting_by_name (string_view name);
│ │ │ +char const* name_for_setting (int s);
│ │ │
│ │ │
converts a setting integer (from the enums string_types, int_types or
│ │ │ bool_types) to a string, and vice versa.
│ │ │
[report issue]
│ │ │
│ │ │
default_settings()
│ │ │
Declared in "libtorrent/settings_pack.hpp"
│ │ │ @@ -10337,1335 +7518,240 @@
│ │ │
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]
│ │ │ -
│ │ │ +
│ │ │ +
piece_block
│ │ │ +
Declared in "libtorrent/piece_block.hpp"
│ │ │
│ │ │ -struct stats_metric
│ │ │ +struct piece_block
│ │ │ {
│ │ │ - char const* name;
│ │ │ - int value_index;
│ │ │ - metric_type_t type;
│ │ │ + piece_block () = default;
│ │ │ + piece_block (piece_index_t p_index, int b_index);
│ │ │ + bool operator< (piece_block const& b) const;
│ │ │ + bool operator== (piece_block const& b) const;
│ │ │ + bool operator!= (piece_block const& b) const;
│ │ │ +
│ │ │ + static const piece_block invalid;
│ │ │ + piece_index_t piece_index {0};
│ │ │ + int block_index = 0;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -- name
│ │ │ -- the name of the counter or gauge
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- value_index type
│ │ │ -- the index into the session stats array, where the underlying value of
│ │ │ -this counter or gauge is found. The session stats array is part of the
│ │ │ -session_stats_alert object.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
info_hash_t
│ │ │ +
Declared in "libtorrent/info_hash.hpp"
│ │ │ +
class holding the info-hash of a torrent. It can hold a v1 info-hash
│ │ │ +(SHA-1) or 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 counters
│ │ │ +struct info_hash_t
│ │ │ {
│ │ │ - 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 ;
│ │ │ - void blend_stats_counter (int c, std::int64_t value, int ratio) ;
│ │ │ - void set_value (int c, std::int64_t value) ;
│ │ │ + info_hash_t () noexcept = default;
│ │ │ + explicit info_hash_t (sha256_hash h2) noexcept;
│ │ │ + info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;
│ │ │ + explicit info_hash_t (sha1_hash h1) noexcept;
│ │ │ + bool has_v1 () const;
│ │ │ + bool has (protocol_version v) const;
│ │ │ + bool has_v2 () 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;
│ │ │ + bool operator< (info_hash_t const& o) const;
│ │ │ + friend std::ostream& operator<< (std::ostream& os, info_hash_t const& ih);
│ │ │ +
│ │ │ + sha1_hash v1;
│ │ │ + sha256_hash v2;
│ │ │ };
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
operator[]() inc_stats_counter()
│ │ │ +
[report issue]
│ │ │ +
info_hash_t()
│ │ │
│ │ │ -std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;
│ │ │ -std::int64_t operator[] (int i) const ;
│ │ │ +info_hash_t () noexcept = default;
│ │ │ +explicit info_hash_t (sha256_hash h2) noexcept;
│ │ │ +info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;
│ │ │ +explicit info_hash_t (sha1_hash h1) noexcept;
│ │ │
│ │ │ -
returns the new value
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
session_stats_metrics()
│ │ │ -
Declared in "libtorrent/session_stats.hpp"
│ │ │ +
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()
│ │ │
│ │ │ -std::vector<stats_metric> session_stats_metrics ();
│ │ │ +bool has_v1 () const;
│ │ │ +bool has (protocol_version v) const;
│ │ │ +bool has_v2 () const;
│ │ │
│ │ │ -
This free function returns the list of available metrics exposed by
│ │ │ -libtorrent's statistics API. Each metric has a name and a value index.
│ │ │ -The value index is the index into the array in session_stats_alert where
│ │ │ -this metric's value can be found when the session stats is sampled (by
│ │ │ -calling post_session_stats()).
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
get()
│ │ │
│ │ │ -int find_metric_idx (string_view name);
│ │ │ +sha1_hash get (protocol_version v) const;
│ │ │
│ │ │ -
given a name of a metric, this function returns the counter index of it,
│ │ │ -or -1 if it could not be found. The counter index is the index into the
│ │ │ -values array returned by session_stats_alert.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum metric_type_t
│ │ │ -
Declared in "libtorrent/session_stats.hpp"
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| name |
│ │ │ -value |
│ │ │ -description |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| counter |
│ │ │ -0 |
│ │ │ - |
│ │ │ -
│ │ │ -| gauge |
│ │ │ -1 |
│ │ │ - |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
get_best()
│ │ │
│ │ │ -struct session_params
│ │ │ +sha1_hash get_best () const;
│ │ │ +
│ │ │ +
returns the v2 (truncated) info-hash, if there is one, otherwise
│ │ │ +returns the v1 info-hash
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
peer_request
│ │ │ +
Declared in "libtorrent/peer_request.hpp"
│ │ │ +
represents a byte range within a piece. Internally this is is used for
│ │ │ +incoming piece requests.
│ │ │ +
│ │ │ +struct peer_request
│ │ │ {
│ │ │ - session_params (settings_pack&& sp);
│ │ │ - session_params ();
│ │ │ - session_params (settings_pack const& sp);
│ │ │ - session_params (settings_pack&& sp
│ │ │ - , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ - session_params (settings_pack const& sp
│ │ │ - , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ + bool operator== (peer_request const& r) const;
│ │ │
│ │ │ - settings_pack settings;
│ │ │ - std::vector<std::shared_ptr<plugin>> extensions;
│ │ │ - dht::dht_state dht_state;
│ │ │ - dht::dht_storage_constructor_type dht_storage_constructor;
│ │ │ - disk_io_constructor_type disk_io_constructor;
│ │ │ - std::map<std::string, std::string> ext_state;
│ │ │ - libtorrent::ip_filter ip_filter;
│ │ │ + piece_index_t piece;
│ │ │ + int start;
│ │ │ + int length;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
session_params()
│ │ │ -
│ │ │ -session_params (settings_pack&& sp);
│ │ │ -session_params ();
│ │ │ -session_params (settings_pack const& sp);
│ │ │ -
│ │ │ -
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()
│ │ │ +
[report issue]
│ │ │ +
operator==()
│ │ │
│ │ │ -session_params (settings_pack&& sp
│ │ │ - , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ -session_params (settings_pack const& sp
│ │ │ - , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ +bool operator== (peer_request const& r) const;
│ │ │
│ │ │ -
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
│ │ │ -- the plugins to add to the session as it is constructed
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- dht_state
│ │ │ -- DHT node ID and node addresses to bootstrap the DHT with.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- dht_storage_constructor
│ │ │ -- function object to construct the storage object for DHT items.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- disk_io_constructor
│ │ │ -- function object to create the disk I/O subsystem. Defaults to
│ │ │ -default_disk_io_constructor.
│ │ │ +returns true if the right hand side peer_request refers to the same
│ │ │ +range as this does.
│ │ │ +[report issue]
│ │ │ +- piece
│ │ │ +- The index of the piece in which the range starts.
│ │ │
│ │ │ -[report issue]
│ │ │ -- ext_state
│ │ │ -- this container can be used by extensions/plugins to store settings. It's
│ │ │ -primarily here to make it convenient to save and restore state across
│ │ │ -sessions, using read_session_params() and write_session_params().
│ │ │ +[report issue]
│ │ │ +- start
│ │ │ +- The byte offset within that piece where the range starts.
│ │ │
│ │ │ -[report issue]
│ │ │ -- ip_filter
│ │ │ -- the IP filter to use for the session. This restricts which peers are allowed
│ │ │ -to connect. As if passed to set_ip_filter().
│ │ │ +[report issue]
│ │ │ +- length
│ │ │ +- The size of the range, in bytes.
│ │ │
│ │ │ -[report issue]
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
session_handle
│ │ │ -
Declared in "libtorrent/session_handle.hpp"
│ │ │ -
this class provides a non-owning handle to a session and a subset of the
│ │ │ -interface of the session class. If the underlying session is destructed
│ │ │ -any handle to it will no longer be valid. is_valid() will return false and
│ │ │ -any operation on it will throw a system_error exception, with error code
│ │ │ -invalid_session_handle.
│ │ │ +
│ │ │ +
peer_info
│ │ │ +
Declared in "libtorrent/peer_info.hpp"
│ │ │ +
holds information and statistics about one peer
│ │ │ +that libtorrent is connected to
│ │ │
│ │ │ -struct session_handle
│ │ │ +struct peer_info
│ │ │ {
│ │ │ - bool is_valid () const;
│ │ │ - session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;
│ │ │ - std::vector<torrent_status> get_torrent_status (
│ │ │ - std::function<bool(torrent_status const&)> const& pred
│ │ │ - , status_flags_t flags = {}) const;
│ │ │ - void refresh_torrent_status (std::vector<torrent_status>* ret
│ │ │ - , status_flags_t flags = {}) const;
│ │ │ - 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&& st);
│ │ │ - void set_dht_state (dht::dht_state const& st);
│ │ │ - torrent_handle find_torrent (sha1_hash const& info_hash) const;
│ │ │ - std::vector<torrent_handle> get_torrents () const;
│ │ │ - torrent_handle find_torrent (sha256_hash const& info_hash) const;
│ │ │ - 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 const& params);
│ │ │ - 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);
│ │ │ - 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<std::string, int> const& node);
│ │ │ - void dht_get_item (sha1_hash const& target);
│ │ │ - void dht_get_item (std::array<char, 32> key
│ │ │ - , std::string salt = std::string());
│ │ │ - sha1_hash dht_put_item (entry data);
│ │ │ - void dht_put_item (std::array<char, 32> key
│ │ │ - , std::function<void(entry&, std::array<char, 64>&
│ │ │ - , std::int64_t&, std::string const&)> cb
│ │ │ - , std::string salt = std::string());
│ │ │ - void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});
│ │ │ - void dht_get_peers (sha1_hash const& info_hash);
│ │ │ - void dht_live_nodes (sha1_hash const& nid);
│ │ │ - void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);
│ │ │ - void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});
│ │ │ - void add_extension (std::shared_ptr<plugin> ext);
│ │ │ - void add_extension (std::function<std::shared_ptr<torrent_plugin>(
│ │ │ - torrent_handle const&, client_data_t)> ext);
│ │ │ - ip_filter get_ip_filter () const;
│ │ │ - void set_ip_filter (ip_filter f);
│ │ │ - void set_port_filter (port_filter const& f);
│ │ │ - unsigned short listen_port () const;
│ │ │ - bool is_listening () const;
│ │ │ - unsigned short ssl_listen_port () const;
│ │ │ - void set_peer_class_filter (ip_filter const& f);
│ │ │ - ip_filter get_peer_class_filter () const;
│ │ │ - 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);
│ │ │ - 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 = {});
│ │ │ - void apply_settings (settings_pack&&);
│ │ │ - settings_pack get_settings () const;
│ │ │ - void apply_settings (settings_pack const&);
│ │ │ - alert* wait_for_alert (time_duration max_wait);
│ │ │ - void set_alert_notify (std::function<void()> const& fun);
│ │ │ - void pop_alerts (std::vector<alert*>* alerts);
│ │ │ - void delete_port_mapping (port_mapping_t handle);
│ │ │ - std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);
│ │ │ - void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);
│ │ │ - std::shared_ptr<aux::session_impl> native_handle () const;
│ │ │ + sha256_hash i2p_destination () const;
│ │ │
│ │ │ - static constexpr save_state_flags_t save_settings = 0_bit;
│ │ │ - static constexpr save_state_flags_t save_dht_state = 2_bit;
│ │ │ - static constexpr save_state_flags_t save_extension_state = 11_bit;
│ │ │ - static constexpr save_state_flags_t save_ip_filter = 12_bit;
│ │ │ - static constexpr peer_class_t global_peer_class_id {0};
│ │ │ - static constexpr peer_class_t tcp_peer_class_id {1};
│ │ │ - static constexpr peer_class_t local_peer_class_id {2};
│ │ │ - static constexpr remove_flags_t delete_files = 0_bit;
│ │ │ - static constexpr remove_flags_t delete_partfile = 1_bit;
│ │ │ - static constexpr session_flags_t paused = 2_bit;
│ │ │ - static constexpr portmap_protocol udp = portmap_protocol::udp;
│ │ │ - static constexpr portmap_protocol tcp = portmap_protocol::tcp;
│ │ │ - static constexpr reopen_network_flags_t reopen_map_ports = 0_bit;
│ │ │ + std::string client;
│ │ │ + typed_bitfield<piece_index_t> pieces;
│ │ │ + std::int64_t total_download;
│ │ │ + std::int64_t total_upload;
│ │ │ + time_duration last_request;
│ │ │ + time_duration last_active;
│ │ │ + time_duration download_queue_time;
│ │ │ + static constexpr peer_flags_t interesting = 0_bit;
│ │ │ + static constexpr peer_flags_t choked = 1_bit;
│ │ │ + static constexpr peer_flags_t remote_interested = 2_bit;
│ │ │ + static constexpr peer_flags_t remote_choked = 3_bit;
│ │ │ + static constexpr peer_flags_t supports_extensions = 4_bit;
│ │ │ + static constexpr peer_flags_t outgoing_connection = 5_bit;
│ │ │ + static constexpr peer_flags_t local_connection = 5_bit;
│ │ │ + static constexpr peer_flags_t handshake = 6_bit;
│ │ │ + static constexpr peer_flags_t connecting = 7_bit;
│ │ │ + static constexpr peer_flags_t on_parole = 9_bit;
│ │ │ + static constexpr peer_flags_t seed = 10_bit;
│ │ │ + static constexpr peer_flags_t optimistic_unchoke = 11_bit;
│ │ │ + static constexpr peer_flags_t snubbed = 12_bit;
│ │ │ + static constexpr peer_flags_t upload_only = 13_bit;
│ │ │ + static constexpr peer_flags_t endgame_mode = 14_bit;
│ │ │ + static constexpr peer_flags_t holepunched = 15_bit;
│ │ │ + static constexpr peer_flags_t i2p_socket = 16_bit;
│ │ │ + static constexpr peer_flags_t utp_socket = 17_bit;
│ │ │ + static constexpr peer_flags_t ssl_socket = 18_bit;
│ │ │ + static constexpr peer_flags_t rc4_encrypted = 19_bit;
│ │ │ + static constexpr peer_flags_t plaintext_encrypted = 20_bit;
│ │ │ + peer_flags_t flags;
│ │ │ + static constexpr peer_source_flags_t tracker = 0_bit;
│ │ │ + static constexpr peer_source_flags_t dht = 1_bit;
│ │ │ + static constexpr peer_source_flags_t pex = 2_bit;
│ │ │ + static constexpr peer_source_flags_t lsd = 3_bit;
│ │ │ + static constexpr peer_source_flags_t resume_data = 4_bit;
│ │ │ + static constexpr peer_source_flags_t incoming = 5_bit;
│ │ │ + peer_source_flags_t source;
│ │ │ + int up_speed;
│ │ │ + int down_speed;
│ │ │ + int payload_up_speed;
│ │ │ + int payload_down_speed;
│ │ │ + peer_id pid;
│ │ │ + int queue_bytes;
│ │ │ + int request_timeout;
│ │ │ + int send_buffer_size;
│ │ │ + int used_send_buffer;
│ │ │ + int receive_buffer_size;
│ │ │ + int used_receive_buffer;
│ │ │ + int receive_buffer_watermark;
│ │ │ + int num_hashfails;
│ │ │ + int download_queue_length;
│ │ │ + int timed_out_requests;
│ │ │ + int busy_requests;
│ │ │ + int requests_in_buffer;
│ │ │ + int target_dl_queue_length;
│ │ │ + int upload_queue_length;
│ │ │ + int failcount;
│ │ │ + piece_index_t downloading_piece_index;
│ │ │ + int downloading_block_index;
│ │ │ + int downloading_progress;
│ │ │ + int downloading_total;
│ │ │ + static constexpr connection_type_t standard_bittorrent = 0_bit;
│ │ │ + static constexpr connection_type_t web_seed = 1_bit;
│ │ │ + static constexpr connection_type_t http_seed = 2_bit;
│ │ │ + connection_type_t connection_type;
│ │ │ + int pending_disk_bytes;
│ │ │ + int pending_disk_read_bytes;
│ │ │ + int send_quota;
│ │ │ + int receive_quota;
│ │ │ + int rtt;
│ │ │ + int num_pieces;
│ │ │ + int download_rate_peak;
│ │ │ + int upload_rate_peak;
│ │ │ + float progress;
│ │ │ + int progress_ppm;
│ │ │ + tcp::endpoint ip;
│ │ │ + tcp::endpoint local_endpoint;
│ │ │ + static constexpr bandwidth_state_flags_t bw_idle = 0_bit;
│ │ │ + static constexpr bandwidth_state_flags_t bw_limit = 1_bit;
│ │ │ + static constexpr bandwidth_state_flags_t bw_network = 2_bit;
│ │ │ + static constexpr bandwidth_state_flags_t bw_disk = 4_bit;
│ │ │ + bandwidth_state_flags_t read_state;
│ │ │ + bandwidth_state_flags_t write_state;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
is_valid()
│ │ │ +
[report issue]
│ │ │ +
i2p_destination()
│ │ │
│ │ │ -bool is_valid () const;
│ │ │ -
│ │ │ -
returns true if this handle refers to a valid session object. If the
│ │ │ -session has been destroyed, all session_handle objects will expire and
│ │ │ -not be valid.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
session_state()
│ │ │ -
│ │ │ -session_params session_state (save_state_flags_t flags = save_state_flags_t::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]
│ │ │ -
│ │ │ -
get_torrent_status() refresh_torrent_status()
│ │ │ -
│ │ │ -std::vector<torrent_status> get_torrent_status (
│ │ │ - std::function<bool(torrent_status const&)> const& pred
│ │ │ - , status_flags_t flags = {}) const;
│ │ │ -void refresh_torrent_status (std::vector<torrent_status>* ret
│ │ │ - , status_flags_t flags = {}) const;
│ │ │ -
│ │ │ -
│ │ │ -
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 should be included and false means
│ │ │ -excluded. The flags argument is the same as to
│ │ │ -torrent_handle::status(). Since pred is guaranteed to be
│ │ │ -called for every torrent, it may be used to count the number of
│ │ │ -torrents of different categories as well.
│ │ │ -
refresh_torrent_status takes a vector of torrent_status structs
│ │ │ -(for instance the same vector that was returned by
│ │ │ -get_torrent_status() ) and refreshes the status based on the
│ │ │ -handle member. It is possible to use this function by first
│ │ │ -setting up a vector of default constructed torrent_status objects,
│ │ │ -only initializing the handle member, in order to request the
│ │ │ -torrent status for multiple torrents in a single call. This can save a
│ │ │ -significant amount of time if you have a lot of torrents.
│ │ │ -
Any torrent_status object whose handle member is not referring to
│ │ │ -a valid torrent are ignored.
│ │ │ -
The intended use of these functions is to start off by calling
│ │ │ -get_torrent_status() to get a list of all torrents that match your
│ │ │ -criteria. Then call refresh_torrent_status() on that list. This
│ │ │ -will only refresh the status for the torrents in your list, and thus
│ │ │ -ignore all other torrents you might be running. This may save a
│ │ │ -significant amount of time, especially if the number of torrents you're
│ │ │ -interested in is small. In order to keep your list of interested
│ │ │ -torrents up to date, you can either call get_torrent_status() from
│ │ │ -time to time, to include torrents you might have become interested in
│ │ │ -since the last time. In order to stop refreshing a certain torrent,
│ │ │ -simply remove it from the list.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
post_torrent_updates()
│ │ │ -
│ │ │ -void post_torrent_updates (status_flags_t flags = status_flags_t::all());
│ │ │ -
│ │ │ -
This functions instructs the session to post the state_update_alert,
│ │ │ -containing the status of all torrents whose state changed since the
│ │ │ -last time this function was called.
│ │ │ -
Only torrents who has the state subscription flag set will be
│ │ │ -included. This flag is on by default. See add_torrent_params.
│ │ │ -the flags argument is the same as for torrent_handle::status().
│ │ │ -see status_flags_t in torrent_handle.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
post_session_stats()
│ │ │ -
│ │ │ -void post_session_stats ();
│ │ │ -
│ │ │ -
This function will post a session_stats_alert object, containing a
│ │ │ -snapshot of the performance counters from the internals of libtorrent.
│ │ │ -To interpret these counters, query the session via
│ │ │ -session_stats_metrics().
│ │ │ -
For more information, see the session statistics section.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
post_dht_stats()
│ │ │ -
│ │ │ -void post_dht_stats ();
│ │ │ -
│ │ │ -
This will cause a dht_stats_alert to be posted.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
set_dht_state()
│ │ │ -
│ │ │ -void set_dht_state (dht::dht_state&& st);
│ │ │ -void set_dht_state (dht::dht_state const& st);
│ │ │ -
│ │ │ -
set the DHT state for the session. This will be taken into account the
│ │ │ -next time the DHT is started, as if it had been passed in via the
│ │ │ -session_params on startup.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
find_torrent() get_torrents()
│ │ │ -
│ │ │ -torrent_handle find_torrent (sha1_hash const& info_hash) const;
│ │ │ -std::vector<torrent_handle> get_torrents () const;
│ │ │ -torrent_handle find_torrent (sha256_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]
│ │ │ -
│ │ │ -
add_torrent() async_add_torrent()
│ │ │ -
│ │ │ -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 const& params);
│ │ │ -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);
│ │ │ -
│ │ │ -
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 save_path field in add_torrent_params must be set to a valid
│ │ │ -path where the files for the torrent will be saved. Even when using a
│ │ │ -custom storage, this needs to be set to something. If the save_path
│ │ │ -is empty, the call to add_torrent() will throw a system_error
│ │ │ -exception.
│ │ │ -
The overload that does not take an error_code throws an exception on
│ │ │ -error and is not available when building without exception support.
│ │ │ -The torrent_handle returned by add_torrent() can be used to retrieve
│ │ │ -information about the torrent's progress, its peers etc. It is also
│ │ │ -used to abort a torrent.
│ │ │ -
If the torrent you are trying to add already exists in the session (is
│ │ │ -either queued for checking, being checked or downloading)
│ │ │ -add_torrent() will throw system_error which derives from
│ │ │ -std::exception unless duplicate_is_error is set to false. In that
│ │ │ -case, add_torrent() will return the handle to the existing torrent.
│ │ │ -
The add_torrent_params class has a flags field. It can be used to
│ │ │ -control what state the new torrent will be added in. Common flags to
│ │ │ -want to control are 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]
│ │ │ -
│ │ │ -
pause() is_paused() resume()
│ │ │ -
│ │ │ -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()
│ │ │ -
│ │ │ -bool is_dht_running () const;
│ │ │ -
│ │ │ -
is_dht_running() returns true if the DHT support has been started
│ │ │ -and false otherwise.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
set_dht_storage()
│ │ │ -
│ │ │ -void set_dht_storage (dht::dht_storage_constructor_type sc);
│ │ │ -
│ │ │ -
set_dht_storage set a dht custom storage constructor function
│ │ │ -to be used internally when the dht is created.
│ │ │ -
Since the dht storage is a critical component for the dht behavior,
│ │ │ -this function will only be effective the next time the dht is started.
│ │ │ -If you never touch this feature, a default map-memory based storage
│ │ │ -is used.
│ │ │ -
If you want to make sure the dht is initially created with your
│ │ │ -custom storage, create a session with the setting
│ │ │ -settings_pack::enable_dht to false, set your constructor function
│ │ │ -and call apply_settings with settings_pack::enable_dht to true.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
add_dht_node()
│ │ │ -
│ │ │ -void add_dht_node (std::pair<std::string, int> const& node);
│ │ │ -
│ │ │ -
add_dht_node takes a host name and port pair. That endpoint will be
│ │ │ -pinged, and if a valid DHT reply is received, the node will be added to
│ │ │ -the routing table.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_get_item()
│ │ │ -
│ │ │ -void dht_get_item (sha1_hash const& target);
│ │ │ -
│ │ │ -
query the DHT for an immutable item at the target hash.
│ │ │ -the result is posted as a dht_immutable_item_alert.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_get_item()
│ │ │ -
│ │ │ -void dht_get_item (std::array<char, 32> key
│ │ │ - , std::string salt = std::string());
│ │ │ -
│ │ │ -
query the DHT for a mutable item under the public key key.
│ │ │ -this is an ed25519 key. salt is optional and may be left
│ │ │ -as an empty string if no salt is to be used.
│ │ │ -if the item is found in the DHT, a dht_mutable_item_alert is
│ │ │ -posted.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_put_item()
│ │ │ -
│ │ │ -sha1_hash dht_put_item (entry data);
│ │ │ -
│ │ │ -
store the given bencoded data as an immutable item in the DHT.
│ │ │ -the returned hash is the key that is to be used to look the item
│ │ │ -up again. It's just the SHA-1 hash of the bencoded form of the
│ │ │ -structure.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_put_item()
│ │ │ -
│ │ │ -void dht_put_item (std::array<char, 32> key
│ │ │ - , std::function<void(entry&, std::array<char, 64>&
│ │ │ - , std::int64_t&, std::string const&)> cb
│ │ │ - , std::string salt = std::string());
│ │ │ -
│ │ │ -
store a mutable item. The key is the public key the blob is
│ │ │ -to be stored under. The optional salt argument is a string that
│ │ │ -is to be mixed in with the key when determining where in the DHT
│ │ │ -the value is to be stored. The callback function is called from within
│ │ │ -the libtorrent network thread once we've found where to store the blob,
│ │ │ -possibly with the current value stored under the key.
│ │ │ -The values passed to the callback functions are:
│ │ │ -
│ │ │ -- entry& value
│ │ │ -- the current value stored under the key (may be empty). Also expected
│ │ │ -to be set to the value to be stored by the function.
│ │ │ -- std::array<char,64>& signature
│ │ │ -- the signature authenticating the current value. This may be zeros
│ │ │ -if there is currently no value stored. The function is expected to
│ │ │ -fill in this buffer with the signature of the new value to store.
│ │ │ -To generate the signature, you may want to use the
│ │ │ -sign_mutable_item function.
│ │ │ -- std::int64_t& seq
│ │ │ -- current sequence number. May be zero if there is no current value.
│ │ │ -The function is expected to set this to the new sequence number of
│ │ │ -the value that is to be stored. Sequence numbers must be monotonically
│ │ │ -increasing. Attempting to overwrite a value with a lower or equal
│ │ │ -sequence number will fail, even if the signature is correct.
│ │ │ -- std::string const& salt
│ │ │ -- this is the salt that was used for this put call.
│ │ │ -
│ │ │ -
Since the callback function cb is called from within libtorrent,
│ │ │ -it is critical to not perform any blocking operations. Ideally not
│ │ │ -even locking a mutex. Pass any data required for this function along
│ │ │ -with the function object's context and make the function entirely
│ │ │ -self-contained. The only reason data blob's value is computed
│ │ │ -via a function instead of just passing in the new value is to avoid
│ │ │ -race conditions. If you want to update the value in the DHT, you
│ │ │ -must first retrieve it, then modify it, then write it back. The way
│ │ │ -the DHT works, it is natural to always do a lookup before storing and
│ │ │ -calling the callback in between is convenient.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_get_peers() dht_announce()
│ │ │ -
│ │ │ -void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});
│ │ │ -void dht_get_peers (sha1_hash const& info_hash);
│ │ │ -
│ │ │ -
dht_get_peers() will issue a DHT get_peer request to the DHT for the
│ │ │ -specified info-hash. The response (the peers) will be posted back in a
│ │ │ -dht_get_peers_reply_alert.
│ │ │ -
dht_announce() will issue a DHT announce request to the DHT to the
│ │ │ -specified info-hash, advertising the specified port. If the port is
│ │ │ -left at its default, 0, the port will be implied by the DHT message's
│ │ │ -source port (which may improve connectivity through a NAT).
│ │ │ -dht_announce() is not affected by the announce_port override setting.
│ │ │ -
Both these functions are exposed for advanced custom use of the DHT.
│ │ │ -All torrents eligible to be announce to the DHT will be automatically,
│ │ │ -by libtorrent.
│ │ │ -
For possible flags, see announce_flags_t.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_live_nodes()
│ │ │ -
│ │ │ -void dht_live_nodes (sha1_hash const& nid);
│ │ │ -
│ │ │ -
Retrieve all the live DHT (identified by nid) nodes. All the
│ │ │ -nodes id and endpoint will be returned in the list of nodes in the
│ │ │ -alert dht_live_nodes_alert.
│ │ │ -Since this alert is a response to an explicit call, it will always be
│ │ │ -posted, regardless of the alert mask.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_sample_infohashes()
│ │ │ -
│ │ │ -void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);
│ │ │ -
│ │ │ -
Query the DHT node specified by ep to retrieve a sample of the
│ │ │ -info-hashes that the node currently have in their storage.
│ │ │ -The target is included for iterative lookups so that indexing nodes
│ │ │ -can perform a key space traversal with a single RPC per node by adjusting
│ │ │ -the target value for each RPC. It has no effect on the returned sample value.
│ │ │ -The result is posted as a dht_sample_infohashes_alert.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_direct_request()
│ │ │ -
│ │ │ -void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});
│ │ │ -
│ │ │ -
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<plugin> ext);
│ │ │ -void add_extension (std::function<std::shared_ptr<torrent_plugin>(
│ │ │ - torrent_handle const&, client_data_t)> 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<torrent_plugin>. 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
│ │ │ -directly. Makes it possible to join a swarm with just a tracker and
│ │ │ -info-hash.
│ │ │ -
│ │ │ -
│ │ │ - ses.add_extension(<::create_ut_metadata_plugin);
│ │ │ -
│ │ │ -
│ │ │ -- uTorrent peer exchange
│ │ │ -- Exchanges peers between clients.
│ │ │ -
│ │ │ -
│ │ │ - ses.add_extension(<::create_ut_pex_plugin);
│ │ │ -
│ │ │ -
│ │ │ -- smart ban plugin
│ │ │ -- 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.
│ │ │ -
│ │ │ -
│ │ │ - ses.add_extension(<::create_smart_ban_plugin);
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
set_ip_filter() get_ip_filter()
│ │ │ -
│ │ │ -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.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
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]
│ │ │ -
│ │ │ -
is_listening() listen_port() ssl_listen_port()
│ │ │ -
│ │ │ -unsigned short listen_port () const;
│ │ │ -bool is_listening () const;
│ │ │ -unsigned short ssl_listen_port () const;
│ │ │ -
│ │ │ -
is_listening() will tell you whether or not the session has
│ │ │ -successfully opened a listening port. If it hasn't, this function will
│ │ │ -return false, and then you can set a new
│ │ │ -settings_pack::listen_interfaces to try another interface and port to
│ │ │ -bind to.
│ │ │ -
listen_port() returns the port we ended up listening on.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
set_peer_class_filter() get_peer_class_filter()
│ │ │ -
│ │ │ -void set_peer_class_filter (ip_filter const& f);
│ │ │ -ip_filter get_peer_class_filter () const;
│ │ │ -
│ │ │ -
Sets the peer class filter for this session. All new peer connections
│ │ │ -will take this into account and be added to the peer classes specified
│ │ │ -by this filter, based on the peer's IP address.
│ │ │ -
The ip-filter essentially maps an IP -> uint32. Each bit in that 32
│ │ │ -bit integer represents a peer class. The least significant bit
│ │ │ -represents class 0, the next bit class 1 and so on.
│ │ │ -
For more info, see ip_filter.
│ │ │ -
For example, to make all peers in the range 200.1.1.0 - 200.1.255.255
│ │ │ -belong to their own peer class, apply the following filter:
│ │ │ -
│ │ │ -ip_filter f = ses.get_peer_class_filter();
│ │ │ -peer_class_t my_class = ses.create_peer_class("200.1.x.x IP range");
│ │ │ -f.add_rule(make_address("200.1.1.0"), make_address("200.1.255.255")
│ │ │ - , 1 << static_cast<std::uint32_t>(my_class));
│ │ │ -ses.set_peer_class_filter(f);
│ │ │ -
│ │ │ -
This setting only applies to new connections, it won't affect existing
│ │ │ -peer connections.
│ │ │ -
This function is limited to only peer class 0-31, since there are only
│ │ │ -32 bits in the IP range mapping. Only the set bits matter; no peer
│ │ │ -class will be removed from a peer as a result of this call, peer
│ │ │ -classes are only added.
│ │ │ -
The peer_class argument cannot be greater than 31. The bitmasks
│ │ │ -representing peer classes in the peer_class_filter are 32 bits.
│ │ │ -
The get_peer_class_filter() function returns the current filter.
│ │ │ -
For more information, see peer classes.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
set_peer_class_type_filter() get_peer_class_type_filter()
│ │ │ -
│ │ │ -peer_class_type_filter get_peer_class_type_filter () const;
│ │ │ -void set_peer_class_type_filter (peer_class_type_filter const& f);
│ │ │ -
│ │ │ -
Sets and gets the peer class type filter. This is controls automatic
│ │ │ -peer class assignments to peers based on what kind of socket it is.
│ │ │ -
It does not only support assigning peer classes, it also supports
│ │ │ -removing peer classes based on socket type.
│ │ │ -
The order of these rules being applied are:
│ │ │ -
│ │ │ -- peer-class IP filter
│ │ │ -- peer-class type filter, removing classes
│ │ │ -- peer-class type filter, adding classes
│ │ │ -
│ │ │ -
For more information, see peer classes.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
create_peer_class()
│ │ │ -
│ │ │ -peer_class_t create_peer_class (char const* name);
│ │ │ -
│ │ │ -
Creates a new peer class (see peer classes) with the given name. The
│ │ │ -returned integer is the new peer class identifier. Peer classes may
│ │ │ -have the same name, so each invocation of this function creates a new
│ │ │ -class and returns a unique identifier.
│ │ │ -
Identifiers are assigned from low numbers to higher. So if you plan on
│ │ │ -using certain peer classes in a call to set_peer_class_filter(),
│ │ │ -make sure to create those early on, to get low identifiers.
│ │ │ -
For more information on peer classes, see peer classes.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
delete_peer_class()
│ │ │ -
│ │ │ -void delete_peer_class (peer_class_t cid);
│ │ │ -
│ │ │ -
This call dereferences the reference count of the specified peer
│ │ │ -class. When creating a peer class it's automatically referenced by 1.
│ │ │ -If you want to recycle a peer class, you may call this function. You
│ │ │ -may only call this function once per peer class you create.
│ │ │ -Calling it more than once for the same class will lead to memory
│ │ │ -corruption.
│ │ │ -
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()
│ │ │ -
│ │ │ -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 any of its classes is the one that is taken into
│ │ │ -account.
│ │ │ -
For more information, see peer classes.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
remove_torrent()
│ │ │ -
│ │ │ -void remove_torrent (const torrent_handle&, remove_flags_t = {});
│ │ │ -
│ │ │ -
remove_torrent() will close all peer connections associated with
│ │ │ -the torrent and tell the tracker that we've stopped participating in
│ │ │ -the swarm. This operation cannot fail. When it completes, you will
│ │ │ -receive a torrent_removed_alert.
│ │ │ -
remove_torrent() is non-blocking, but will remove the torrent from the
│ │ │ -session synchronously. Calling session_handle::add_torrent() immediately
│ │ │ -afterward with the same torrent will succeed. Note that this creates a
│ │ │ -new handle which is not equal to the removed one.
│ │ │ -
The optional second argument options can be used to delete all the
│ │ │ -files downloaded by this torrent. To do so, pass in the value
│ │ │ -session_handle::delete_files. Once the torrent is deleted, a
│ │ │ -torrent_deleted_alert is posted.
│ │ │ -
The torrent_handle remains valid for some time after remove_torrent() is
│ │ │ -called. It will become invalid only after all libtorrent tasks (such as
│ │ │ -I/O tasks) release their references to the torrent. Until this happens,
│ │ │ -torrent_handle::is_valid() will return true, and other calls such
│ │ │ -as torrent_handle::status() will succeed. Because of this, and because
│ │ │ -remove_torrent() is non-blocking, the following sequence usually
│ │ │ -succeeds (does not throw system_error):
│ │ │ -.. code:: c++
│ │ │ -
│ │ │ -session.remove_handle(handle);
│ │ │ -handle.save_resume_data();
│ │ │ -
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()
│ │ │ -
│ │ │ -void apply_settings (settings_pack&&);
│ │ │ -settings_pack get_settings () const;
│ │ │ -void apply_settings (settings_pack 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()
│ │ │ -
│ │ │ -alert* wait_for_alert (time_duration max_wait);
│ │ │ -void set_alert_notify (std::function<void()> const& fun);
│ │ │ -void pop_alerts (std::vector<alert*>* 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.
│ │ │ -
It is safe to call pop_alerts from multiple different threads, as
│ │ │ -long as the alerts themselves are not accessed once another thread
│ │ │ -calls pop_alerts. Doing this requires manual synchronization
│ │ │ -between the popping threads.
│ │ │ -
wait_for_alert will block the current thread for max_wait time
│ │ │ -duration, or until another alert is posted. If an alert is available
│ │ │ -at the time of the call, it returns immediately. The returned alert
│ │ │ -pointer is the head of the alert queue. wait_for_alert does not
│ │ │ -pop alerts from the queue, it merely peeks at it. The returned alert
│ │ │ -will stay valid until pop_alerts is called twice. The first time
│ │ │ -will pop it and the second will free it.
│ │ │ -
If there is no alert in the queue and no alert arrives within the
│ │ │ -specified timeout, wait_for_alert returns nullptr. If there are
│ │ │ -alerts available to be popped, the non-null pointer that's returned
│ │ │ -is of an unspecified alert.
│ │ │ -
In the python binding, wait_for_alert takes the number of
│ │ │ -milliseconds to wait as an integer.
│ │ │ -
The alert queue in the session will not grow indefinitely. Make sure
│ │ │ -to pop periodically to not miss notifications. To control the max
│ │ │ -number of alerts that's queued by the session, see
│ │ │ -settings_pack::alert_queue_size.
│ │ │ -
Some alerts are considered so important that they are posted even when
│ │ │ -the alert queue is full. Some alerts are considered mandatory and cannot
│ │ │ -be disabled by the alert_mask. For instance,
│ │ │ -save_resume_data_alert and save_resume_data_failed_alert are always
│ │ │ -posted, regardless of the alert mask.
│ │ │ -
To control which alerts are posted, set the alert_mask
│ │ │ -(settings_pack::alert_mask).
│ │ │ -
If the alert queue fills up to the point where alerts are dropped, this
│ │ │ -will be indicated by a alerts_dropped_alert, which contains a bitmask
│ │ │ -of which types of alerts were dropped. Generally it is a good idea to
│ │ │ -make sure the alert queue is large enough, the alert_mask doesn't have
│ │ │ -unnecessary categories enabled and to call pop_alert() frequently, to
│ │ │ -avoid alerts being dropped.
│ │ │ -
the set_alert_notify function lets the client set a function object
│ │ │ -to be invoked every time the alert queue goes from having 0 alerts to
│ │ │ -1 alert. This function is called from within libtorrent, it may be the
│ │ │ -main thread, or it may be from within a user call. The intention of
│ │ │ -of the function is that the client wakes up its main thread, to poll
│ │ │ -for more alerts using pop_alerts(). If the notify function fails
│ │ │ -to do so, it won't be called again, until pop_alerts is called for
│ │ │ -some other reason. For instance, it could signal an eventfd, post a
│ │ │ -message to an HWND or some other main message pump. The actual
│ │ │ -retrieval of 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);
│ │ │ -std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);
│ │ │ -
│ │ │ -
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 = reopen_map_ports);
│ │ │ -
│ │ │ -
Instructs the session to reopen all listen and outgoing sockets.
│ │ │ -
It's useful in the case your platform doesn't support the built in
│ │ │ -IP notifier mechanism, or if you have a better more reliable way to
│ │ │ -detect changes in the IP routing table.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
native_handle()
│ │ │ -
│ │ │ -std::shared_ptr<aux::session_impl> native_handle () const;
│ │ │ -
│ │ │ -
This function is intended only for use by plugins. This type does
│ │ │ -not have a stable API and should be relied on as little as possible.
│ │ │ -
[report issue]
│ │ │ -- save_settings
│ │ │ -- saves settings (i.e. the settings_pack)
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- save_dht_state
│ │ │ -- saves dht state such as nodes and node-id, possibly accelerating
│ │ │ -joining the DHT if provided at next session startup.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- save_extension_state
│ │ │ -- load or save state from plugins
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- save_ip_filter
│ │ │ -- load or save the IP filter set on the session
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- global_peer_class_id tcp_peer_class_id local_peer_class_id
│ │ │ -- built-in peer classes
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- delete_files
│ │ │ -- delete the files belonging to the torrent from disk.
│ │ │ -including the part-file, if there is one
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- delete_partfile
│ │ │ -- delete just the part-file associated with this torrent
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- paused
│ │ │ -- when set, the session will start paused. Call
│ │ │ -session_handle::resume() to start
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- udp tcp
│ │ │ -- 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]
│ │ │ -
│ │ │ -
│ │ │ -
session_proxy
│ │ │ -
Declared in "libtorrent/session.hpp"
│ │ │ -
this is a holder for the internal session implementation object. Once the
│ │ │ -session destruction is explicitly initiated, this holder is used to
│ │ │ -synchronize 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& operator= (session_proxy&&) & noexcept;
│ │ │ - ~session_proxy ();
│ │ │ - session_proxy (session_proxy const&);
│ │ │ - session_proxy ();
│ │ │ - session_proxy& operator= (session_proxy const&) &;
│ │ │ - session_proxy (session_proxy&&) noexcept;
│ │ │ -};
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
session_proxy() operator=() ~session_proxy()
│ │ │ -
│ │ │ -session_proxy& operator= (session_proxy&&) & noexcept;
│ │ │ -~session_proxy ();
│ │ │ -session_proxy (session_proxy const&);
│ │ │ -session_proxy ();
│ │ │ -session_proxy& operator= (session_proxy const&) &;
│ │ │ -session_proxy (session_proxy&&) noexcept;
│ │ │ -
│ │ │ -
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 will be idle as long it doesn't have any
│ │ │ -torrents to participate in.
│ │ │ -
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
│ │ │ -{
│ │ │ - explicit session (session_params const& params);
│ │ │ - session ();
│ │ │ - session (session_params&& params, session_flags_t flags);
│ │ │ - explicit session (session_params&& params);
│ │ │ - session (session_params const& params, session_flags_t flags);
│ │ │ - session (session_params const& params, io_context& ios, session_flags_t);
│ │ │ - session (session_params&& params, io_context& ios, session_flags_t);
│ │ │ - session (session_params const& params, io_context& ios);
│ │ │ - session (session_params&& params, io_context& ios);
│ │ │ - ~session ();
│ │ │ - session_proxy abort ();
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
session()
│ │ │ -
│ │ │ -explicit session (session_params const& params);
│ │ │ -session ();
│ │ │ -session (session_params&& params, session_flags_t flags);
│ │ │ -explicit session (session_params&& params);
│ │ │ -session (session_params const& params, session_flags_t flags);
│ │ │ -
│ │ │ -
Constructs the session objects which acts as the container of torrents.
│ │ │ -In order to avoid a race condition between starting the session and
│ │ │ -configuring it, you can pass in a session_params object. Its settings
│ │ │ -will take effect before the session starts up.
│ │ │ -
The overloads taking flags can be used to start a session in
│ │ │ -paused mode (by passing in session::paused). Note that
│ │ │ -add_default_plugins do not have an affect on constructors that
│ │ │ -take a session_params object. It already contains the plugins to use.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
session()
│ │ │ -
│ │ │ -session (session_params const& params, io_context& ios, session_flags_t);
│ │ │ -session (session_params&& params, io_context& ios, session_flags_t);
│ │ │ -session (session_params const& params, io_context& ios);
│ │ │ -session (session_params&& params, io_context& ios);
│ │ │ -
│ │ │ -
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 io_context::run() call must have returned
│ │ │ -before it's safe to destruct the session. Which means you MUST
│ │ │ -call session::abort() and save the session_proxy first, then
│ │ │ -destruct the session object, then sync with the io_context, then
│ │ │ -destruct the session_proxy object.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
~session()
│ │ │ -
│ │ │ -~session ();
│ │ │ -
│ │ │ -
The destructor of session will notify all trackers that our torrents
│ │ │ -have been shut down. If some trackers are down, they will time out.
│ │ │ -All this before the destructor of session returns. So, it's advised
│ │ │ -that any kind of interface (such as windows) are closed before
│ │ │ -destructing the session object. Because it can take a few second for
│ │ │ -it to finish. The timeout can be set with apply_settings().
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
abort()
│ │ │ -
│ │ │ -session_proxy abort ();
│ │ │ -
│ │ │ -
In case you want to destruct the session asynchronously, you can
│ │ │ -request a session destruction proxy. If you don't do this, the
│ │ │ -destructor of the session object will block while the trackers are
│ │ │ -contacted. If you keep one session_proxy to the session when
│ │ │ -destructing it, the destructor will not block, but start to close down
│ │ │ -the session, the destructor of the proxy will then synchronize the
│ │ │ -threads. So, the destruction of the session is performed from the
│ │ │ -session destructor call until the session_proxy destructor
│ │ │ -call. The session_proxy does not have any operations on it (since
│ │ │ -the session is being closed down, no operations are allowed on it).
│ │ │ -The only valid operation is calling the destructor:
│ │ │ -
│ │ │ -struct session_proxy {};
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
write_session_params_buf() read_session_params() write_session_params()
│ │ │ -
Declared in "libtorrent/session_params.hpp"
│ │ │ -
│ │ │ -std::vector<char> write_session_params_buf (session_params const& sp
│ │ │ - , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ -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());
│ │ │ -session_params read_session_params (span<char const> buf
│ │ │ - , 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 separately.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
piece_block
│ │ │ -
Declared in "libtorrent/piece_block.hpp"
│ │ │ -
│ │ │ -struct piece_block
│ │ │ -{
│ │ │ - piece_block (piece_index_t p_index, int b_index);
│ │ │ - piece_block () = default;
│ │ │ - bool operator< (piece_block const& b) const;
│ │ │ - bool operator== (piece_block const& b) const;
│ │ │ - bool operator!= (piece_block const& b) const;
│ │ │ -
│ │ │ - static const piece_block invalid;
│ │ │ - piece_index_t piece_index {0};
│ │ │ - int block_index = 0;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
peer_request
│ │ │ -
Declared in "libtorrent/peer_request.hpp"
│ │ │ -
represents a byte range within a piece. Internally this is is used for
│ │ │ -incoming piece requests.
│ │ │ -
│ │ │ -struct peer_request
│ │ │ -{
│ │ │ - bool operator== (peer_request const& r) const;
│ │ │ -
│ │ │ - piece_index_t piece;
│ │ │ - int start;
│ │ │ - int length;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
operator==()
│ │ │ -
│ │ │ -bool operator== (peer_request const& r) const;
│ │ │ -
│ │ │ -
returns true if the right hand side peer_request refers to the same
│ │ │ -range as this does.
│ │ │ -
[report issue]
│ │ │ -- piece
│ │ │ -- The index of the piece in which the range starts.
│ │ │ -
│ │ │ -
[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]
│ │ │ -
│ │ │ -
│ │ │ -
peer_info
│ │ │ -
Declared in "libtorrent/peer_info.hpp"
│ │ │ -
holds information and statistics about one peer
│ │ │ -that libtorrent is connected to
│ │ │ -
│ │ │ -struct peer_info
│ │ │ -{
│ │ │ - sha256_hash i2p_destination () const;
│ │ │ -
│ │ │ - std::string client;
│ │ │ - typed_bitfield<piece_index_t> pieces;
│ │ │ - std::int64_t total_download;
│ │ │ - std::int64_t total_upload;
│ │ │ - time_duration last_request;
│ │ │ - time_duration last_active;
│ │ │ - time_duration download_queue_time;
│ │ │ - static constexpr peer_flags_t interesting = 0_bit;
│ │ │ - static constexpr peer_flags_t choked = 1_bit;
│ │ │ - static constexpr peer_flags_t remote_interested = 2_bit;
│ │ │ - static constexpr peer_flags_t remote_choked = 3_bit;
│ │ │ - static constexpr peer_flags_t supports_extensions = 4_bit;
│ │ │ - static constexpr peer_flags_t outgoing_connection = 5_bit;
│ │ │ - static constexpr peer_flags_t local_connection = 5_bit;
│ │ │ - static constexpr peer_flags_t handshake = 6_bit;
│ │ │ - static constexpr peer_flags_t connecting = 7_bit;
│ │ │ - static constexpr peer_flags_t on_parole = 9_bit;
│ │ │ - static constexpr peer_flags_t seed = 10_bit;
│ │ │ - static constexpr peer_flags_t optimistic_unchoke = 11_bit;
│ │ │ - static constexpr peer_flags_t snubbed = 12_bit;
│ │ │ - static constexpr peer_flags_t upload_only = 13_bit;
│ │ │ - static constexpr peer_flags_t endgame_mode = 14_bit;
│ │ │ - static constexpr peer_flags_t holepunched = 15_bit;
│ │ │ - static constexpr peer_flags_t i2p_socket = 16_bit;
│ │ │ - static constexpr peer_flags_t utp_socket = 17_bit;
│ │ │ - static constexpr peer_flags_t ssl_socket = 18_bit;
│ │ │ - static constexpr peer_flags_t rc4_encrypted = 19_bit;
│ │ │ - static constexpr peer_flags_t plaintext_encrypted = 20_bit;
│ │ │ - peer_flags_t flags;
│ │ │ - static constexpr peer_source_flags_t tracker = 0_bit;
│ │ │ - static constexpr peer_source_flags_t dht = 1_bit;
│ │ │ - static constexpr peer_source_flags_t pex = 2_bit;
│ │ │ - static constexpr peer_source_flags_t lsd = 3_bit;
│ │ │ - static constexpr peer_source_flags_t resume_data = 4_bit;
│ │ │ - static constexpr peer_source_flags_t incoming = 5_bit;
│ │ │ - peer_source_flags_t source;
│ │ │ - int up_speed;
│ │ │ - int down_speed;
│ │ │ - int payload_up_speed;
│ │ │ - int payload_down_speed;
│ │ │ - peer_id pid;
│ │ │ - int queue_bytes;
│ │ │ - int request_timeout;
│ │ │ - int send_buffer_size;
│ │ │ - int used_send_buffer;
│ │ │ - int receive_buffer_size;
│ │ │ - int used_receive_buffer;
│ │ │ - int receive_buffer_watermark;
│ │ │ - int num_hashfails;
│ │ │ - int download_queue_length;
│ │ │ - int timed_out_requests;
│ │ │ - int busy_requests;
│ │ │ - int requests_in_buffer;
│ │ │ - int target_dl_queue_length;
│ │ │ - int upload_queue_length;
│ │ │ - int failcount;
│ │ │ - piece_index_t downloading_piece_index;
│ │ │ - int downloading_block_index;
│ │ │ - int downloading_progress;
│ │ │ - int downloading_total;
│ │ │ - static constexpr connection_type_t standard_bittorrent = 0_bit;
│ │ │ - static constexpr connection_type_t web_seed = 1_bit;
│ │ │ - static constexpr connection_type_t http_seed = 2_bit;
│ │ │ - connection_type_t connection_type;
│ │ │ - int pending_disk_bytes;
│ │ │ - int pending_disk_read_bytes;
│ │ │ - int send_quota;
│ │ │ - int receive_quota;
│ │ │ - int rtt;
│ │ │ - int num_pieces;
│ │ │ - int download_rate_peak;
│ │ │ - int upload_rate_peak;
│ │ │ - float progress;
│ │ │ - int progress_ppm;
│ │ │ - tcp::endpoint ip;
│ │ │ - tcp::endpoint local_endpoint;
│ │ │ - static constexpr bandwidth_state_flags_t bw_idle = 0_bit;
│ │ │ - static constexpr bandwidth_state_flags_t bw_limit = 1_bit;
│ │ │ - static constexpr bandwidth_state_flags_t bw_network = 2_bit;
│ │ │ - static constexpr bandwidth_state_flags_t bw_disk = 4_bit;
│ │ │ - bandwidth_state_flags_t read_state;
│ │ │ - bandwidth_state_flags_t write_state;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
i2p_destination()
│ │ │ -
│ │ │ -sha256_hash i2p_destination () const;
│ │ │ +sha256_hash i2p_destination () const;
│ │ │
│ │ │
If this peer is an i2p peer, this function returns the destination
│ │ │ address of the peer
│ │ │
[report issue]
│ │ │ - client
│ │ │ - A human readable string describing the software at the other end of
│ │ │ the connection. In some cases this information is not available, then
│ │ │ @@ -12045,113 +8131,57 @@
│ │ │ [report issue]
│ │ │ - read_state write_state
│ │ │ - bitmasks indicating what state this peer
│ │ │ is in with regards to sending and receiving data. The states are
│ │ │ defined as independent flags of type bandwidth_state_flags_t, in this
│ │ │ class.
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
info_hash_t
│ │ │ -
Declared in "libtorrent/info_hash.hpp"
│ │ │ -
class holding the info-hash of a torrent. It can hold a v1 info-hash
│ │ │ -(SHA-1) or 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 (sha1_hash h1, sha256_hash h2) noexcept;
│ │ │ - explicit info_hash_t (sha1_hash h1) noexcept;
│ │ │ - explicit info_hash_t (sha256_hash h2) noexcept;
│ │ │ - info_hash_t () noexcept = default;
│ │ │ - bool has_v2 () const;
│ │ │ - bool has_v1 () 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;
│ │ │ - bool operator< (info_hash_t const& o) const;
│ │ │ - friend std::ostream& operator<< (std::ostream& os, info_hash_t const& ih);
│ │ │ -
│ │ │ - sha1_hash v1;
│ │ │ - sha256_hash v2;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
info_hash_t()
│ │ │ -
│ │ │ -info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;
│ │ │ -explicit info_hash_t (sha1_hash h1) noexcept;
│ │ │ -explicit info_hash_t (sha256_hash h2) noexcept;
│ │ │ -info_hash_t () noexcept = default;
│ │ │ -
│ │ │ -
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_v2() has_v1() has()
│ │ │ -
│ │ │ -bool has_v2 () const;
│ │ │ -bool has_v1 () 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()
│ │ │ -
│ │ │ -sha1_hash get_best () const;
│ │ │ -
│ │ │ -
returns the v2 (truncated) info-hash, if there is one, otherwise
│ │ │ -returns the v1 info-hash
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
version()
│ │ │ -
Declared in "libtorrent/version.hpp"
│ │ │ +
│ │ │ +
load_torrent_parsed() load_torrent_file() load_torrent_buffer()
│ │ │ +
Declared in "libtorrent/load_torrent.hpp"
│ │ │
│ │ │ -char const* version ();
│ │ │ +add_torrent_params load_torrent_buffer (
│ │ │ + span<char const> buffer, load_torrent_limits const& cfg);
│ │ │ +add_torrent_params load_torrent_buffer (
│ │ │ + span<char const> buffer);
│ │ │ +add_torrent_params load_torrent_file (
│ │ │ + std::string const& filename, load_torrent_limits const& cfg);
│ │ │ +add_torrent_params load_torrent_file (
│ │ │ + std::string const& filename);
│ │ │ +add_torrent_params load_torrent_parsed (
│ │ │ + bdecode_node const& torrent_file);
│ │ │ +add_torrent_params load_torrent_parsed (
│ │ │ + bdecode_node const& torrent_file, load_torrent_limits const& cfg);
│ │ │
│ │ │ -
returns the libtorrent version as string form in this format:
│ │ │ -"<major>.<minor>.<tiny>.<tag>"
│ │ │ +
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:
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
[report issue]
│ │ │
│ │ │
truncate_files()
│ │ │
Declared in "libtorrent/truncate.hpp"
│ │ │
│ │ │ void truncate_files (file_storage const& fs, std::string const& save_path, storage_error& ec);
│ │ │
│ │ │
Truncates files larger than specified in the file_storage, saved under
│ │ │ the specified save_path.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
torrent_peer_equal()
│ │ │ -
Declared in "libtorrent/torrent_peer.hpp"
│ │ │ -
│ │ │ -inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);
│ │ │ -
│ │ │
[report issue]
│ │ │
│ │ │
make_magnet_uri()
│ │ │
Declared in "libtorrent/magnet_uri.hpp"
│ │ │
│ │ │ std::string make_magnet_uri (add_torrent_params const& atp);
│ │ │ std::string make_magnet_uri (torrent_info const& info);
│ │ │ @@ -12179,56 +8209,70 @@
│ │ │ 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, 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);
│ │ │ -add_torrent_params parse_magnet_uri (string_view uri, 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]
│ │ │ -
│ │ │ +
│ │ │ +
torrent_peer_equal()
│ │ │ +
Declared in "libtorrent/torrent_peer.hpp"
│ │ │
│ │ │ -add_torrent_params load_torrent_parsed (
│ │ │ - bdecode_node const& torrent_file);
│ │ │ -add_torrent_params load_torrent_file (
│ │ │ - std::string const& filename, load_torrent_limits const& cfg);
│ │ │ -add_torrent_params load_torrent_buffer (
│ │ │ - span<char const> buffer);
│ │ │ -add_torrent_params load_torrent_buffer (
│ │ │ - span<char const> 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);
│ │ │ +inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);
│ │ │
│ │ │ -
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:
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
version()
│ │ │ +
Declared in "libtorrent/version.hpp"
│ │ │ +
│ │ │ +char const* version ();
│ │ │ +
│ │ │ +
returns the libtorrent version as string form in this format:
│ │ │ +"<major>.<minor>.<tiny>.<tag>"
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum protocol_version
│ │ │ +
Declared in "libtorrent/info_hash.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| V1 |
│ │ │ +0 |
│ │ │ +The original BitTorrent version, using SHA-1 hashes |
│ │ │ +
│ │ │ +| V2 |
│ │ │ +1 |
│ │ │ +Version 2 of the BitTorrent protocol, using SHA-256 hashes |
│ │ │ +
│ │ │ +| NUM |
│ │ │ +2 |
│ │ │ + |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
[report issue]
│ │ │
│ │ │ -
│ │ │ +
│ │ │ +
enum connection_type
│ │ │ +
Declared in "libtorrent/peer_connection.hpp"
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| tcp |
│ │ │ +
| bittorrent |
│ │ │ 0 |
│ │ │ |
│ │ │
│ │ │ -| socks5 |
│ │ │ +
| url_seed |
│ │ │ 1 |
│ │ │ |
│ │ │
│ │ │ -| http |
│ │ │ +
| http_seed |
│ │ │ 2 |
│ │ │ |
│ │ │
│ │ │ -| utp |
│ │ │ -3 |
│ │ │ - |
│ │ │ -
│ │ │ -| i2p |
│ │ │ -4 |
│ │ │ - |
│ │ │ -
│ │ │ -| tcp_ssl |
│ │ │ -5 |
│ │ │ - |
│ │ │ -
│ │ │ -| socks5_ssl |
│ │ │ -6 |
│ │ │ - |
│ │ │ -
│ │ │ -| http_ssl |
│ │ │ -7 |
│ │ │ - |
│ │ │ -
│ │ │ -| utp_ssl |
│ │ │ -8 |
│ │ │ - |
│ │ │ -
│ │ │
│ │ │
│ │ │
[report issue]
│ │ │
│ │ │
enum portmap_transport
│ │ │
Declared in "libtorrent/portmap.hpp"
│ │ │
│ │ │ @@ -12373,72 +8393,65 @@
│ │ │
│ │ │ | udp |
│ │ │ 2 |
│ │ │ |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
enum socket_type_t
│ │ │ +
Declared in "libtorrent/socket_type.hpp"
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| bittorrent |
│ │ │ +
| tcp |
│ │ │ 0 |
│ │ │ |
│ │ │
│ │ │ -| url_seed |
│ │ │ +
| socks5 |
│ │ │ 1 |
│ │ │ |
│ │ │
│ │ │ -| http_seed |
│ │ │ +
| http |
│ │ │ 2 |
│ │ │ |
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum protocol_version
│ │ │ -
Declared in "libtorrent/info_hash.hpp"
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| name |
│ │ │ -value |
│ │ │ -description |
│ │ │ +
|---|
| utp |
│ │ │ +3 |
│ │ │ + |
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -| V1 |
│ │ │ -0 |
│ │ │ -The original BitTorrent version, using SHA-1 hashes |
│ │ │ +
| i2p |
│ │ │ +4 |
│ │ │ + |
│ │ │
│ │ │ -| V2 |
│ │ │ -1 |
│ │ │ -Version 2 of the BitTorrent protocol, using SHA-256 hashes |
│ │ │ +
| tcp_ssl |
│ │ │ +5 |
│ │ │ + |
│ │ │
│ │ │ -| NUM |
│ │ │ -2 |
│ │ │ +
| socks5_ssl |
│ │ │ +6 |
│ │ │ + |
│ │ │ +
│ │ │ +| http_ssl |
│ │ │ +7 |
│ │ │ + |
│ │ │ +
│ │ │ +| utp_ssl |
│ │ │ +8 |
│ │ │ |
│ │ │
│ │ │
│ │ │
│ │ │
[report issue]
│ │ │
│ │ │
int
│ │ │ @@ -12451,14 +8464,62 @@
│ │ │
version_minor
│ │ │
the major, minor and tiny versions of libtorrent
│ │ │
│ │ │
│ │ │ - version_tiny
│ │ │ - the major, minor and tiny versions of libtorrent
│ │ │
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
download_priority_t
│ │ │ +
Declared in "libtorrent/download_priority.hpp"
│ │ │ +
│ │ │ +- dont_download
│ │ │ +- Don't download the file or piece. Partial pieces may still be downloaded when
│ │ │ +setting file priorities.
│ │ │ +
│ │ │ +
│ │ │ +- default_priority
│ │ │ +- The default priority for files and pieces.
│ │ │ +
│ │ │ +
│ │ │ +- low_priority
│ │ │ +- The lowest priority for files and pieces.
│ │ │ +
│ │ │ +
│ │ │ +- top_priority
│ │ │ +- The highest priority for files and pieces.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
pex_flags_t
│ │ │ +
Declared in "libtorrent/pex_flags.hpp"
│ │ │ +
│ │ │ +- pex_encryption
│ │ │ +- the peer supports protocol encryption
│ │ │ +
│ │ │ +
│ │ │ +- pex_seed
│ │ │ +- the peer is a seed
│ │ │ +
│ │ │ +
│ │ │ +- pex_utp
│ │ │ +- the peer supports the uTP, transport protocol over UDP.
│ │ │ +
│ │ │ +
│ │ │ +- pex_holepunch
│ │ │ +- the peer supports the holepunch extension If this flag is received from a
│ │ │ +peer, it can be used as a rendezvous point in case direct connections to
│ │ │ +the peer fail
│ │ │ +
│ │ │ +
│ │ │ +- pex_lt_v2
│ │ │ +- protocol v2
│ │ │ +this is not a standard flag, it is only used internally
│ │ │ +
│ │ │
[report issue]
│ │ │
│ │ │
char const*
│ │ │
Declared in "libtorrent/version.hpp"
│ │ │
│ │ │ - version_str
│ │ │ - the libtorrent version in string form
│ │ │ @@ -12701,830 +8762,14 @@
│ │ │ URL.
│ │ │
│ │ │
│ │ │ - all
│ │ │ - all torrent flags combined. Can conveniently be used when creating masks
│ │ │ for flags
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
pex_flags_t
│ │ │ -
Declared in "libtorrent/pex_flags.hpp"
│ │ │ -
│ │ │ -- pex_encryption
│ │ │ -- the peer supports protocol encryption
│ │ │ -
│ │ │ -
│ │ │ -- pex_seed
│ │ │ -- the peer is a seed
│ │ │ -
│ │ │ -
│ │ │ -- pex_utp
│ │ │ -- the peer supports the uTP, transport protocol over UDP.
│ │ │ -
│ │ │ -
│ │ │ -- pex_holepunch
│ │ │ -- the peer supports the holepunch extension If this flag is received from a
│ │ │ -peer, it can be used as a rendezvous point in case direct connections to
│ │ │ -the peer fail
│ │ │ -
│ │ │ -
│ │ │ -- pex_lt_v2
│ │ │ -- protocol v2
│ │ │ -this is not a standard flag, it is only used internally
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
download_priority_t
│ │ │ -
Declared in "libtorrent/download_priority.hpp"
│ │ │ -
│ │ │ -- dont_download
│ │ │ -- Don't download the file or piece. Partial pieces may still be downloaded when
│ │ │ -setting file priorities.
│ │ │ -
│ │ │ -
│ │ │ -- default_priority
│ │ │ -- The default priority for files and pieces.
│ │ │ -
│ │ │ -
│ │ │ -- low_priority
│ │ │ -- The lowest priority for files and pieces.
│ │ │ -
│ │ │ -
│ │ │ -- top_priority
│ │ │ -- The highest priority for files and pieces.
│ │ │ -
│ │ │ -
libtorrent has a plugin interface for implementing extensions to the protocol.
│ │ │ -These can be general extensions for transferring metadata or peer exchange
│ │ │ -extensions, or it could be used to provide a way to customize the protocol
│ │ │ -to fit a particular (closed) network.
│ │ │ -
In short, the plugin interface makes it possible to:
│ │ │ -
│ │ │ -- register extension messages (sent in the extension handshake), see
│ │ │ -extensions.
│ │ │ -- add data and parse data from the extension handshake.
│ │ │ -- send extension messages and standard bittorrent messages.
│ │ │ -- override or block the handling of standard bittorrent messages.
│ │ │ -- save and restore state via the session state
│ │ │ -- see all alerts that are posted
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
a word of caution
│ │ │ -
Writing your own plugin is a very easy way to introduce serious bugs such as
│ │ │ -dead locks and race conditions. Since a plugin has access to internal
│ │ │ -structures it is also quite easy to sabotage libtorrent's operation.
│ │ │ -
All the callbacks are always called from the libtorrent network thread. In
│ │ │ -case portions of your plugin are called from other threads, typically the main
│ │ │ -thread, you cannot use any of the member functions on the internal structures
│ │ │ -in libtorrent, since those require being called from the libtorrent network
│ │ │ -thread . Furthermore, you also need to synchronize your own shared data
│ │ │ -within the plugin, to make sure it is not accessed at the same time from the
│ │ │ -libtorrent thread (through a callback). If you need to send out a message
│ │ │ -from another thread, it is advised to use an internal queue, and do the
│ │ │ -actual sending in tick().
│ │ │ -
Since the plugin interface gives you easy access to internal structures, it
│ │ │ -is not supported as a stable API. Plugins should be considered specific to a
│ │ │ -specific version of libtorrent. Although, in practice the internals mostly
│ │ │ -don't change that dramatically.
│ │ │ -
│ │ │ -
│ │ │ -
plugin-interface
│ │ │ -
The plugin interface consists of three base classes that the plugin may
│ │ │ -implement. These are called plugin, torrent_plugin and peer_plugin.
│ │ │ -They are found in the <libtorrent/extensions.hpp> header.
│ │ │ -
These plugins are instantiated for each session, torrent and possibly each peer,
│ │ │ -respectively.
│ │ │ -
For plugins that only need per torrent state, it is enough to only implement
│ │ │ -torrent_plugin and pass a constructor function or function object to
│ │ │ -session::add_extension() or torrent_handle::add_extension() (if the
│ │ │ -torrent has already been started and you want to hook in the extension at
│ │ │ -run-time).
│ │ │ -
The signature of the function is:
│ │ │ -
│ │ │ -std::shared_ptr<torrent_plugin> (*)(torrent_handle const&, client_data_t);
│ │ │ -
│ │ │ -
The second argument is the userdata passed to session::add_torrent() or
│ │ │ -torrent_handle::add_extension().
│ │ │ -
The function should return a std::shared_ptr<torrent_plugin> which
│ │ │ -may or may not be 0. If it is a nullptr, the extension is simply ignored
│ │ │ -for this torrent. If it is a valid pointer (to a class inheriting
│ │ │ -torrent_plugin), it will be associated with this torrent and callbacks
│ │ │ -will be made on torrent events.
│ │ │ -
For more elaborate plugins which require session wide state, you would
│ │ │ -implement plugin, construct an object (in a std::shared_ptr) and pass
│ │ │ -it in to session::add_extension().
│ │ │ -
│ │ │ -
│ │ │ -
custom alerts
│ │ │ -
Since plugins are running within internal libtorrent threads, one convenient
│ │ │ -way to communicate with the client is to post custom alerts.
│ │ │ -
The expected interface of any alert, apart from deriving from the alert
│ │ │ -base class, looks like this:
│ │ │ -
│ │ │ -static const int alert_type = <unique alert ID>;
│ │ │ -virtual int type() const { return alert_type; }
│ │ │ -
│ │ │ -virtual std::string message() const;
│ │ │ -
│ │ │ -static const alert_category_t static_category = <bitmask of alert::category_t flags>;
│ │ │ -virtual alert_category_t category() const { return static_category; }
│ │ │ -
│ │ │ -virtual char const* what() const { return <string literal of the name of this alert>; }
│ │ │ -
│ │ │ -
The alert_type is used for the type-checking in alert_cast. It must
│ │ │ -not collide with any other alert. The built-in alerts in libtorrent will
│ │ │ -not use alert type IDs greater than user_alert_id. When defining your
│ │ │ -own alert, make sure it's greater than this constant.
│ │ │ -
type() is the run-time equivalence of the alert_type.
│ │ │ -
The message() virtual function is expected to construct a useful
│ │ │ -string representation of the alert and the event or data it represents.
│ │ │ -Something convenient to put in a log file for instance.
│ │ │ -
clone() is used internally to copy alerts. The suggested implementation
│ │ │ -of simply allocating a new instance as a copy of *this is all that's
│ │ │ -expected.
│ │ │ -
The static category is required for checking whether or not the category
│ │ │ -for a specific alert is enabled or not, without instantiating the alert.
│ │ │ -The category virtual function is the run-time equivalence.
│ │ │ -
The what() virtual function may simply be a string literal of the class
│ │ │ -name of your alert.
│ │ │ -
For more information, see the alert section.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
peer_connection_handle
│ │ │ -
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ -
the peer_connection_handle class provides a handle to the internal peer
│ │ │ -connection object, to be used by plugins. This is a low level interface that
│ │ │ -may not be stable across libtorrent versions
│ │ │ -
│ │ │ -struct peer_connection_handle
│ │ │ -{
│ │ │ - explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);
│ │ │ - connection_type type () const;
│ │ │ - peer_plugin const* find_plugin (string_view type) const;
│ │ │ - void add_extension (std::shared_ptr<peer_plugin>);
│ │ │ - bool is_seed () const;
│ │ │ - bool upload_only () const;
│ │ │ - peer_id const& pid () const;
│ │ │ - bool has_piece (piece_index_t i) const;
│ │ │ - bool is_choked () const;
│ │ │ - bool is_interesting () const;
│ │ │ - bool has_peer_choked () const;
│ │ │ - bool is_peer_interested () 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_outgoing () const;
│ │ │ - bool is_disconnecting () const;
│ │ │ - bool is_connecting () const;
│ │ │ - void disconnect (error_code const& ec, operation_t op
│ │ │ - , disconnect_severity_t = peer_connection_interface::normal);
│ │ │ - bool on_local_network () const;
│ │ │ - bool ignore_unchoke_slots () const;
│ │ │ - bool failed () 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;
│ │ │ - std::shared_ptr<peer_connection> native_handle () const;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
bt_peer_connection_handle
│ │ │ -
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ -
The bt_peer_connection_handle provides a handle to the internal bittorrent
│ │ │ -peer connection object to plugins. It's low level and may not be a stable API
│ │ │ -across libtorrent versions.
│ │ │ -
│ │ │ -struct bt_peer_connection_handle : peer_connection_handle
│ │ │ -{
│ │ │ - explicit bt_peer_connection_handle (peer_connection_handle pc);
│ │ │ - bool support_extensions () const;
│ │ │ - bool packet_finished () const;
│ │ │ - bool supports_encryption () const;
│ │ │ - void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ - void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ - std::shared_ptr<bt_peer_connection> native_handle () const;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
plugin
│ │ │ -
Declared in "libtorrent/extensions.hpp"
│ │ │ -
this is the base class for a session plugin. One primary feature
│ │ │ -is that it is notified of all torrents that are added to the session,
│ │ │ -and can add its own torrent_plugins.
│ │ │ -
│ │ │ -struct plugin
│ │ │ -{
│ │ │ - virtual feature_flags_t implemented_features ();
│ │ │ - virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);
│ │ │ - virtual void added (session_handle const&);
│ │ │ - virtual void abort ();
│ │ │ - virtual bool on_dht_request (string_view /* query */
│ │ │ - , udp::endpoint const& /* source */, bdecode_node const& /* message */
│ │ │ - , entry& /* response */);
│ │ │ - virtual void on_alert (alert const*);
│ │ │ - virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */
│ │ │ - , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);
│ │ │ - virtual void on_tick ();
│ │ │ - virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);
│ │ │ - virtual std::map<std::string, std::string> save_state () const;
│ │ │ - virtual void load_state (std::map<std::string, std::string> const&);
│ │ │ -
│ │ │ - static constexpr feature_flags_t optimistic_unchoke_feature = 1_bit;
│ │ │ - static constexpr feature_flags_t tick_feature = 2_bit;
│ │ │ - static constexpr feature_flags_t dht_request_feature = 3_bit;
│ │ │ - static constexpr feature_flags_t alert_feature = 4_bit;
│ │ │ - static constexpr feature_flags_t unknown_torrent_feature = 5_bit;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
implemented_features()
│ │ │ -
│ │ │ -virtual feature_flags_t implemented_features ();
│ │ │ -
│ │ │ -
This function is expected to return a bitmask indicating which features
│ │ │ -this plugin implements. Some callbacks on this object may not be called
│ │ │ -unless the corresponding feature flag is returned here. Note that
│ │ │ -callbacks may still be called even if the corresponding feature is not
│ │ │ -specified in the return value here. See feature_flags_t for possible
│ │ │ -flags to return.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
new_torrent()
│ │ │ -
│ │ │ -virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);
│ │ │ -
│ │ │ -
this is called by the session every time a new torrent is added.
│ │ │ -The torrent* points to the internal torrent object created
│ │ │ -for the new torrent. The client_data_t is the userdata pointer as
│ │ │ -passed in via add_torrent_params.
│ │ │ -
If the plugin returns a torrent_plugin instance, it will be added
│ │ │ -to the new torrent. Otherwise, return an empty shared_ptr to a
│ │ │ -torrent_plugin (the default).
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
added()
│ │ │ -
│ │ │ -virtual void added (session_handle const&);
│ │ │ -
│ │ │ -
called when plugin is added to a session
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
abort()
│ │ │ -
│ │ │ -virtual void abort ();
│ │ │ -
│ │ │ -
called when the session is aborted
│ │ │ -the plugin should perform any cleanup necessary to allow the session's
│ │ │ -destruction (e.g. cancel outstanding async operations)
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_dht_request()
│ │ │ -
│ │ │ -virtual bool on_dht_request (string_view /* query */
│ │ │ - , udp::endpoint const& /* source */, bdecode_node const& /* message */
│ │ │ - , entry& /* response */);
│ │ │ -
│ │ │ -
called when a dht request is received.
│ │ │ -If your plugin expects this to be called, make sure to include the flag
│ │ │ -dht_request_feature in the return value from implemented_features().
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_alert()
│ │ │ -
│ │ │ -virtual void on_alert (alert const*);
│ │ │ -
│ │ │ -
called when an alert is posted alerts that are filtered are not posted.
│ │ │ -If your plugin expects this to be called, make sure to include the flag
│ │ │ -alert_feature in the return value from implemented_features().
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_unknown_torrent()
│ │ │ -
│ │ │ -virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */
│ │ │ - , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);
│ │ │ -
│ │ │ -
return true if the add_torrent_params should be added
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_tick()
│ │ │ -
│ │ │ -virtual void on_tick ();
│ │ │ -
│ │ │ -
called once per second.
│ │ │ -If your plugin expects this to be called, make sure to include the flag
│ │ │ -tick_feature in the return value from implemented_features().
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
get_unchoke_priority()
│ │ │ -
│ │ │ -virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);
│ │ │ -
│ │ │ -
called when choosing peers to optimistically unchoke. The return value
│ │ │ -indicates the peer's priority for unchoking. Lower return values
│ │ │ -correspond to higher priority. Priorities above 2^63-1 are reserved.
│ │ │ -If your plugin has no priority to assign a peer it should return 2^64-1.
│ │ │ -If your plugin expects this to be called, make sure to include the flag
│ │ │ -optimistic_unchoke_feature in the return value from implemented_features().
│ │ │ -If multiple plugins implement this function the lowest return value
│ │ │ -(i.e. the highest priority) is used.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
load_state()
│ │ │ -
│ │ │ -virtual void load_state (std::map<std::string, std::string> const&);
│ │ │ -
│ │ │ -
called on startup while loading settings state from the session_params
│ │ │ -
[report issue]
│ │ │ -- optimistic_unchoke_feature
│ │ │ -- include this bit if your plugin needs to alter the order of the
│ │ │ -optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()
│ │ │ -callback be called.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- tick_feature
│ │ │ -- include this bit if your plugin needs to have on_tick() called
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- dht_request_feature
│ │ │ -- include this bit if your plugin needs to have on_dht_request()
│ │ │ -called
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- alert_feature
│ │ │ -- include this bit if your plugin needs to have on_alert()
│ │ │ -called
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- unknown_torrent_feature
│ │ │ -- include this bit if your plugin needs to have on_unknown_torrent()
│ │ │ -called even if there is no active torrent in the session
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
torrent_plugin
│ │ │ -
Declared in "libtorrent/extensions.hpp"
│ │ │ -
Torrent plugins are associated with a single torrent and have a number
│ │ │ -of functions called at certain events. Many of its functions have the
│ │ │ -ability to change or override the default libtorrent behavior.
│ │ │ -
│ │ │ -struct torrent_plugin
│ │ │ -{
│ │ │ - virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);
│ │ │ - virtual void on_piece_failed (piece_index_t);
│ │ │ - virtual void on_piece_pass (piece_index_t);
│ │ │ - virtual void tick ();
│ │ │ - 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;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
new_connection()
│ │ │ -
│ │ │ -virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);
│ │ │ -
│ │ │ -
This function is called each time a new peer is connected to the torrent. You
│ │ │ -may choose to ignore this by just returning a default constructed
│ │ │ -shared_ptr (in which case you don't need to override this member
│ │ │ -function).
│ │ │ -
If you need an extension to the peer connection (which most plugins do) you
│ │ │ -are supposed to return an instance of your peer_plugin class. Which in
│ │ │ -turn will have its hook functions called on event specific to that peer.
│ │ │ -
The peer_connection_handle will be valid as long as the shared_ptr
│ │ │ -is being held by the torrent object. So, it is generally a good idea to not
│ │ │ -keep a shared_ptr to your own peer_plugin. If you want to keep references
│ │ │ -to it, use weak_ptr.
│ │ │ -
If this function throws an exception, the connection will be closed.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_piece_failed() on_piece_pass()
│ │ │ -
│ │ │ -virtual void on_piece_failed (piece_index_t);
│ │ │ -virtual void on_piece_pass (piece_index_t);
│ │ │ -
│ │ │ -
These hooks are called when a piece passes the hash check or fails the hash
│ │ │ -check, respectively. The index is the piece index that was downloaded.
│ │ │ -It is possible to access the list of peers that participated in sending the
│ │ │ -piece through the torrent and the piece_picker.
│ │ │ -
[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_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 will recurse back into your handler, so in order to invoke the
│ │ │ -standard handler, you have to keep your own state on whether you want standard
│ │ │ -behavior or overridden behavior.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_files_checked()
│ │ │ -
│ │ │ -virtual void on_files_checked ();
│ │ │ -
│ │ │ -
This function is called when the initial files of the torrent have been
│ │ │ -checked. If there are no files to check, this function is called immediately.
│ │ │ -
i.e. This function is always called when the torrent is in a state where it
│ │ │ -can start downloading.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_state()
│ │ │ -
│ │ │ -virtual void on_state (torrent_status::state_t);
│ │ │ -
│ │ │ -
called when the torrent changes state
│ │ │ -the state is one of torrent_status::state_t
│ │ │ -enum members
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_add_peer()
│ │ │ -
│ │ │ -virtual void on_add_peer (tcp::endpoint const&,
│ │ │ - peer_source_flags_t, add_peer_flags_t);
│ │ │ -
│ │ │ -
called every time a new peer is added to the peer list.
│ │ │ -This is before the peer is connected to. For flags, see
│ │ │ -torrent_plugin::flags_t. The source argument refers to
│ │ │ -the source where we learned about this peer from. It's a
│ │ │ -bitmask, because many sources may have told us about the same
│ │ │ -peer. For peer source flags, see peer_info::peer_source_flags.
│ │ │ -
[report issue]
│ │ │ -- first_time
│ │ │ -- this is the first time we see this peer
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- filtered
│ │ │ -- this peer was not added because it was
│ │ │ -filtered by the IP filter
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
peer_plugin
│ │ │ -
Declared in "libtorrent/extensions.hpp"
│ │ │ -
peer plugins are associated with a specific peer. A peer could be
│ │ │ -both a regular bittorrent peer (bt_peer_connection) or one of the
│ │ │ -web seed connections (web_peer_connection or http_seed_connection).
│ │ │ -In order to only attach to certain peers, make your
│ │ │ -torrent_plugin::new_connection only return a plugin for certain peer
│ │ │ -connection types
│ │ │ -
│ │ │ -struct peer_plugin
│ │ │ -{
│ │ │ - 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_choke ();
│ │ │ - virtual bool on_unchoke ();
│ │ │ - virtual bool on_not_interested ();
│ │ │ - virtual bool on_have_all ();
│ │ │ - virtual bool on_interested ();
│ │ │ - virtual bool on_have_none ();
│ │ │ - virtual bool on_allowed_fast (piece_index_t);
│ │ │ - virtual bool on_dont_have (piece_index_t);
│ │ │ - virtual bool on_have (piece_index_t);
│ │ │ - virtual bool on_request (peer_request const&);
│ │ │ - virtual bool on_bitfield (bitfield const& /*bitfield*/);
│ │ │ - virtual bool on_piece (peer_request const& /*piece*/
│ │ │ - , span<char const> /*buf*/);
│ │ │ - virtual bool on_cancel (peer_request const&);
│ │ │ - virtual bool on_reject (peer_request const&);
│ │ │ - virtual bool on_suggest (piece_index_t);
│ │ │ - virtual void sent_choke ();
│ │ │ - virtual void sent_have_all ();
│ │ │ - virtual void sent_request (peer_request const&);
│ │ │ - virtual void sent_have_none ();
│ │ │ - virtual void sent_cancel (peer_request const&);
│ │ │ - virtual void sent_reject_request (peer_request const&);
│ │ │ - virtual void sent_suggest (piece_index_t);
│ │ │ - virtual void sent_allow_fast (piece_index_t);
│ │ │ - virtual void sent_unchoke ();
│ │ │ - virtual void sent_not_interested ();
│ │ │ - virtual void sent_interested ();
│ │ │ - virtual void sent_have (piece_index_t);
│ │ │ - virtual void sent_piece (peer_request const&);
│ │ │ - 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_failed (piece_index_t);
│ │ │ - virtual void on_piece_pass (piece_index_t);
│ │ │ - virtual void tick ();
│ │ │ - virtual bool write_request (peer_request const&);
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
type()
│ │ │ -
│ │ │ -virtual string_view type () const;
│ │ │ -
│ │ │ -
This function is expected to return the name of
│ │ │ -the plugin.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
add_handshake()
│ │ │ -
│ │ │ -virtual void add_handshake (entry&);
│ │ │ -
│ │ │ -
can add entries to the extension handshake
│ │ │ -this is not called for web seeds
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_disconnect()
│ │ │ -
│ │ │ -virtual void on_disconnect (error_code const&);
│ │ │ -
│ │ │ -
called when the peer is being disconnected.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_connected()
│ │ │ -
│ │ │ -virtual void on_connected ();
│ │ │ -
│ │ │ -
called when the peer is successfully connected. Note that
│ │ │ -incoming connections will have been connected by the time
│ │ │ -the peer plugin is attached to it, and won't have this hook
│ │ │ -called.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_handshake()
│ │ │ -
│ │ │ -virtual bool on_handshake (span<char const>);
│ │ │ -
│ │ │ -
this is called when the initial bittorrent handshake is received.
│ │ │ -Returning false means that the other end doesn't support this extension
│ │ │ -and will remove it from the list of plugins. this is not called for web
│ │ │ -seeds
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
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_allowed_fast() on_interested() on_unchoke() on_have_none() on_not_interested() on_dont_have() on_request() on_have_all() on_bitfield() on_choke()
│ │ │ -
│ │ │ -virtual bool on_choke ();
│ │ │ -virtual bool on_unchoke ();
│ │ │ -virtual bool on_not_interested ();
│ │ │ -virtual bool on_have_all ();
│ │ │ -virtual bool on_interested ();
│ │ │ -virtual bool on_have_none ();
│ │ │ -virtual bool on_allowed_fast (piece_index_t);
│ │ │ -virtual bool on_dont_have (piece_index_t);
│ │ │ -virtual bool on_have (piece_index_t);
│ │ │ -virtual bool on_request (peer_request const&);
│ │ │ -virtual bool on_bitfield (bitfield const& /*bitfield*/);
│ │ │ -
│ │ │ -
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<char const> /*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_piece() sent_interested() sent_not_interested() sent_unchoke() sent_have()
│ │ │ -
│ │ │ -virtual void sent_unchoke ();
│ │ │ -virtual void sent_not_interested ();
│ │ │ -virtual void sent_interested ();
│ │ │ -virtual void sent_have (piece_index_t);
│ │ │ -virtual void sent_piece (peer_request const&);
│ │ │ -
│ │ │ -
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]
│ │ │ -
│ │ │ -
can_disconnect()
│ │ │ -
│ │ │ -virtual bool can_disconnect (error_code const& /*ec*/);
│ │ │ -
│ │ │ -
called when libtorrent think this peer should be disconnected.
│ │ │ -if the plugin returns false, the peer will not be disconnected.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_extended()
│ │ │ -
│ │ │ -virtual bool on_extended (int /*length*/, int /*msg*/,
│ │ │ - span<char const> /*body*/);
│ │ │ -
│ │ │ -
called when an extended message is received. If returning true,
│ │ │ -the message is not processed by any other plugin and if false
│ │ │ -is returned the next plugin in the chain will receive it to
│ │ │ -be able to handle it. This is not called for web seeds.
│ │ │ -thus function may be called more than once per incoming message, but
│ │ │ -only the last of the calls will the body size equal the length.
│ │ │ -i.e. Every time another fragment of the message is received, this
│ │ │ -function will be called, until finally the whole message has been
│ │ │ -received. The purpose of this is to allow early disconnects for invalid
│ │ │ -messages and for reporting progress of receiving large messages.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_unknown_message()
│ │ │ -
│ │ │ -virtual bool on_unknown_message (int /*length*/, int /*msg*/,
│ │ │ - span<char const> /*body*/);
│ │ │ -
│ │ │ -
this is not called for web seeds
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
on_piece_failed() on_piece_pass()
│ │ │ -
│ │ │ -virtual void on_piece_failed (piece_index_t);
│ │ │ -virtual void on_piece_pass (piece_index_t);
│ │ │ -
│ │ │ -
called when a piece that this peer participated in either
│ │ │ -fails or passes the hash_check
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
tick()
│ │ │ -
│ │ │ -virtual void tick ();
│ │ │ -
│ │ │ -
called approximately once every second
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
write_request()
│ │ │ -
│ │ │ -virtual bool write_request (peer_request const&);
│ │ │ -
│ │ │ -
called each time a request message is to be sent. If true
│ │ │ -is returned, the 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_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]
│ │ │ -
encrypt()
│ │ │ -
│ │ │ -encrypt (span<span<char>> /*send_vec*/) = 0;
│ │ │ -
│ │ │ -
encrypted the provided buffers and returns the number of bytes which
│ │ │ -are now ready to be sent to the lower layer. This must be at least
│ │ │ -as large as the number of bytes passed in and may be larger if there
│ │ │ -is additional data to be inserted at the head of the send buffer.
│ │ │ -The additional data is returned as the second tuple value. Any
│ │ │ -returned buffer as well as the iovec itself, to be prepended to the
│ │ │ -send buffer, must be owned by the crypto plugin and guaranteed to stay
│ │ │ -alive until the crypto_plugin is destructed or this function is called
│ │ │ -again.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
decrypt()
│ │ │ -
│ │ │ -virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;
│ │ │ -
│ │ │ -
decrypt the provided buffers.
│ │ │ -returns is a tuple representing the values
│ │ │ -(consume, produce, packet_size)
│ │ │ -
consume is set to the number of bytes which should be trimmed from the
│ │ │ -head of the buffers, default is 0
│ │ │ -
produce is set to the number of bytes of payload which are now ready to
│ │ │ -be sent to the upper layer. default is the number of bytes passed in receive_vec
│ │ │ -
packet_size is set to the minimum number of bytes which must be read to
│ │ │ -advance the next step of decryption. default is 0
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
create_ut_pex_plugin()
│ │ │ -
Declared in "libtorrent/extensions/ut_pex.hpp"
│ │ │ -
│ │ │ -std::shared_ptr<torrent_plugin> create_ut_pex_plugin (torrent_handle const&, client_data_t);
│ │ │ -
│ │ │ -
constructor function for the ut_pex extension. The ut_pex
│ │ │ -extension allows peers to gossip about their connections, allowing
│ │ │ -the swarm stay well connected and peers aware of more peers in the
│ │ │ -swarm. This extension is enabled by default unless explicitly disabled in
│ │ │ -the session constructor.
│ │ │ -
This can either be passed in the add_torrent_params::extensions field, or
│ │ │ -via torrent_handle::add_extension().
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
create_smart_ban_plugin()
│ │ │ -
Declared in "libtorrent/extensions/smart_ban.hpp"
│ │ │ -
│ │ │ -std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);
│ │ │ -
│ │ │ -
constructor function for the smart ban extension. The extension keeps
│ │ │ -track of the data peers have sent us for failing pieces and once the
│ │ │ -piece completes and passes the hash check bans the peers that turned
│ │ │ -out to have sent corrupt data.
│ │ │ -This function can either be passed in the add_torrent_params::extensions
│ │ │ -field, or via torrent_handle::add_extension().
│ │ │
[report issue]
│ │ │
│ │ │
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).
│ │ │ @@ -13555,18 +8800,18 @@
│ │ │
remove() add()
│ │ │
│ │ │ 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 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
│ │ │ @@ -13678,2102 +8923,7358 @@
│ │ │ [report issue]
│ │ │ - upload_priority download_priority
│ │ │ - relative priorities used by the bandwidth allocator in the rate
│ │ │ limiter. If no rate limits are in use, the priority is not used
│ │ │ either. Priorities start at 1 (0 is not a valid priority) and may not
│ │ │ exceed 255.
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
ip_filter
│ │ │ -
Declared in "libtorrent/ip_filter.hpp"
│ │ │ -
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.
│ │ │ +
The pop_alerts() function on session is the main interface for retrieving
│ │ │ +alerts (warnings, messages and errors from libtorrent). If no alerts have
│ │ │ +been posted by libtorrent pop_alerts() will return an empty list.
│ │ │ +
By default, only errors are reported. settings_pack::alert_mask can be
│ │ │ +used to specify which kinds of events should be reported. The alert mask is
│ │ │ +a combination of the alert_category_t flags in the alert class.
│ │ │ +
Every alert belongs to one or more category. There is a cost associated with
│ │ │ +posting alerts. Only alerts that belong to an enabled category are
│ │ │ +posted. Setting the alert bitmask to 0 will disable all alerts (except those
│ │ │ +that are non-discardable). Alerts that are responses to API calls such as
│ │ │ +save_resume_data() and post_session_stats() are non-discardable and will be
│ │ │ +posted even if their category is disabled.
│ │ │ +
There are other alert base classes that some alerts derive from, all the
│ │ │ +alerts that are generated for a specific torrent are derived from
│ │ │ +torrent_alert, and tracker events derive from tracker_alert.
│ │ │ +
Alerts returned by pop_alerts() are only valid until the next call to
│ │ │ +pop_alerts(). You may not copy an alert object to access it after the next
│ │ │ +call to pop_alerts(). Internal members of alerts also become invalid once
│ │ │ +pop_alerts() is called again.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_routing_bucket
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
struct to hold information about a single DHT routing table bucket
│ │ │
│ │ │ -struct ip_filter
│ │ │ +struct dht_routing_bucket
│ │ │ {
│ │ │ - ip_filter& operator= (ip_filter const&);
│ │ │ - ~ip_filter ();
│ │ │ - ip_filter (ip_filter&&);
│ │ │ - ip_filter& operator= (ip_filter&&);
│ │ │ - ip_filter ();
│ │ │ - ip_filter (ip_filter const&);
│ │ │ - 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;
│ │ │ + int num_nodes = 0;
│ │ │ + int num_replacements = 0;
│ │ │ + int last_active = 0;
│ │ │ +};
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_nodes num_replacements
│ │ │ +- the total number of nodes and replacement nodes
│ │ │ +in the routing table
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- last_active
│ │ │ +- number of seconds since last activity
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
torrent_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is a base class for alerts that are associated with a
│ │ │ +specific torrent. It contains a handle to the torrent.
│ │ │ +
Note that by the time the client receives a torrent_alert, its
│ │ │ +handle member may be invalid.
│ │ │ +
│ │ │ +struct torrent_alert : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* torrent_name () const;
│ │ │
│ │ │ - enum access_flags
│ │ │ - {
│ │ │ - blocked,
│ │ │ - };
│ │ │ + torrent_handle handle;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
empty()
│ │ │ +
[report issue]
│ │ │ +
message()
│ │ │
│ │ │ -bool empty () const;
│ │ │ +std::string message () const override;
│ │ │
│ │ │ -
returns true if the filter does not contain any rules
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
peer_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
The peer alert is a base class for alerts that refer to a specific peer. It includes all
│ │ │ +the information to identify the peer. i.e. ip and peer-id.
│ │ │
│ │ │ -void add_rule (address const& first, address const& last, std::uint32_t flags);
│ │ │ +struct peer_alert : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + aux::noexcept_movable<tcp::endpoint> endpoint;
│ │ │ + peer_id pid;
│ │ │ +};
│ │ │
│ │ │ -
Adds a rule to the filter. first and last defines a range of
│ │ │ -ip addresses that will be marked with the given flags. The flags
│ │ │ -can currently be 0, which means allowed, or ip_filter::blocked, which
│ │ │ -means disallowed.
│ │ │ -
precondition:
│ │ │ -first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()
│ │ │ -
postcondition:
│ │ │ -access(x) == flags for every x in the range [first, last]
│ │ │ -
This means that in a case of overlapping ranges, the last one applied takes
│ │ │ -precedence.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
access()
│ │ │ +
[report issue]
│ │ │ +- endpoint
│ │ │ +- The peer's IP address and port.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- pid
│ │ │ +- the peer ID, if known.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
tracker_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is a base class used for alerts that are associated with a
│ │ │ +specific tracker. It derives from torrent_alert since a tracker
│ │ │ +is also associated with a specific torrent.
│ │ │
│ │ │ -std::uint32_t access (address const& addr) const;
│ │ │ +struct tracker_alert : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* tracker_url () const;
│ │ │ +
│ │ │ + aux::noexcept_movable<tcp::endpoint> local_endpoint;
│ │ │ +};
│ │ │
│ │ │ -
Returns the access permissions for the given address (addr). The permission
│ │ │ -can currently be 0 or ip_filter::blocked. The complexity of this operation
│ │ │ -is O(log n), where n is the minimum number of non-overlapping ranges to describe
│ │ │ -the current filter.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
export_filter()
│ │ │ +
[report issue]
│ │ │ +
tracker_url()
│ │ │
│ │ │ -filter_tuple_t export_filter () const;
│ │ │ +char const* tracker_url () const;
│ │ │
│ │ │ -
This function will return the current state of the filter in the minimum number of
│ │ │ -ranges possible. They are sorted from ranges in low addresses to high addresses. Each
│ │ │ -entry in the returned vector is a range with the access control specified in its
│ │ │ -flags field.
│ │ │ -
The return value is a tuple containing two range-lists. One for IPv4 addresses
│ │ │ -and one for IPv6 addresses.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum access_flags
│ │ │ -
Declared in "libtorrent/ip_filter.hpp"
│ │ │ +
returns a 0-terminated string of the tracker's URL
│ │ │ +
[report issue]
│ │ │ +- local_endpoint
│ │ │ +- endpoint of the listen interface being announced
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
torrent_removed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
The torrent_removed_alert is posted whenever a torrent is removed. Since
│ │ │ +the torrent handle in its base class will usually be invalid (since the torrent
│ │ │ +is already removed) it has the info hash as a member, to identify it.
│ │ │ +It's posted when the alert_category::status bit is set in the alert_mask.
│ │ │ +
Note that the handle remains valid for some time after
│ │ │ +torrent_removed_alert is posted, as long as some internal libtorrent
│ │ │ +task (such as an I/O task) refers to it. Additionally, other alerts like
│ │ │ +save_resume_data_alert may be posted after torrent_removed_alert.
│ │ │ +To synchronize on whether the torrent has been removed or not, call
│ │ │ +torrent_handle::in_session(). This will return true before
│ │ │ +torrent_removed_alert is posted, and false afterward.
│ │ │ +
Even though the handle member doesn't point to an existing torrent anymore,
│ │ │ +it is still useful for comparing to other handles, which may also no
│ │ │ +longer point to existing torrents, but to the same non-existing torrents.
│ │ │ +
The torrent_handle acts as a weak_ptr, even though its object no
│ │ │ +longer exists, it can still compare equal to another weak pointer which
│ │ │ +points to the same non-existent object.
│ │ │ +
│ │ │ +struct torrent_removed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + info_hash_t info_hashes;
│ │ │ + client_data_t userdata;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- userdata
│ │ │ +- 'userdata` as set in add_torrent_params at torrent creation.
│ │ │ +This can be used to associate this torrent with related data
│ │ │ +in the client application more efficiently than info_hashes.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
read_piece_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted when the asynchronous read operation initiated by
│ │ │ +a call to torrent_handle::read_piece() is completed. If the read failed, the torrent
│ │ │ +is paused and an error state is set and the buffer member of the alert
│ │ │ +is 0. If successful, buffer points to a buffer containing all the data
│ │ │ +of the piece. piece is the piece index that was read. size is the
│ │ │ +number of bytes that was read.
│ │ │ +
If the operation fails, error will indicate what went wrong.
│ │ │ +
│ │ │ +struct read_piece_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ + error_code const error;
│ │ │ + boost::shared_array<char> const buffer;
│ │ │ + piece_index_t const piece;
│ │ │ + int const size;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_completed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is posted whenever an individual file completes its download. i.e.
│ │ │ +All pieces overlapping this file have passed their hash check.
│ │ │ +
│ │ │ +struct file_completed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + file_index_t const index;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- index
│ │ │ +- refers to the index of the file that completed.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_renamed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is posted as a response to a torrent_handle::rename_file() call, if the rename
│ │ │ +operation succeeds.
│ │ │ +
│ │ │ +struct file_renamed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + 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()
│ │ │ +
│ │ │ +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]
│ │ │ +
│ │ │ +
│ │ │ +
file_rename_failed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is posted as a response to a torrent_handle::rename_file() call, if the rename
│ │ │ +operation failed.
│ │ │ +
│ │ │ +struct file_rename_failed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ + file_index_t const index;
│ │ │ + error_code const error;
│ │ │ +};
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- index error
│ │ │ +- refers to the index of the file that was supposed to be renamed,
│ │ │ +error is the error code returned from the filesystem.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │
│ │ │ -
│ │ │ -
port_filter
│ │ │ -
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.
│ │ │ +
│ │ │ +
state_changed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
Generated whenever a torrent changes its state.
│ │ │
│ │ │ -class port_filter
│ │ │ +struct state_changed_alert final : torrent_alert
│ │ │ {
│ │ │ - port_filter ();
│ │ │ - port_filter (port_filter&&);
│ │ │ - port_filter& operator= (port_filter const&);
│ │ │ - ~port_filter ();
│ │ │ - port_filter& operator= (port_filter&&);
│ │ │ - port_filter (port_filter const&);
│ │ │ - void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);
│ │ │ - std::uint32_t access (std::uint16_t port) const;
│ │ │ + std::string message () const override;
│ │ │
│ │ │ - enum access_flags
│ │ │ - {
│ │ │ - blocked,
│ │ │ - };
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + torrent_status::state_t const state;
│ │ │ + torrent_status::state_t const prev_state;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
add_rule()
│ │ │ +
[report issue]
│ │ │ +- state
│ │ │ +- the new state of the torrent.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- prev_state
│ │ │ +- the previous state.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
tracker_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated on tracker time outs, premature disconnects,
│ │ │ +invalid response or a HTTP response other than "200 OK". From the alert
│ │ │ +you can get the handle to the torrent the tracker belongs to.
│ │ │
│ │ │ -void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);
│ │ │ +struct tracker_error_alert final : tracker_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* failure_reason () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::tracker | alert_category::error;
│ │ │ + int const times_in_row;
│ │ │ + error_code const error;
│ │ │ + operation_t op;
│ │ │ + protocol_version version;
│ │ │ +};
│ │ │
│ │ │ -
set the flags for the specified port range (first, last) to
│ │ │ -flags overwriting any existing rule for those ports. The range
│ │ │ -is inclusive, i.e. the port last also has the flag set on it.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
access()
│ │ │ +
[report issue]
│ │ │ +
failure_reason()
│ │ │
│ │ │ -std::uint32_t access (std::uint16_t port) const;
│ │ │ +char const* failure_reason () const;
│ │ │
│ │ │ -
test the specified port (port) for whether it is blocked
│ │ │ -or not. The returned value is the flags set for this port.
│ │ │ -see access_flags.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum access_flags
│ │ │ -
Declared in "libtorrent/ip_filter.hpp"
│ │ │ +
if the tracker sent a "failure reason" string, it will be returned
│ │ │ +here.
│ │ │ +
[report issue]
│ │ │ +- times_in_row
│ │ │ +- This member says how many times in a row this tracker has failed.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error code indicating why the tracker announce failed. If it is
│ │ │ +is lt::errors::tracker_failure the failure_reason() might contain
│ │ │ +a more detailed description of why the tracker rejected the request.
│ │ │ +HTTP status codes indicating errors are also set in this field.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- version
│ │ │ +- the bittorrent protocol version that was announced
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
tracker_warning_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is triggered if the tracker reply contains a warning field.
│ │ │ +Usually this means that the tracker announce was successful, but the
│ │ │ +tracker has a message to the client.
│ │ │ +
│ │ │ +struct tracker_warning_alert final : tracker_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* warning_message () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::tracker | alert_category::error;
│ │ │ + protocol_version version;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
warning_message()
│ │ │ +
│ │ │ +char const* warning_message () const;
│ │ │ +
│ │ │ +
the message associated with this warning
│ │ │ +
[report issue]
│ │ │ +- version
│ │ │ +- the bittorrent protocol version that was announced
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
scrape_reply_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a scrape request succeeds.
│ │ │ +
│ │ │ +struct scrape_reply_alert final : tracker_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::tracker;
│ │ │ + int const incomplete;
│ │ │ + int const complete;
│ │ │ + protocol_version version;
│ │ │ +};
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- incomplete complete
│ │ │ +- the data returned in the scrape response. These numbers
│ │ │ +may be -1 if the response was malformed.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- version
│ │ │ +- the bittorrent protocol version that was scraped
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
scrape_failed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
If a scrape request fails, this alert is generated. This might be due
│ │ │ +to the tracker timing out, refusing connection or returning an http response
│ │ │ +code indicating an error.
│ │ │ +
│ │ │ +struct scrape_failed_alert final : tracker_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* error_message () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::tracker | alert_category::error;
│ │ │ + error_code const error;
│ │ │ + protocol_version version;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
error_message()
│ │ │ +
│ │ │ +char const* error_message () const;
│ │ │ +
│ │ │ +
if the error indicates there is an associated message, this returns
│ │ │ +that message. Otherwise and empty string.
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error itself. This may indicate that the tracker sent an error
│ │ │ +message (error::tracker_failure), in which case it can be
│ │ │ +retrieved by calling error_message().
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- version
│ │ │ +- the bittorrent protocol version that was scraped
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
tracker_reply_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is only for informational purpose. It is generated when a tracker announce
│ │ │ +succeeds. It is generated regardless what kind of tracker was used, be it UDP, HTTP or
│ │ │ +the DHT.
│ │ │ +
│ │ │ +struct tracker_reply_alert final : tracker_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::tracker;
│ │ │ + int const num_peers;
│ │ │ + protocol_version version;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_peers
│ │ │ +- tells how many peers the tracker returned in this response. This is
│ │ │ +not expected to be greater than the num_want settings. These are not necessarily
│ │ │ +all new peers, some of them may already be connected.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- version
│ │ │ +- the bittorrent protocol version that was announced
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_reply_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated each time the DHT receives peers from a node. num_peers
│ │ │ +is the number of peers we received in this packet. Typically these packets are
│ │ │ +received from multiple DHT nodes, and so the alerts are typically generated
│ │ │ +a few at a time.
│ │ │ +
│ │ │ +struct dht_reply_alert final : tracker_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht | alert_category::tracker;
│ │ │ + int const num_peers;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
tracker_announce_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated each time a tracker announce is sent (or attempted to be sent).
│ │ │ +There are no extra data members in this alert. The url can be found in the base class
│ │ │ +however.
│ │ │ +
│ │ │ +struct tracker_announce_alert final : tracker_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::tracker;
│ │ │ + event_t const event;
│ │ │ + protocol_version version;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- event
│ │ │ +- specifies what event was sent to the tracker. See event_t.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- version
│ │ │ +- the bittorrent protocol version that is announced
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
hash_failed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a finished piece fails its hash check. You can get the handle
│ │ │ +to the torrent which got the failed piece and the index of the piece itself from the alert.
│ │ │ +
│ │ │ +struct hash_failed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + piece_index_t const piece_index;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
peer_ban_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a peer is banned because it has sent too many corrupt pieces
│ │ │ +to us. ip is the endpoint to the peer that was banned.
│ │ │ +
│ │ │ +struct peer_ban_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
peer_unsnubbed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a peer is un-snubbed. Essentially when it was snubbed for stalling
│ │ │ +sending data, and now it started sending data again.
│ │ │ +
│ │ │ +struct peer_unsnubbed_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
peer_snubbed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a peer is snubbed, when it stops sending data when we request
│ │ │ +it.
│ │ │ +
│ │ │ +struct peer_snubbed_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
peer_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a peer sends invalid data over the peer-peer protocol. The peer
│ │ │ +will be disconnected, but you get its ip address from the alert, to identify it.
│ │ │ +
│ │ │ +struct peer_error_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ + operation_t op;
│ │ │ + error_code const error;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- op
│ │ │ +- a 0-terminated string of the low-level operation that failed, or nullptr if
│ │ │ +there was no low level disk operation.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- tells you what error caused this alert.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
peer_connect_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted every time an incoming peer connection both
│ │ │ +successfully passes the protocol handshake and is associated with a
│ │ │ +torrent, or an outgoing peer connection attempt succeeds. For arbitrary
│ │ │ +incoming connections, see incoming_connection_alert.
│ │ │ +
│ │ │ +struct peer_connect_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + enum direction_t
│ │ │ + {
│ │ │ + in,
│ │ │ + out,
│ │ │ + };
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::connect;
│ │ │ + direction_t direction;
│ │ │ + socket_type_t socket_type;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
enum direction_t
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| blocked |
│ │ │ +
| in |
│ │ │ +0 |
│ │ │ + |
│ │ │ +
│ │ │ +| out |
│ │ │ 1 |
│ │ │ -this flag indicates that destination ports in the
│ │ │ -range should not be connected to |
│ │ │ + |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ +
[report issue]
│ │ │ +- direction
│ │ │ +- Tells you if the peer was incoming or outgoing
│ │ │ +
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
hasher
│ │ │ -
Declared in "libtorrent/hasher.hpp"
│ │ │ -
this is a SHA-1 hash class.
│ │ │ -
You use it by first instantiating it, then call update() to feed it
│ │ │ -with data. i.e. you don't have to keep the entire buffer of which you want to
│ │ │ -create the hash in memory. You can feed the hasher parts of it at a time. When
│ │ │ -You have fed the hasher with all the data, you call final() and it
│ │ │ -will return the sha1-hash of the data.
│ │ │ -
The constructor that takes a char const* and an integer will construct the
│ │ │ -sha1 context and feed it the data passed in.
│ │ │ -
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.
│ │ │ +
│ │ │ +
peer_disconnected_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a peer is disconnected for any reason (other than the ones
│ │ │ +covered by peer_error_alert ).
│ │ │
│ │ │ -class hasher
│ │ │ +struct peer_disconnected_alert final : peer_alert
│ │ │ {
│ │ │ - hasher ();
│ │ │ - hasher (char const* data, int len);
│ │ │ - explicit hasher (span<char const> data);
│ │ │ - hasher (hasher const&);
│ │ │ - hasher& operator= (hasher const&) &;
│ │ │ - hasher& update (char const* data, int len);
│ │ │ - hasher& update (span<char const> data);
│ │ │ - sha1_hash final ();
│ │ │ - void reset ();
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::connect;
│ │ │ + socket_type_t const socket_type;
│ │ │ + operation_t const op;
│ │ │ + error_code const error;
│ │ │ + close_reason_t const reason;
│ │ │ };
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
hasher() operator=()
│ │ │ +
[report issue]
│ │ │ +- socket_type
│ │ │ +- the kind of socket this peer was connected over
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- op
│ │ │ +- the operation or level where the error occurred. Specified as an
│ │ │ +value from the operation_t enum. Defined in operations.hpp.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- tells you what error caused peer to disconnect.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- reason
│ │ │ +- the reason the peer disconnected (if specified)
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
invalid_request_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is a debug alert that is generated by an incoming invalid piece request.
│ │ │ +ip is the address of the peer and the request is the actual incoming
│ │ │ +request from the peer. See peer_request for more info.
│ │ │
│ │ │ -hasher (char const* data, int len);
│ │ │ -explicit hasher (span<char const> data);
│ │ │ -hasher (hasher const&);
│ │ │ -hasher& operator= (hasher const&) &;
│ │ │ +struct invalid_request_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ + peer_request const request;
│ │ │ + bool const we_have;
│ │ │ + bool const peer_interested;
│ │ │ + bool const withheld;
│ │ │ +};
│ │ │
│ │ │ -
this is the same as default constructing followed by a call to
│ │ │ -update(data, len).
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
update()
│ │ │ +
[report issue]
│ │ │ +- request
│ │ │ +- the request we received from the peer
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- we_have
│ │ │ +- true if we have this piece
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- peer_interested
│ │ │ +- true if the peer indicated that it was interested to download before
│ │ │ +sending the request
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- withheld
│ │ │ +- if this is true, the peer is not allowed to download this piece because
│ │ │ +of super-seeding rules.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
torrent_finished_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a torrent switches from being a downloader to a seed.
│ │ │ +It will only be generated once per torrent. It contains a torrent_handle to the
│ │ │ +torrent in question.
│ │ │
│ │ │ -hasher& update (char const* data, int len);
│ │ │ -hasher& update (span<char const> data);
│ │ │ +struct torrent_finished_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ +};
│ │ │
│ │ │ -
append the following bytes to what is being hashed
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
piece_finished_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert is posted every time a piece completes downloading
│ │ │ +and passes the hash check. This alert derives from torrent_alert
│ │ │ +which contains the torrent_handle to the torrent the piece belongs to.
│ │ │ +Note that being downloaded and passing the hash check may happen before
│ │ │ +the piece is also fully flushed to disk. So torrent_handle::have_piece()
│ │ │ +may still return false
│ │ │
│ │ │ -sha1_hash final ();
│ │ │ +struct piece_finished_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + piece_index_t const piece_index;
│ │ │ +};
│ │ │
│ │ │ -
returns the SHA-1 digest of the buffers previously passed to
│ │ │ -update() and the hasher constructor.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
reset()
│ │ │ +
[report issue]
│ │ │ +- piece_index
│ │ │ +- the index of the piece that finished
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
request_dropped_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a peer rejects or ignores a piece request.
│ │ │
│ │ │ -void reset ();
│ │ │ +struct request_dropped_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + int const block_index;
│ │ │ + piece_index_t const piece_index;
│ │ │ +};
│ │ │
│ │ │ -
restore the hasher state to be as if the hasher has just been
│ │ │ -default constructed.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
block_timeout_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a block request times out.
│ │ │
│ │ │ -class hasher256
│ │ │ +struct block_timeout_alert final : peer_alert
│ │ │ {
│ │ │ - hasher256 ();
│ │ │ - explicit hasher256 (span<char const> data);
│ │ │ - hasher256 (char const* data, int len);
│ │ │ - hasher256 (hasher256 const&);
│ │ │ - hasher256& operator= (hasher256 const&) &;
│ │ │ - hasher256& update (span<char const> data);
│ │ │ - hasher256& update (char const* data, int len);
│ │ │ - sha256_hash final ();
│ │ │ - void reset ();
│ │ │ - ~hasher256 ();
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + int const block_index;
│ │ │ + piece_index_t const piece_index;
│ │ │ };
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
block_finished_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a block request receives a response.
│ │ │
│ │ │ -explicit hasher256 (span<char const> data);
│ │ │ -hasher256 (char const* data, int len);
│ │ │ -hasher256 (hasher256 const&);
│ │ │ -hasher256& operator= (hasher256 const&) &;
│ │ │ +struct block_finished_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + int const block_index;
│ │ │ + piece_index_t const piece_index;
│ │ │ +};
│ │ │
│ │ │ -
this is the same as default constructing followed by a call to
│ │ │ -update(data, len).
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
block_downloading_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a block request is sent to a peer.
│ │ │
│ │ │ -hasher256& update (span<char const> data);
│ │ │ -hasher256& update (char const* data, int len);
│ │ │ +struct block_downloading_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + int const block_index;
│ │ │ + piece_index_t const piece_index;
│ │ │ +};
│ │ │
│ │ │ -
append the following bytes to what is being hashed
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
unwanted_block_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a block is received that was not requested or
│ │ │ +whose request timed out.
│ │ │
│ │ │ -sha256_hash final ();
│ │ │ +struct unwanted_block_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ + int const block_index;
│ │ │ + piece_index_t const piece_index;
│ │ │ +};
│ │ │
│ │ │ -
returns the SHA-1 digest of the buffers previously passed to
│ │ │ -update() and the hasher constructor.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
storage_moved_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
The storage_moved_alert is generated when all the disk IO has
│ │ │ +completed and the files have been moved, as an effect of a call to
│ │ │ +torrent_handle::move_storage. This is useful to synchronize with the
│ │ │ +actual disk. The storage_path() member return the new path of the
│ │ │ +storage.
│ │ │
│ │ │ -void reset ();
│ │ │ +struct storage_moved_alert final : torrent_alert
│ │ │ +{
│ │ │ + 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;
│ │ │ +};
│ │ │
│ │ │ -
restore the hasher state to be as if the hasher has just been
│ │ │ -default constructed.
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
[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]
│ │ │
│ │ │ -
│ │ │ -
bitfield
│ │ │ -
Declared in "libtorrent/bitfield.hpp"
│ │ │ -
The bitfield type stores any number of bits as a bitfield
│ │ │ -in a heap allocated array.
│ │ │ +
│ │ │ +
storage_moved_failed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
The storage_moved_failed_alert is generated when an attempt to move the storage,
│ │ │ +via torrent_handle::move_storage(), fails.
│ │ │
│ │ │ -struct bitfield
│ │ │ +struct storage_moved_failed_alert final : torrent_alert
│ │ │ {
│ │ │ - bitfield (bitfield const& rhs);
│ │ │ - explicit bitfield (int bits);
│ │ │ - bitfield (bitfield&& rhs) noexcept = default;
│ │ │ - bitfield () noexcept = default;
│ │ │ - bitfield (int bits, bool val);
│ │ │ - bitfield (char const* b, int bits);
│ │ │ - void assign (char const* b, int const bits);
│ │ │ - bool operator[] (int index) const noexcept;
│ │ │ - bool get_bit (int index) const noexcept;
│ │ │ - void clear_bit (int index) noexcept;
│ │ │ - void set_bit (int index) noexcept;
│ │ │ - bool all_set () const noexcept;
│ │ │ - bool none_set () const noexcept;
│ │ │ - int size () const noexcept;
│ │ │ - int num_words () const noexcept;
│ │ │ - int num_bytes () const noexcept;
│ │ │ - bool empty () const noexcept;
│ │ │ - char* data () noexcept;
│ │ │ - char const* data () const noexcept;
│ │ │ - void swap (bitfield& rhs) noexcept;
│ │ │ - int count () const noexcept;
│ │ │ - int find_first_set () const noexcept;
│ │ │ - int find_last_clear () const noexcept;
│ │ │ - bool operator== (lt::bitfield const& rhs) const;
│ │ │ + std::string message () const override;
│ │ │ + char const* file_path () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ + error_code const error;
│ │ │ + operation_t op;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
bitfield()
│ │ │ +
[report issue]
│ │ │ +
file_path()
│ │ │
│ │ │ -bitfield (bitfield const& rhs);
│ │ │ -explicit bitfield (int bits);
│ │ │ -bitfield (bitfield&& rhs) noexcept = default;
│ │ │ -bitfield () noexcept = default;
│ │ │ -bitfield (int bits, bool val);
│ │ │ -bitfield (char const* b, int bits);
│ │ │ +char const* file_path () const;
│ │ │
│ │ │ -
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()
│ │ │ +
If the error happened for a specific file, this returns its path.
│ │ │ +
[report issue]
│ │ │ +- op
│ │ │ +- this indicates what underlying operation caused the error
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
torrent_deleted_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a request to delete the files of a torrent complete.
│ │ │ +
This alert is posted in the alert_category::storage category, and that bit
│ │ │ +needs to be set in the alert_mask.
│ │ │
│ │ │ -void assign (char const* b, int const bits);
│ │ │ +struct torrent_deleted_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ + info_hash_t info_hashes;
│ │ │ +};
│ │ │
│ │ │ -
copy bitfield from buffer b of bits number of bits, rounded up to
│ │ │ -the nearest byte boundary.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
get_bit() operator[]()
│ │ │ +
[report issue]
│ │ │ +- info_hashes
│ │ │ +- The info-hash of the torrent that was just deleted. Most of
│ │ │ +the time the torrent_handle in the torrent_alert will be invalid by the time
│ │ │ +this alert arrives, since the torrent is being deleted. The info_hashes member
│ │ │ +is hence the main way of identifying which torrent just completed the delete.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
torrent_delete_failed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a request to delete the files of a torrent fails.
│ │ │ +Just removing a torrent from the session cannot fail
│ │ │
│ │ │ -bool operator[] (int index) const noexcept;
│ │ │ -bool get_bit (int index) const noexcept;
│ │ │ +struct torrent_delete_failed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage
│ │ │ + | alert_category::error;
│ │ │ + error_code const error;
│ │ │ + info_hash_t info_hashes;
│ │ │ +};
│ │ │
│ │ │ -
query bit at index. Returns true if bit is 1, otherwise false.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
set_bit() clear_bit()
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- tells you why it failed.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- info_hashes
│ │ │ +- the info hash of the torrent whose files failed to be deleted
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
save_resume_data_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated as a response to a torrent_handle::save_resume_data request.
│ │ │ +It is generated once the disk IO thread is done writing the state for this torrent.
│ │ │
│ │ │ -void clear_bit (int index) noexcept;
│ │ │ -void set_bit (int index) noexcept;
│ │ │ +struct save_resume_data_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ + add_torrent_params params;
│ │ │ +};
│ │ │
│ │ │ -
set bit at index to 0 (clear_bit) or 1 (set_bit).
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
all_set()
│ │ │ +
[report issue]
│ │ │ +- params
│ │ │ +the params object is populated with the torrent file whose resume
│ │ │ +data was saved. It is suitable to be:
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
save_resume_data_failed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated instead of save_resume_data_alert if there was an error
│ │ │ +generating the resume data. error describes what went wrong.
│ │ │
│ │ │ -bool all_set () const noexcept;
│ │ │ +struct save_resume_data_failed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage
│ │ │ + | alert_category::error;
│ │ │ + error_code const error;
│ │ │ +};
│ │ │
│ │ │ -
returns true if all bits in the bitfield are set
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
none_set()
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error code from the resume_data failure
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
torrent_paused_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated as a response to a torrent_handle::pause request. It is
│ │ │ +generated once all disk IO is complete and the files in the torrent have been closed.
│ │ │ +This is useful for synchronizing with the disk.
│ │ │
│ │ │ -bool none_set () const noexcept;
│ │ │ +struct torrent_paused_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ +};
│ │ │
│ │ │ -
returns true if no bit in the bitfield is set
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
torrent_resumed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated as a response to a torrent_handle::resume() request. It is
│ │ │ +generated when a torrent goes from a paused state to an active state.
│ │ │
│ │ │ -int size () const noexcept;
│ │ │ +struct torrent_resumed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ +};
│ │ │
│ │ │ -
returns the size of the bitfield in bits.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
torrent_checked_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted when a torrent completes checking. i.e. when it transitions
│ │ │ +out of the checking files state into a state where it is ready to start downloading
│ │ │
│ │ │ -int num_words () const noexcept;
│ │ │ +struct torrent_checked_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ +};
│ │ │
│ │ │ -
returns the number of 32 bit words are needed to represent all bits in
│ │ │ -this bitfield.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
url_seed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a HTTP seed name lookup fails.
│ │ │
│ │ │ -int num_bytes () const noexcept;
│ │ │ +struct url_seed_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* server_url () const;
│ │ │ + char const* error_message () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer | alert_category::error;
│ │ │ + error_code const error;
│ │ │ +};
│ │ │
│ │ │ -
returns the number of bytes needed to represent all bits in this
│ │ │ -bitfield
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
empty()
│ │ │ +
[report issue]
│ │ │ +
server_url()
│ │ │
│ │ │ -bool empty () const noexcept;
│ │ │ +char const* server_url () const;
│ │ │
│ │ │ -
returns true if the bitfield has zero size.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
data()
│ │ │ +
the URL the error is associated with
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
error_message()
│ │ │
│ │ │ -char* data () noexcept;
│ │ │ -char const* data () const noexcept;
│ │ │ +char const* error_message () const;
│ │ │
│ │ │ -
returns a pointer to the internal buffer of the bitfield, or
│ │ │ -nullptr if it's empty.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
swap()
│ │ │ +
in case the web server sent an error message, this function returns
│ │ │ +it.
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error the web seed encountered. If this is not set, the server
│ │ │ +sent an error message, call error_message().
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
file_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
If the storage fails to read or write files that it needs access to, this alert is
│ │ │ +generated and the torrent is paused.
│ │ │
│ │ │ -void swap (bitfield& rhs) noexcept;
│ │ │ +struct file_error_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* filename () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status
│ │ │ + | alert_category::storage;
│ │ │ + error_code const error;
│ │ │ + operation_t op;
│ │ │ +};
│ │ │
│ │ │ -
swaps the bit-fields two variables refer to
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
count()
│ │ │ +
[report issue]
│ │ │ +
filename()
│ │ │
│ │ │ -int count () const noexcept;
│ │ │ +char const* filename () const;
│ │ │
│ │ │ -
count the number of bits in the bitfield that are set to 1.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
find_first_set()
│ │ │ +
the file that experienced the error
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error code describing the error.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- op
│ │ │ +- indicates which underlying operation caused the error
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ -
│ │ │ -
find_last_clear()
│ │ │
│ │ │ -int find_last_clear () const noexcept;
│ │ │ +struct metadata_received_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ +};
│ │ │
│ │ │ -
returns the index to the last cleared bit in the bitfield, i.e. 0 bit.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
storage_error
│ │ │ -
Declared in "libtorrent/error_code.hpp"
│ │ │ -
used by storage to return errors
│ │ │ -also includes which underlying file the
│ │ │ -error happened on
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
udp_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted when there is an error on a UDP socket. The
│ │ │ +UDP sockets are used for all uTP, DHT and UDP tracker traffic. They are
│ │ │ +global to the session.
│ │ │
│ │ │ -struct storage_error
│ │ │ +struct udp_error_alert final : alert
│ │ │ {
│ │ │ - explicit operator bool () const;
│ │ │ - file_index_t file () const;
│ │ │ - void file (file_index_t f);
│ │ │ + std::string message () const override;
│ │ │
│ │ │ - error_code ec;
│ │ │ + static constexpr alert_category_t static_category = alert_category::error;
│ │ │ + aux::noexcept_movable<udp::endpoint> endpoint;
│ │ │ operation_t operation;
│ │ │ + error_code const error;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
bool()
│ │ │ +
[report issue]
│ │ │ +- endpoint
│ │ │ +- the source address associated with the error (if any)
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- operation
│ │ │ +- the operation that failed
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error code describing the error
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
external_ip_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
Whenever libtorrent learns about the machines external IP, this alert is
│ │ │ +generated. The external IP address can be acquired from the tracker (if it
│ │ │ +supports that) or from peers that supports the extension protocol.
│ │ │ +The address can be accessed through the external_address member.
│ │ │
│ │ │ -explicit operator bool () const;
│ │ │ +struct external_ip_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + aux::noexcept_movable<address> external_address;
│ │ │ +};
│ │ │
│ │ │ -
explicitly converts to true if this object represents an error, and
│ │ │ -false if it does not.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
file()
│ │ │ +
[report issue]
│ │ │ +- external_address
│ │ │ +- the IP address that is believed to be our external IP
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
listen_failed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when none of the ports, given in the port range, to
│ │ │ +session can be opened for listening. The listen_interface member is the
│ │ │ +interface that failed, error is the error code describing the failure.
│ │ │ +
In the case an endpoint was created before generating the alert, it is
│ │ │ +represented by address and port. The combinations of socket type
│ │ │ +and operation in which such address and port are not valid are:
│ │ │ +accept - i2p
│ │ │ +accept - socks5
│ │ │ +enum_if - tcp
│ │ │ +
libtorrent may sometimes try to listen on port 0, if all other ports failed.
│ │ │ +Port 0 asks the operating system to pick a port that's free). If that fails
│ │ │ +you may see a listen_failed_alert with port 0 even if you didn't ask to
│ │ │ +listen on it.
│ │ │
│ │ │ -file_index_t file () const;
│ │ │ -void file (file_index_t f);
│ │ │ +struct listen_failed_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* listen_interface () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status | alert_category::error;
│ │ │ + error_code const error;
│ │ │ + operation_t op;
│ │ │ + lt::socket_type_t const socket_type;
│ │ │ + aux::noexcept_movable<lt::address> address;
│ │ │ + int const port;
│ │ │ +};
│ │ │
│ │ │ -
set and query the index (in the torrent) of the file this error
│ │ │ -occurred on. This may also have special values defined in
│ │ │ -torrent_status.
│ │ │ -
[report issue]
│ │ │ -- ec
│ │ │ -- the error that occurred
│ │ │ +[report issue]
│ │ │ +
listen_interface()
│ │ │ +
│ │ │ +char const* listen_interface () const;
│ │ │ +
│ │ │ +
the network device libtorrent attempted to listen on, or the IP address
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error the system returned
│ │ │
│ │ │ -
[report issue]
│ │ │ -- operation
│ │ │ -- A code from operation_t enum, indicating what
│ │ │ -kind of operation failed.
│ │ │ +[report issue]
│ │ │ +- op
│ │ │ +- the underlying operation that failed
│ │ │
│ │ │ -[report issue]
│ │ │ +[report issue]
│ │ │ +- socket_type
│ │ │ +- the type of listen socket this alert refers to.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- address
│ │ │ +- the address libtorrent attempted to listen on
│ │ │ +see alert documentation for validity of this value
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- port
│ │ │ +- the port libtorrent attempted to listen on
│ │ │ +see alert documentation for validity of this value
│ │ │ +
│ │ │ +[report issue]
│ │ │
│ │ │ -
│ │ │ -
upnp_category()
│ │ │ -
Declared in "libtorrent/upnp.hpp"
│ │ │ +
│ │ │ +
listen_succeeded_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted when the listen port succeeds to be opened on a
│ │ │ +particular interface. address and port is the endpoint that
│ │ │ +successfully was opened for listening.
│ │ │
│ │ │ -boost::system::error_category& upnp_category ();
│ │ │ +struct listen_succeeded_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + aux::noexcept_movable<lt::address> address;
│ │ │ + int const port;
│ │ │ + lt::socket_type_t const socket_type;
│ │ │ +};
│ │ │
│ │ │ -
the boost.system error category for UPnP errors
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
socks_category()
│ │ │ -
Declared in "libtorrent/socks5_stream.hpp"
│ │ │ +
[report issue]
│ │ │ +- address
│ │ │ +- the address libtorrent ended up listening on. This address
│ │ │ +refers to the local interface.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- port
│ │ │ +- the port libtorrent ended up listening on.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- socket_type
│ │ │ +- the type of listen socket this alert refers to.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
portmap_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a NAT router was successfully found but some
│ │ │ +part of the port mapping request failed. It contains a text message that
│ │ │ +may help the user figure out what is wrong. This alert is not generated in
│ │ │ +case it appears the client is not running on a NAT:ed network or if it
│ │ │ +appears there is no NAT router that can be remote controlled to add port
│ │ │ +mappings.
│ │ │
│ │ │ -boost::system::error_category& socks_category ();
│ │ │ +struct portmap_error_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::port_mapping
│ │ │ + | alert_category::error;
│ │ │ + port_mapping_t const mapping;
│ │ │ + portmap_transport map_transport;
│ │ │ + aux::noexcept_movable<address> local_address;
│ │ │ + error_code const error;
│ │ │ +};
│ │ │
│ │ │ -
returns the error_category for SOCKS5 errors
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
pcp_category()
│ │ │ -
Declared in "libtorrent/natpmp.hpp"
│ │ │ +
[report issue]
│ │ │ +- mapping
│ │ │ +- refers to the mapping index of the port map that failed, i.e.
│ │ │ +the index returned from add_mapping().
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- map_transport
│ │ │ +- UPnP or NAT-PMP
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- local_address
│ │ │ +- the local network the port mapper is running on
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- tells you what failed.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
portmap_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a NAT router was successfully found and
│ │ │ +a port was successfully mapped on it. On a NAT:ed network with a NAT-PMP
│ │ │ +capable router, this is typically generated once when mapping the TCP
│ │ │ +port and, if DHT is enabled, when the UDP port is mapped.
│ │ │
│ │ │ -boost::system::error_category& pcp_category ();
│ │ │ +struct portmap_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::port_mapping;
│ │ │ + port_mapping_t const mapping;
│ │ │ + int const external_port;
│ │ │ + portmap_protocol const map_protocol;
│ │ │ + portmap_transport const map_transport;
│ │ │ + aux::noexcept_movable<address> local_address;
│ │ │ +};
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
i2p_category()
│ │ │ -
Declared in "libtorrent/i2p_stream.hpp"
│ │ │ +
[report issue]
│ │ │ +- mapping
│ │ │ +- refers to the mapping index of the port map that failed, i.e.
│ │ │ +the index returned from add_mapping().
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- external_port
│ │ │ +- the external port allocated for the mapping.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- local_address
│ │ │ +- the local network the port mapper is running on
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
portmap_log_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated to log informational events related to either
│ │ │ +UPnP or NAT-PMP. They contain a log line and the type (0 = NAT-PMP
│ │ │ +and 1 = UPnP). Displaying these messages to an end user is only useful
│ │ │ +for debugging the UPnP or NAT-PMP implementation. This alert is only
│ │ │ +posted if the alert_category::port_mapping_log flag is enabled in
│ │ │ +the alert mask.
│ │ │
│ │ │ -boost::system::error_category& i2p_category ();
│ │ │ +struct portmap_log_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* log_message () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::port_mapping_log;
│ │ │ + portmap_transport const map_transport;
│ │ │ + aux::noexcept_movable<address> local_address;
│ │ │ +};
│ │ │
│ │ │ -
returns the error category for I2P errors
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
gzip_category()
│ │ │ -
Declared in "libtorrent/gzip.hpp"
│ │ │ +
[report issue]
│ │ │ +
log_message()
│ │ │
│ │ │ -boost::system::error_category& gzip_category ();
│ │ │ +char const* log_message () const;
│ │ │
│ │ │ -
get the error_category for zip errors
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
libtorrent_category()
│ │ │ -
Declared in "libtorrent/error_code.hpp"
│ │ │ +
the message associated with this log line
│ │ │ +
[report issue]
│ │ │ +- local_address
│ │ │ +- the local network the port mapper is running on
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
fastresume_rejected_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a fast resume file has been passed to
│ │ │ +add_torrent() but the files on disk did not match the fast resume file.
│ │ │ +The error_code explains the reason why the resume file was rejected.
│ │ │
│ │ │ -boost::system::error_category& libtorrent_category ();
│ │ │ +struct fastresume_rejected_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* file_path () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status
│ │ │ + | alert_category::error;
│ │ │ + error_code error;
│ │ │ + operation_t op;
│ │ │ +};
│ │ │
│ │ │ -
return the instance of the libtorrent_error_category which
│ │ │ -maps libtorrent error codes to human readable error messages.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
http_category()
│ │ │ -
Declared in "libtorrent/error_code.hpp"
│ │ │ +
[report issue]
│ │ │ +
file_path()
│ │ │
│ │ │ -boost::system::error_category& http_category ();
│ │ │ +char const* file_path () const;
│ │ │
│ │ │ -
returns the error_category for HTTP errors
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
bdecode_category()
│ │ │ -
Declared in "libtorrent/bdecode.hpp"
│ │ │ +
If the error happened to a specific file, this returns the path to it.
│ │ │ +
[report issue]
│ │ │ +- op
│ │ │ +- the underlying operation that failed
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
peer_blocked_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted when an incoming peer connection, or a peer that's about to be added
│ │ │ +to our peer list, is blocked for some reason. This could be any of:
│ │ │ +
│ │ │ +- the IP filter
│ │ │ +- i2p mixed mode restrictions (a normal peer is not allowed on an i2p swarm)
│ │ │ +- the port filter
│ │ │ +- the peer has a low port and no_connect_privileged_ports is enabled
│ │ │ +- the protocol of the peer is blocked (uTP/TCP blocking)
│ │ │ +
│ │ │
│ │ │ -boost::system::error_category& bdecode_category ();
│ │ │ +struct peer_blocked_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + enum reason_t
│ │ │ + {
│ │ │ + ip_filter,
│ │ │ + port_filter,
│ │ │ + i2p_mixed,
│ │ │ + privileged_ports,
│ │ │ + utp_disabled,
│ │ │ + tcp_disabled,
│ │ │ + invalid_local_interface,
│ │ │ + ssrf_mitigation,
│ │ │ + };
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::ip_block;
│ │ │ + int const reason;
│ │ │ +};
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum error_code_enum
│ │ │ -
Declared in "libtorrent/upnp.hpp"
│ │ │ +
[report issue]
│ │ │ +
enum reason_t
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| no_error |
│ │ │ -0 |
│ │ │ -No error |
│ │ │ -
│ │ │ -| invalid_argument |
│ │ │ -402 |
│ │ │ -One of the arguments in the request is invalid |
│ │ │ -
│ │ │ -| action_failed |
│ │ │ -501 |
│ │ │ -The request failed |
│ │ │ -
│ │ │ -| value_not_in_array |
│ │ │ -714 |
│ │ │ -The specified value does not exist in the array |
│ │ │ -
│ │ │ -| source_ip_cannot_be_wildcarded |
│ │ │ -715 |
│ │ │ -The source IP address cannot be wild-carded, but
│ │ │ -must be fully specified |
│ │ │ -
│ │ │ -| external_port_cannot_be_wildcarded |
│ │ │ -716 |
│ │ │ -The external port cannot be a wildcard, but must
│ │ │ -be specified |
│ │ │ -
│ │ │ -| port_mapping_conflict |
│ │ │ -718 |
│ │ │ -The port mapping entry specified conflicts with a
│ │ │ -mapping assigned previously to another client |
│ │ │ -
│ │ │ -| internal_port_must_match_external |
│ │ │ -724 |
│ │ │ -Internal and external port value must be the same |
│ │ │ -
│ │ │ -| only_permanent_leases_supported |
│ │ │ -725 |
│ │ │ -The NAT implementation only supports permanent
│ │ │ -lease times on port mappings |
│ │ │ -
│ │ │ -| remote_host_must_be_wildcard |
│ │ │ -726 |
│ │ │ -RemoteHost must be a wildcard and cannot be a
│ │ │ -specific IP address or DNS name |
│ │ │ -
│ │ │ -| external_port_must_be_wildcard |
│ │ │ -727 |
│ │ │ -ExternalPort must be a wildcard and cannot be a
│ │ │ -specific port |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum socks_error_code
│ │ │ -
Declared in "libtorrent/socks5_stream.hpp"
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| name |
│ │ │ -value |
│ │ │ -description |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| no_error |
│ │ │ +
| ip_filter |
│ │ │ 0 |
│ │ │ |
│ │ │
│ │ │ -| unsupported_version |
│ │ │ +
| port_filter |
│ │ │ 1 |
│ │ │ |
│ │ │
│ │ │ -| unsupported_authentication_method |
│ │ │ +
| i2p_mixed |
│ │ │ 2 |
│ │ │ |
│ │ │
│ │ │ -| unsupported_authentication_version |
│ │ │ +
| privileged_ports |
│ │ │ 3 |
│ │ │ |
│ │ │
│ │ │ -| authentication_error |
│ │ │ +
| utp_disabled |
│ │ │ 4 |
│ │ │ |
│ │ │
│ │ │ -| username_required |
│ │ │ +
| tcp_disabled |
│ │ │ 5 |
│ │ │ |
│ │ │
│ │ │ -| general_failure |
│ │ │ +
| invalid_local_interface |
│ │ │ 6 |
│ │ │ |
│ │ │
│ │ │ -| command_not_supported |
│ │ │ +
| ssrf_mitigation |
│ │ │ 7 |
│ │ │ |
│ │ │
│ │ │ -| no_identd |
│ │ │ -8 |
│ │ │ - |
│ │ │ -
│ │ │ -| identd_error |
│ │ │ -9 |
│ │ │ - |
│ │ │ -
│ │ │ -| num_errors |
│ │ │ -10 |
│ │ │ - |
│ │ │ -
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum pcp_errors
│ │ │ -
Declared in "libtorrent/natpmp.hpp"
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| name |
│ │ │ -value |
│ │ │ -description |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| pcp_success |
│ │ │ -0 |
│ │ │ - |
│ │ │ -
│ │ │ -| pcp_unsupp_version |
│ │ │ -1 |
│ │ │ - |
│ │ │ -
│ │ │ -| pcp_not_authorized |
│ │ │ -2 |
│ │ │ - |
│ │ │ -
│ │ │ -| pcp_malformed_request |
│ │ │ -3 |
│ │ │ - |
│ │ │ -
│ │ │ -| pcp_unsupp_opcode |
│ │ │ -4 |
│ │ │ - |
│ │ │ -
│ │ │ -| pcp_unsupp_option |
│ │ │ -5 |
│ │ │ - |
│ │ │ -
│ │ │ -| pcp_malformed_option |
│ │ │ -6 |
│ │ │ - |
│ │ │ -
│ │ │ -| pcp_network_failure |
│ │ │ -7 |
│ │ │ - |
│ │ │ -
│ │ │ -| pcp_no_resources |
│ │ │ -8 |
│ │ │ - |
│ │ │ +[report issue]
│ │ │ +- reason
│ │ │ +- the reason for the peer being blocked. Is one of the values from the
│ │ │ +reason_t enum.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
dht_announce_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a DHT node announces to an info-hash on our
│ │ │ +DHT node. It belongs to the alert_category::dht category.
│ │ │ +
│ │ │ +struct dht_announce_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + aux::noexcept_movable<address> ip;
│ │ │ + int port;
│ │ │ + sha1_hash info_hash;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_get_peers_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when a DHT node sends a get_peers message to
│ │ │ +our DHT node. It belongs to the alert_category::dht category.
│ │ │ +
│ │ │ +struct dht_get_peers_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + sha1_hash info_hash;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
cache_flushed_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted when the disk cache has been flushed for a specific
│ │ │ +torrent as a result of a call to torrent_handle::flush_cache(). This
│ │ │ +alert belongs to the alert_category::storage category, which must be
│ │ │ +enabled to let this alert through. The alert is also posted when removing
│ │ │ +a torrent from the session, once the outstanding cache flush is complete
│ │ │ +and the torrent does no longer have any files open.
│ │ │ +
│ │ │ +struct cache_flushed_alert final : torrent_alert
│ │ │ +{
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
lsd_peer_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when we receive a local service discovery message
│ │ │ +from a peer for a torrent we're currently participating in.
│ │ │ +
│ │ │ +struct lsd_peer_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
trackerid_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted whenever a tracker responds with a trackerid.
│ │ │ +The tracker ID is like a cookie. libtorrent will store the tracker ID
│ │ │ +for this tracker and repeat it in subsequent announces.
│ │ │ +
│ │ │ +struct trackerid_alert final : tracker_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* tracker_id () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
tracker_id()
│ │ │ +
│ │ │ +char const* tracker_id () const;
│ │ │ +
│ │ │ +
The tracker ID returned by the tracker
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
dht_bootstrap_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted when the initial DHT bootstrap is done.
│ │ │ +
│ │ │ +struct dht_bootstrap_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
torrent_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is posted whenever a torrent is transitioned into the error state.
│ │ │ +If the error code is duplicate_torrent (error_code_enum) error, it suggests two magnet
│ │ │ +links ended up resolving to the same hybrid torrent. For more details,
│ │ │ +see BitTorrent v2 torrents.
│ │ │ +
│ │ │ +struct torrent_error_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* filename () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::error | alert_category::status;
│ │ │ + error_code const error;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
filename()
│ │ │ +
│ │ │ +char const* filename () const;
│ │ │ +
│ │ │ +
the filename (or object) the error occurred on.
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- specifies which error the torrent encountered.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
torrent_need_cert_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is always posted for SSL torrents. This is a reminder to the client that
│ │ │ +the torrent won't work unless torrent_handle::set_ssl_certificate() is called with
│ │ │ +a valid certificate. Valid certificates MUST be signed by the SSL certificate
│ │ │ +in the .torrent file.
│ │ │ +
│ │ │ +struct torrent_need_cert_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
incoming_connection_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
The incoming connection alert is posted every time we successfully accept
│ │ │ +an incoming connection, through any mean. The most straight-forward ways
│ │ │ +of accepting incoming connections are through the TCP listen socket and
│ │ │ +the UDP listen socket for uTP sockets. However, connections may also be
│ │ │ +accepted through a Socks5 or i2p listen socket, or via an SSL listen
│ │ │ +socket.
│ │ │ +
│ │ │ +struct incoming_connection_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ + socket_type_t socket_type;
│ │ │ + aux::noexcept_movable<tcp::endpoint> endpoint;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- socket_type
│ │ │ +- tells you what kind of socket the connection was accepted
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- endpoint
│ │ │ +- is the IP address and port the connection came from.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
add_torrent_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is always posted when a torrent was attempted to be added
│ │ │ +and contains the return status of the add operation. The torrent handle of the new
│ │ │ +torrent can be found as the handle member in the base class. If adding
│ │ │ +the torrent failed, error contains the error code.
│ │ │ +
│ │ │ +struct add_torrent_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + add_torrent_params params;
│ │ │ + error_code error;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- params
│ │ │ +This contains copies of the most important fields from the original
│ │ │ +add_torrent_params object, passed to add_torrent() or
│ │ │ +async_add_torrent(). Specifically, these fields are copied:
│ │ │ +
│ │ │ +- version
│ │ │ +- ti
│ │ │ +- name
│ │ │ +- save_path
│ │ │ +- userdata
│ │ │ +- tracker_id
│ │ │ +- flags
│ │ │ +- info_hash
│ │ │ +
│ │ │ +the info_hash field will be updated with the info-hash of the torrent
│ │ │ +specified by ti.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- set to the error, if one occurred while adding the torrent.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
state_update_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is only posted when requested by the user, by calling
│ │ │ +session::post_torrent_updates() on the session. It contains the torrent
│ │ │ +status of all torrents that changed since last time this message was
│ │ │ +posted. Its category is alert_category::status, but it's not subject to
│ │ │ +filtering, since it's only manually posted anyway.
│ │ │ +
│ │ │ +struct state_update_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + std::vector<torrent_status> status;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- status
│ │ │ +- contains the torrent status of all torrents that changed since last
│ │ │ +time this message was posted. Note that you can map a torrent status
│ │ │ +to a specific torrent via its handle member. The receiving end is
│ │ │ +suggested to have all torrents sorted by the torrent_handle or hashed
│ │ │ +by it, for efficient updates.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
session_stats_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
The session_stats_alert is posted when the user requests session statistics by
│ │ │ +calling post_session_stats() on the session object. This alert does not
│ │ │ +have a category, since it's only posted in response to an API call. It
│ │ │ +is not subject to the alert_mask filter.
│ │ │ +
the message() member function returns a string representation of the values that
│ │ │ +properly match the line returned in session_stats_header_alert::message().
│ │ │ +
this specific output is parsed by tools/parse_session_stats.py
│ │ │ +if this is changed, that parser should also be changed
│ │ │ +
│ │ │ +struct session_stats_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + span<std::int64_t const> counters () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = {};
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
counters()
│ │ │ +
│ │ │ +span<std::int64_t const> counters () const;
│ │ │ +
│ │ │ +
An array are a mix of counters and gauges, which meanings can be
│ │ │ +queries via the session_stats_metrics() function on the session. The
│ │ │ +mapping from a specific metric to an index into this array is constant
│ │ │ +for a specific version of libtorrent, but may differ for other
│ │ │ +versions. The intended usage is to request the mapping, i.e. call
│ │ │ +session_stats_metrics(), once on startup, and then use that mapping to
│ │ │ +interpret these values throughout the process' runtime.
│ │ │ +
For more information, see the session statistics section.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
dht_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted when something fails in the DHT. This is not necessarily a fatal
│ │ │ +error, but it could prevent proper operation
│ │ │ +
│ │ │ +struct dht_error_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::error | alert_category::dht;
│ │ │ + error_code error;
│ │ │ + operation_t op;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error code
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- op
│ │ │ +- the operation that failed
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_immutable_item_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert is posted as a response to a call to session::get_item(),
│ │ │ +specifically the overload for looking up immutable items in the DHT.
│ │ │ +
│ │ │ +struct dht_immutable_item_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + sha1_hash target;
│ │ │ + entry item;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- target
│ │ │ +- the target hash of the immutable item. This must
│ │ │ +match the SHA-1 hash of the bencoded form of item.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- item
│ │ │ +- the data for this item
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_mutable_item_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert is posted as a response to a call to session::get_item(),
│ │ │ +specifically the overload for looking up mutable items in the DHT.
│ │ │ +
│ │ │ +struct dht_mutable_item_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + std::array<char, 32> key;
│ │ │ + std::array<char, 64> signature;
│ │ │ + std::int64_t seq;
│ │ │ + std::string salt;
│ │ │ + entry item;
│ │ │ + bool authoritative;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- key
│ │ │ +- the public key that was looked up
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- signature
│ │ │ +- the signature of the data. This is not the signature of the
│ │ │ +plain encoded form of the item, but it includes the sequence number
│ │ │ +and possibly the hash as well. See the dht_store document for more
│ │ │ +information. This is primarily useful for echoing back in a store
│ │ │ +request.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- seq
│ │ │ +- the sequence number of this item
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- salt
│ │ │ +- the salt, if any, used to lookup and store this item. If no
│ │ │ +salt was used, this is an empty string
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- item
│ │ │ +- the data for this item
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- authoritative
│ │ │ +- the last response for mutable data is authoritative.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_put_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this is posted when a DHT put operation completes. This is useful if the
│ │ │ +client is waiting for a put to complete before shutting down for instance.
│ │ │ +
│ │ │ +struct dht_put_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + sha1_hash target;
│ │ │ + std::array<char, 32> public_key;
│ │ │ + std::array<char, 64> signature;
│ │ │ + std::string salt;
│ │ │ + std::int64_t seq;
│ │ │ + int num_success;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- target
│ │ │ +- the target hash the item was stored under if this was an immutable
│ │ │ +item.
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- public_key signature salt seq
│ │ │ +- if a mutable item was stored, these are the public key, signature,
│ │ │ +salt and sequence number the item was stored under.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_success
│ │ │ +- DHT put operation usually writes item to k nodes, maybe the node
│ │ │ +is stale so no response, or the node doesn't support 'put', or the
│ │ │ +token for write is out of date, etc. num_success is the number of
│ │ │ +successful responses we got from the puts.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
i2p_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert is used to report errors in the i2p SAM connection
│ │ │ +
│ │ │ +struct i2p_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::error;
│ │ │ + error_code error;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error that occurred in the i2p SAM connection
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_outgoing_get_peers_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is generated when we send a get_peers request
│ │ │ +It belongs to the alert_category::dht category.
│ │ │ +
│ │ │ +struct dht_outgoing_get_peers_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + sha1_hash info_hash;
│ │ │ + sha1_hash obfuscated_info_hash;
│ │ │ + aux::noexcept_movable<udp::endpoint> endpoint;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- info_hash
│ │ │ +- the info_hash of the torrent we're looking for peers for.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- obfuscated_info_hash
│ │ │ +- if this was an obfuscated lookup, this is the info-hash target
│ │ │ +actually sent to the node.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- endpoint
│ │ │ +- the endpoint we're sending this query to
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
log_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted by some session wide event. Its main purpose is
│ │ │ +trouble shooting and debugging. It's not enabled by the default alert
│ │ │ +mask and is enabled by the alert_category::session_log bit.
│ │ │ +Furthermore, it's by default disabled as a build configuration.
│ │ │ +
│ │ │ +struct log_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* log_message () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::session_log;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
log_message()
│ │ │ +
│ │ │ +char const* log_message () const;
│ │ │ +
│ │ │ +
returns the log message
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
torrent_log_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted by torrent wide events. It's meant to be used for
│ │ │ +trouble shooting and debugging. It's not enabled by the default alert
│ │ │ +mask and is enabled by the alert_category::torrent_log bit. By
│ │ │ +default it is disabled as a build configuration.
│ │ │ +
│ │ │ +struct torrent_log_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* log_message () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::torrent_log;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
log_message()
│ │ │ +
│ │ │ +char const* log_message () const;
│ │ │ +
│ │ │ +
returns the log message
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
peer_log_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted by events specific to a peer. It's meant to be used
│ │ │ +for trouble shooting and debugging. It's not enabled by the default alert
│ │ │ +mask and is enabled by the alert_category::peer_log bit. By
│ │ │ +default it is disabled as a build configuration.
│ │ │ +
│ │ │ +struct peer_log_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* log_message () const;
│ │ │ +
│ │ │ + enum direction_t
│ │ │ + {
│ │ │ + incoming_message,
│ │ │ + outgoing_message,
│ │ │ + incoming,
│ │ │ + outgoing,
│ │ │ + info,
│ │ │ + };
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::peer_log;
│ │ │ + char const* event_type;
│ │ │ + direction_t direction;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
log_message()
│ │ │ +
│ │ │ +char const* log_message () const;
│ │ │ +
│ │ │ +
returns the log message
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum direction_t
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │
│ │ │ -| pcp_unsupp_protocol |
│ │ │ -9 |
│ │ │ +
│ │ │ +
│ │ │ +| incoming_message |
│ │ │ +0 |
│ │ │ |
│ │ │
│ │ │ -| pcp_user_ex_quota |
│ │ │ -10 |
│ │ │ +
| outgoing_message |
│ │ │ +1 |
│ │ │ |
│ │ │
│ │ │ -| pcp_cannot_provide_external |
│ │ │ -11 |
│ │ │ +
| incoming |
│ │ │ +2 |
│ │ │ |
│ │ │
│ │ │ -| pcp_address_mismatch |
│ │ │ -12 |
│ │ │ +
| outgoing |
│ │ │ +3 |
│ │ │ |
│ │ │
│ │ │ -| pcp_excessive_remote_peers |
│ │ │ -13 |
│ │ │ +
| info |
│ │ │ +4 |
│ │ │ |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
lsd_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted if the local service discovery socket fails to start properly.
│ │ │ +it's categorized as alert_category::error.
│ │ │ +
│ │ │ +struct lsd_error_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::error;
│ │ │ + aux::noexcept_movable<address> local_address;
│ │ │ + error_code error;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- local_address
│ │ │ +- the local network the corresponding local service discovery is running
│ │ │ +on
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- The error code
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_lookup
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
holds statistics about a current dht_lookup operation.
│ │ │ +a DHT lookup is the traversal of nodes, looking up a
│ │ │ +set of target nodes in the DHT for retrieving and possibly
│ │ │ +storing information in the DHT
│ │ │ +
│ │ │ +struct dht_lookup
│ │ │ +{
│ │ │ + char const* type;
│ │ │ + int outstanding_requests;
│ │ │ + int timeouts;
│ │ │ + int responses;
│ │ │ + int branch_factor;
│ │ │ + int nodes_left;
│ │ │ + int last_sent;
│ │ │ + int first_timeout;
│ │ │ + sha1_hash target;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- type
│ │ │ +- string literal indicating which kind of lookup this is
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- outstanding_requests
│ │ │ +- the number of outstanding request to individual nodes
│ │ │ +this lookup has right now
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- timeouts
│ │ │ +- the total number of requests that have timed out so far
│ │ │ +for this lookup
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- responses
│ │ │ +- the total number of responses we have received for this
│ │ │ +lookup so far for this lookup
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- branch_factor
│ │ │ +- the branch factor for this lookup. This is the number of
│ │ │ +nodes we keep outstanding requests to in parallel by default.
│ │ │ +when nodes time out we may increase this.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- nodes_left
│ │ │ +- the number of nodes left that could be queries for this
│ │ │ +lookup. Many of these are likely to be part of the trail
│ │ │ +while performing the lookup and would never end up actually
│ │ │ +being queried.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- last_sent
│ │ │ +- the number of seconds ago the
│ │ │ +last message was sent that's still
│ │ │ +outstanding
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- first_timeout
│ │ │ +- the number of outstanding requests
│ │ │ +that have exceeded the short timeout
│ │ │ +and are considered timed out in the
│ │ │ +sense that they increased the branch
│ │ │ +factor
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- target
│ │ │ +- the node-id or info-hash target for this lookup
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_stats_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
contains current DHT state. Posted in response to session::post_dht_stats().
│ │ │ +
│ │ │ +struct dht_stats_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = {};
│ │ │ + std::vector<dht_lookup> active_requests;
│ │ │ + std::vector<dht_routing_bucket> routing_table;
│ │ │ + sha1_hash nid;
│ │ │ + aux::noexcept_movable<udp::endpoint> local_endpoint;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- active_requests
│ │ │ +- a vector of the currently running DHT lookups.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- routing_table
│ │ │ +- contains information about every bucket in the DHT routing
│ │ │ +table.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- nid
│ │ │ +- the node ID of the DHT node instance
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- local_endpoint
│ │ │ +- the local socket this DHT node is running on
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
incoming_request_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted every time an incoming request from a peer is accepted and queued
│ │ │ +up for being serviced. This alert is only posted if
│ │ │ +the alert_category::incoming_request flag is enabled in the alert
│ │ │ +mask.
│ │ │ +
│ │ │ +struct incoming_request_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::incoming_request;
│ │ │ + peer_request req;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- req
│ │ │ +- the request this peer sent to us
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_log_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
debug logging of the DHT when alert_category::dht_log is set in the alert
│ │ │ +mask.
│ │ │ +
│ │ │ +struct dht_log_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + char const* log_message () const;
│ │ │ +
│ │ │ + enum dht_module_t
│ │ │ + {
│ │ │ + tracker,
│ │ │ + node,
│ │ │ + routing_table,
│ │ │ + rpc_manager,
│ │ │ + traversal,
│ │ │ + };
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht_log;
│ │ │ + dht_module_t module;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
log_message()
│ │ │ +
│ │ │ +char const* log_message () const;
│ │ │ +
│ │ │ +
the log message
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum dht_module_t
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| no_error |
│ │ │ +
| tracker |
│ │ │ 0 |
│ │ │ |
│ │ │
│ │ │ -| parse_failed |
│ │ │ +
| node |
│ │ │ 1 |
│ │ │ |
│ │ │
│ │ │ -| cant_reach_peer |
│ │ │ +
| routing_table |
│ │ │ 2 |
│ │ │ |
│ │ │
│ │ │ -| i2p_error |
│ │ │ +
| rpc_manager |
│ │ │ 3 |
│ │ │ |
│ │ │
│ │ │ -| invalid_key |
│ │ │ +
| traversal |
│ │ │ 4 |
│ │ │ |
│ │ │
│ │ │ -| invalid_id |
│ │ │ -5 |
│ │ │ - |
│ │ │ -
│ │ │ -| timeout |
│ │ │ -6 |
│ │ │ - |
│ │ │ -
│ │ │ -| key_not_found |
│ │ │ -7 |
│ │ │ - |
│ │ │ -
│ │ │ -| duplicated_id |
│ │ │ -8 |
│ │ │ - |
│ │ │ -
│ │ │ -| num_errors |
│ │ │ -9 |
│ │ │ - |
│ │ │ -
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
dht_pkt_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted every time a DHT message is sent or received. It is
│ │ │ +only posted if the alert_category::dht_log alert category is
│ │ │ +enabled. It contains a verbatim copy of the message.
│ │ │ +
│ │ │ +struct dht_pkt_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + span<char const> pkt_buf () const;
│ │ │ +
│ │ │ + enum direction_t
│ │ │ + {
│ │ │ + incoming,
│ │ │ + outgoing,
│ │ │ + };
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht_log;
│ │ │ + direction_t direction;
│ │ │ + aux::noexcept_movable<udp::endpoint> node;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
pkt_buf()
│ │ │ +
│ │ │ +span<char const> pkt_buf () const;
│ │ │ +
│ │ │ +
returns a pointer to the packet buffer and size of the packet,
│ │ │ +respectively. This buffer is only valid for as long as the alert itself
│ │ │ +is valid, which is owned by libtorrent and reclaimed whenever
│ │ │ +pop_alerts() is called on the session.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum direction_t
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| no_error |
│ │ │ +
| incoming |
│ │ │ 0 |
│ │ │ -Not an error |
│ │ │ + |
│ │ │
│ │ │ -| invalid_gzip_header |
│ │ │ +
| outgoing |
│ │ │ 1 |
│ │ │ -the supplied gzip buffer has invalid header |
│ │ │ -
│ │ │ -| inflated_data_too_large |
│ │ │ -2 |
│ │ │ -the gzip buffer would inflate to more bytes than the specified
│ │ │ -maximum size, and was rejected. |
│ │ │ -
│ │ │ -| data_did_not_terminate |
│ │ │ -3 |
│ │ │ -available inflate data did not terminate |
│ │ │ -
│ │ │ -| space_exhausted |
│ │ │ -4 |
│ │ │ -output space exhausted before completing inflate |
│ │ │ -
│ │ │ -| invalid_block_type |
│ │ │ -5 |
│ │ │ -invalid block type (type == 3) |
│ │ │ -
│ │ │ -| invalid_stored_block_length |
│ │ │ -6 |
│ │ │ -stored block length did not match one's complement |
│ │ │ -
│ │ │ -| too_many_length_or_distance_codes |
│ │ │ -7 |
│ │ │ -dynamic block code description: too many length or distance codes |
│ │ │ -
│ │ │ -| code_lengths_codes_incomplete |
│ │ │ -8 |
│ │ │ -dynamic block code description: code lengths codes incomplete |
│ │ │ -
│ │ │ -| repeat_lengths_with_no_first_length |
│ │ │ -9 |
│ │ │ -dynamic block code description: repeat lengths with no first length |
│ │ │ -
│ │ │ -| repeat_more_than_specified_lengths |
│ │ │ -10 |
│ │ │ -dynamic block code description: repeat more than specified lengths |
│ │ │ -
│ │ │ -| invalid_literal_length_code_lengths |
│ │ │ -11 |
│ │ │ -dynamic block code description: invalid literal/length code lengths |
│ │ │ -
│ │ │ -| invalid_distance_code_lengths |
│ │ │ -12 |
│ │ │ -dynamic block code description: invalid distance code lengths |
│ │ │ -
│ │ │ -| invalid_literal_code_in_block |
│ │ │ -13 |
│ │ │ -invalid literal/length or distance code in fixed or dynamic block |
│ │ │ -
│ │ │ -| distance_too_far_back_in_block |
│ │ │ -14 |
│ │ │ -distance is too far back in fixed or dynamic block |
│ │ │ -
│ │ │ -| unknown_gzip_error |
│ │ │ -15 |
│ │ │ -an unknown error occurred during gzip inflation |
│ │ │ -
│ │ │ -| error_code_max |
│ │ │ -16 |
│ │ │ -the number of error codes |
│ │ │ + |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum error_code_enum
│ │ │ -
Declared in "libtorrent/error_code.hpp"
│ │ │ +
[report issue]
│ │ │ +- direction
│ │ │ +- whether this is an incoming or outgoing packet.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- node
│ │ │ +- the DHT node we received this packet from, or sent this packet to
│ │ │ +(depending on direction).
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
dht_get_peers_reply_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
Posted when we receive a response to a DHT get_peers request.
│ │ │ +
│ │ │ +struct dht_get_peers_reply_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + int num_peers () const;
│ │ │ + std::vector<tcp::endpoint> peers () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht_operation;
│ │ │ + sha1_hash info_hash;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_direct_response_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This is posted exactly once for every call to session_handle::dht_direct_request.
│ │ │ +If the request failed, response() will return a default constructed bdecode_node.
│ │ │ +
│ │ │ +struct dht_direct_response_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + bdecode_node response () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + client_data_t userdata;
│ │ │ + aux::noexcept_movable<udp::endpoint> endpoint;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
picker_log_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this is posted when one or more blocks are picked by the piece picker,
│ │ │ +assuming the verbose piece picker logging is enabled (see
│ │ │ +alert_category::picker_log).
│ │ │ +
│ │ │ +struct picker_log_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + std::vector<piece_block> blocks () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::picker_log;
│ │ │ + static constexpr picker_flags_t partial_ratio = 0_bit;
│ │ │ + static constexpr picker_flags_t prioritize_partials = 1_bit;
│ │ │ + static constexpr picker_flags_t rarest_first_partials = 2_bit;
│ │ │ + static constexpr picker_flags_t rarest_first = 3_bit;
│ │ │ + static constexpr picker_flags_t reverse_rarest_first = 4_bit;
│ │ │ + static constexpr picker_flags_t suggested_pieces = 5_bit;
│ │ │ + static constexpr picker_flags_t prio_sequential_pieces = 6_bit;
│ │ │ + static constexpr picker_flags_t sequential_pieces = 7_bit;
│ │ │ + static constexpr picker_flags_t reverse_pieces = 8_bit;
│ │ │ + static constexpr picker_flags_t time_critical = 9_bit;
│ │ │ + static constexpr picker_flags_t random_pieces = 10_bit;
│ │ │ + static constexpr picker_flags_t prefer_contiguous = 11_bit;
│ │ │ + static constexpr picker_flags_t reverse_sequential = 12_bit;
│ │ │ + static constexpr picker_flags_t backup1 = 13_bit;
│ │ │ + static constexpr picker_flags_t backup2 = 14_bit;
│ │ │ + static constexpr picker_flags_t end_game = 15_bit;
│ │ │ + static constexpr picker_flags_t extent_affinity = 16_bit;
│ │ │ + picker_flags_t const picker_flags;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- picker_flags
│ │ │ +- this is a bitmask of which features were enabled for this particular
│ │ │ +pick. The bits are defined in the picker_flags_t enum.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
session_error_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert is posted when the session encounters a serious error,
│ │ │ +potentially fatal
│ │ │ +
│ │ │ +struct session_error_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::error;
│ │ │ + error_code const error;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- The error code, if one is associated with this error
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_live_nodes_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted in response to a call to session::dht_live_nodes(). It contains the
│ │ │ +live nodes from the DHT routing table of one of the DHT nodes running
│ │ │ +locally.
│ │ │ +
│ │ │ +struct dht_live_nodes_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ + int num_nodes () const;
│ │ │ + std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + sha1_hash node_id;
│ │ │ +};
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
nodes() num_nodes()
│ │ │ +
│ │ │ +int num_nodes () const;
│ │ │ +std::vector<std::pair<sha1_hash, udp::endpoint>> 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]
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
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;
│ │ │ + 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]
│ │ │ +
samples() num_samples()
│ │ │ +
│ │ │ +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()
│ │ │ +
│ │ │ +int num_nodes () const;
│ │ │ +
│ │ │ +
The total number of nodes returned by nodes().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
nodes()
│ │ │ +
│ │ │ +std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;
│ │ │ +
│ │ │ +
This is the set of more DHT nodes returned by the request.
│ │ │ +
The information is included so that indexing nodes can perform a key
│ │ │ +space traversal with a single RPC per node by adjusting the target
│ │ │ +value for each RPC.
│ │ │ +
[report issue]
│ │ │ +- node_id
│ │ │ +- id of the node the request was sent to (and this response was received from)
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- endpoint
│ │ │ +- the node the request was sent to (and this response was received from)
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- interval
│ │ │ +- the interval to wait before making another request to this node
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_infohashes
│ │ │ +- This field indicates how many info-hash keys are currently in the node's storage.
│ │ │ +If the value is larger than the number of returned samples it indicates that the
│ │ │ +indexer may obtain additional samples after waiting out the interval.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
block_uploaded_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
This alert is posted when a block intended to be sent to a peer is placed in the
│ │ │ +send buffer. Note that if the connection is closed before the send buffer is sent,
│ │ │ +the alert may be posted without the bytes having been sent to the peer.
│ │ │ +It belongs to the alert_category::upload category.
│ │ │ +
│ │ │ +struct block_uploaded_alert final : peer_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + int const block_index;
│ │ │ + piece_index_t const piece_index;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
alerts_dropped_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert is posted to indicate to the client that some alerts were
│ │ │ +dropped. Dropped meaning that the alert failed to be delivered to the
│ │ │ +client. The most common cause of such failure is that the internal alert
│ │ │ +queue grew too big (controlled by alert_queue_size).
│ │ │ +
│ │ │ +struct alerts_dropped_alert final : alert
│ │ │ +{
│ │ │ + static_assert (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::error;
│ │ │ + std::bitset<abi_alert_count> dropped_alerts;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- dropped_alerts
│ │ │ +- a bitmask indicating which alerts were dropped. Each bit represents the
│ │ │ +alert type ID, where bit 0 represents whether any alert of type 0 has
│ │ │ +been dropped, and so on.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
socks5_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert is posted with SOCKS5 related errors, when a SOCKS5 proxy is
│ │ │ +configured. It's enabled with the alert_category::error alert category.
│ │ │ +
│ │ │ +struct socks5_alert final : alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::error;
│ │ │ + error_code error;
│ │ │ + operation_t op;
│ │ │ + aux::noexcept_movable<tcp::endpoint> ip;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- op
│ │ │ +- the operation that failed
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- ip
│ │ │ +- the endpoint configured as the proxy
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_prio_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted when a prioritize_files() or file_priority() update of the file
│ │ │ +priorities complete, which requires a round-trip to the disk thread.
│ │ │ +
If the disk operation fails this alert won't be posted, but a
│ │ │ +file_error_alert is posted instead, and the torrent is stopped.
│ │ │ +
│ │ │ +struct file_prio_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ + error_code error;
│ │ │ + operation_t op;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error
│ │ │ +- the error
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- op
│ │ │ +- the operation that failed
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
oversized_file_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert may be posted when the initial checking of resume data and files
│ │ │ +on disk (just existence, not piece hashes) completes. If a file belonging
│ │ │ +to the torrent is found on disk, but is larger than the file in the
│ │ │ +torrent, that's when this alert is posted.
│ │ │ +the client may want to call truncate_files() in that case, or perhaps
│ │ │ +interpret it as a sign that some other file is in the way, that shouldn't
│ │ │ +be overwritten.
│ │ │ +
│ │ │ +struct oversized_file_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
torrent_conflict_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
this alert is posted when two separate torrents (magnet links) resolve to
│ │ │ +the same torrent, thus causing the same torrent being added twice. In
│ │ │ +that case, both torrents enter an error state with duplicate_torrent
│ │ │ +as the error code. This alert is posted containing the metadata. For more
│ │ │ +information, see BitTorrent v2 torrents.
│ │ │ +The torrent this alert originated from was the one that downloaded the
│ │ │ +
metadata (i.e. the handle member from the torrent_alert base class).
│ │ │ +
│ │ │ +struct torrent_conflict_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::error;
│ │ │ + torrent_handle conflicting_torrent;
│ │ │ + std::shared_ptr<torrent_info> metadata;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- conflicting_torrent
│ │ │ +- the handle to the torrent in conflict. The swarm associated with this
│ │ │ +torrent handle did not download the metadata, but the downloaded
│ │ │ +metadata collided with this swarm's info-hash.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- 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]
│ │ │ +
│ │ │ +
peer_info_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted when torrent_handle::post_peer_info() is called
│ │ │ +
│ │ │ +struct peer_info_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + std::vector<lt::peer_info> peer_info;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- peer_info
│ │ │ +- the list of the currently connected peers
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_progress_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted when torrent_handle::post_file_progress() is called
│ │ │ +
│ │ │ +struct file_progress_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::file_progress;
│ │ │ + aux::vector<std::int64_t, file_index_t> files;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- files
│ │ │ +- the list of the files in the torrent
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_info_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted when torrent_handle::post_download_queue() is called
│ │ │ +
│ │ │ +struct piece_info_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::piece_progress;
│ │ │ + std::vector<partial_piece_info> piece_info;
│ │ │ + std::vector<block_info> block_data;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- piece_info
│ │ │ +- info about pieces being downloaded for the torrent
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- block_data
│ │ │ +- storage for block_info pointers in partial_piece_info objects
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_availability_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted when torrent_handle::post_piece_availability() is called
│ │ │ +
│ │ │ +struct piece_availability_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + std::vector<int> piece_availability;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- piece_availability
│ │ │ +- info about pieces being downloaded for the torrent
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
tracker_list_alert
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
posted when torrent_handle::post_trackers() is called
│ │ │ +
│ │ │ +struct tracker_list_alert final : torrent_alert
│ │ │ +{
│ │ │ + std::string message () const override;
│ │ │ +
│ │ │ + static constexpr alert_category_t static_category = alert_category::status;
│ │ │ + std::vector<announce_entry> trackers;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- trackers
│ │ │ +- list of trackers and their status for the torrent
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
alert
│ │ │ +
Declared in "libtorrent/alert.hpp"
│ │ │ +
The alert class is the base class that specific messages are derived from.
│ │ │ +alert types are not copyable, and cannot be constructed by the client. The
│ │ │ +pointers returned by libtorrent are short lived (the details are described
│ │ │ +under session_handle::pop_alerts())
│ │ │ +
│ │ │ +struct alert
│ │ │ +{
│ │ │ + time_point timestamp () const;
│ │ │ + virtual int type () const noexcept = 0;
│ │ │ + virtual char const* what () const noexcept = 0;
│ │ │ + virtual std::string message () const = 0;
│ │ │ + virtual alert_category_t category () const noexcept = 0;
│ │ │ +
│ │ │ + static constexpr alert_category_t error_notification = 0_bit;
│ │ │ + static constexpr alert_category_t peer_notification = 1_bit;
│ │ │ + static constexpr alert_category_t port_mapping_notification = 2_bit;
│ │ │ + static constexpr alert_category_t storage_notification = 3_bit;
│ │ │ + static constexpr alert_category_t tracker_notification = 4_bit;
│ │ │ + static constexpr alert_category_t connect_notification = 5_bit;
│ │ │ + static constexpr alert_category_t status_notification = 6_bit;
│ │ │ + static constexpr alert_category_t ip_block_notification = 8_bit;
│ │ │ + static constexpr alert_category_t performance_warning = 9_bit;
│ │ │ + static constexpr alert_category_t dht_notification = 10_bit;
│ │ │ + static constexpr alert_category_t session_log_notification = 13_bit;
│ │ │ + static constexpr alert_category_t torrent_log_notification = 14_bit;
│ │ │ + static constexpr alert_category_t peer_log_notification = 15_bit;
│ │ │ + static constexpr alert_category_t incoming_request_notification = 16_bit;
│ │ │ + static constexpr alert_category_t dht_log_notification = 17_bit;
│ │ │ + static constexpr alert_category_t dht_operation_notification = 18_bit;
│ │ │ + static constexpr alert_category_t port_mapping_log_notification = 19_bit;
│ │ │ + static constexpr alert_category_t picker_log_notification = 20_bit;
│ │ │ + static constexpr alert_category_t file_progress_notification = 21_bit;
│ │ │ + static constexpr alert_category_t piece_progress_notification = 22_bit;
│ │ │ + static constexpr alert_category_t upload_notification = 23_bit;
│ │ │ + static constexpr alert_category_t block_progress_notification = 24_bit;
│ │ │ + static constexpr alert_category_t all_categories = alert_category_t::all();
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
timestamp()
│ │ │ +
│ │ │ +time_point timestamp () const;
│ │ │ +
│ │ │ +
a timestamp is automatically created in the constructor
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
type()
│ │ │ +
│ │ │ +virtual int type () const noexcept = 0;
│ │ │ +
│ │ │ +
returns an integer that is unique to this alert type. It can be
│ │ │ +compared against a specific alert by querying a static constant called alert_type
│ │ │ +in the alert. It can be used to determine the run-time type of an alert* in
│ │ │ +order to cast to that alert type and access specific members.
│ │ │ +
e.g:
│ │ │ +
│ │ │ +std::vector<alert*> alerts;
│ │ │ +ses.pop_alerts(&alerts);
│ │ │ +for (alert* a : alerts) {
│ │ │ + switch (a->type()) {
│ │ │ +
│ │ │ + case read_piece_alert::alert_type:
│ │ │ + {
│ │ │ + auto* p = static_cast<read_piece_alert*>(a);
│ │ │ + if (p->ec) {
│ │ │ + break;
│ │ │ + }
│ │ │ + break;
│ │ │ + }
│ │ │ + case file_renamed_alert::alert_type:
│ │ │ + {
│ │ │ + }
│ │ │ + }
│ │ │ +}
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
what()
│ │ │ +
│ │ │ +virtual char const* what () const noexcept = 0;
│ │ │ +
│ │ │ +
returns a string literal describing the type of the alert. It does
│ │ │ +not include any information that might be bundled with the alert.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
message()
│ │ │ +
│ │ │ +virtual std::string message () const = 0;
│ │ │ +
│ │ │ +
generate a string describing the alert and the information bundled
│ │ │ +with it. This is mainly intended for debug and development use. It is not suitable
│ │ │ +to use this for applications that may be localized. Instead, handle each alert
│ │ │ +type individually and extract and render the information from the alert depending
│ │ │ +on the locale.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
category()
│ │ │ +
│ │ │ +virtual alert_category_t category () const noexcept = 0;
│ │ │ +
│ │ │ +
returns a bitmask specifying which categories this alert belong to.
│ │ │ +
[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);
│ │ │ +
│ │ │ +
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]
│ │ │ +
│ │ │ +
enum operation_t
│ │ │ +
Declared in "libtorrent/operations.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| no_error |
│ │ │ +
| unknown |
│ │ │ 0 |
│ │ │ -Not an error |
│ │ │ +the error was unexpected and it is unknown which operation caused it |
│ │ │
│ │ │ -| file_collision |
│ │ │ +
| bittorrent |
│ │ │ 1 |
│ │ │ -Two torrents has files which end up overwriting each other |
│ │ │ +this is used when the bittorrent logic
│ │ │ +determines to disconnect |
│ │ │
│ │ │ -| failed_hash_check |
│ │ │ +
| iocontrol |
│ │ │ 2 |
│ │ │ -A piece did not match its piece hash |
│ │ │ +a call to iocontrol failed |
│ │ │
│ │ │ -| torrent_is_no_dict |
│ │ │ +
| getpeername |
│ │ │ 3 |
│ │ │ -The .torrent file does not contain a bencoded dictionary at
│ │ │ -its top level |
│ │ │ +a call to getpeername() failed (querying the remote IP of a
│ │ │ +connection) |
│ │ │
│ │ │ -| torrent_missing_info |
│ │ │ +
| getname |
│ │ │ 4 |
│ │ │ -The .torrent file does not have an info dictionary |
│ │ │ +a call to getname failed (querying the local IP of a
│ │ │ +connection) |
│ │ │
│ │ │ -| torrent_info_no_dict |
│ │ │ +
| alloc_recvbuf |
│ │ │ 5 |
│ │ │ -The .torrent file's info entry is not a dictionary |
│ │ │ +an attempt to allocate a receive buffer failed |
│ │ │
│ │ │ -| torrent_missing_piece_length |
│ │ │ +
| alloc_sndbuf |
│ │ │ 6 |
│ │ │ -The .torrent file does not have a piece length entry |
│ │ │ +an attempt to allocate a send buffer failed |
│ │ │
│ │ │ -| torrent_missing_name |
│ │ │ +
| file_write |
│ │ │ 7 |
│ │ │ -The .torrent file does not have a name entry |
│ │ │ +writing to a file failed |
│ │ │
│ │ │ -| torrent_invalid_name |
│ │ │ +
| file_read |
│ │ │ 8 |
│ │ │ -The .torrent file's name entry is invalid |
│ │ │ +reading from a file failed |
│ │ │
│ │ │ -| torrent_invalid_length |
│ │ │ +
| file |
│ │ │ 9 |
│ │ │ -The length of a file, or of the whole .torrent file is invalid.
│ │ │ -Either negative or not an integer |
│ │ │ +a non-read and non-write file operation failed |
│ │ │
│ │ │ -| torrent_file_parse_failed |
│ │ │ +
| sock_write |
│ │ │ 10 |
│ │ │ -Failed to parse a file entry in the .torrent |
│ │ │ +a socket write operation failed |
│ │ │
│ │ │ -| torrent_missing_pieces |
│ │ │ +
| sock_read |
│ │ │ 11 |
│ │ │ -The pieces field is missing or invalid in the .torrent file |
│ │ │ +a socket read operation failed |
│ │ │
│ │ │ -| torrent_invalid_hashes |
│ │ │ +
| sock_open |
│ │ │ 12 |
│ │ │ -The pieces string has incorrect length |
│ │ │ +a call to open(), to create a socket socket failed |
│ │ │
│ │ │ -| too_many_pieces_in_torrent |
│ │ │ +
| sock_bind |
│ │ │ 13 |
│ │ │ -The .torrent file has more pieces than is supported by libtorrent |
│ │ │ +a call to bind() on a socket failed |
│ │ │
│ │ │ -| invalid_swarm_metadata |
│ │ │ +
| available |
│ │ │ 14 |
│ │ │ -The metadata (.torrent file) that was received from the swarm
│ │ │ -matched the info-hash, but failed to be parsed |
│ │ │ +an attempt to query the number of bytes available to read from a socket
│ │ │ +failed |
│ │ │
│ │ │ -| invalid_bencoding |
│ │ │ +
| encryption |
│ │ │ 15 |
│ │ │ -The file or buffer is not correctly bencoded |
│ │ │ +a call related to bittorrent protocol encryption failed |
│ │ │
│ │ │ -| no_files_in_torrent |
│ │ │ +
| connect |
│ │ │ 16 |
│ │ │ -The .torrent file does not contain any files |
│ │ │ +an attempt to connect a socket failed |
│ │ │
│ │ │ -| invalid_escaped_string |
│ │ │ +
| ssl_handshake |
│ │ │ 17 |
│ │ │ -The string was not properly url-encoded as expected |
│ │ │ +establishing an SSL connection failed |
│ │ │
│ │ │ -| session_is_closing |
│ │ │ +
| get_interface |
│ │ │ 18 |
│ │ │ -Operation is not permitted since the session is shutting down |
│ │ │ +a connection failed to satisfy the bind interface setting |
│ │ │
│ │ │ -| duplicate_torrent |
│ │ │ +
| sock_listen |
│ │ │ 19 |
│ │ │ -There's already a torrent with that info-hash added to the
│ │ │ -session |
│ │ │ +a call to listen() on a socket |
│ │ │
│ │ │ -| invalid_torrent_handle |
│ │ │ +
| sock_bind_to_device |
│ │ │ 20 |
│ │ │ -The supplied torrent_handle is not referring to a valid torrent |
│ │ │ +a call to the ioctl to bind a socket to a specific network device or
│ │ │ +adapter |
│ │ │
│ │ │ -| invalid_entry_type |
│ │ │ +
| sock_accept |
│ │ │ 21 |
│ │ │ -The type requested from the entry did not match its type |
│ │ │ +a call to accept() on a socket |
│ │ │
│ │ │ -| missing_info_hash_in_uri |
│ │ │ +
| parse_address |
│ │ │ 22 |
│ │ │ -The specified URI does not contain a valid info-hash |
│ │ │ +convert a string into a valid network address |
│ │ │
│ │ │ -| file_too_short |
│ │ │ +
| enum_if |
│ │ │ 23 |
│ │ │ -One of the files in the torrent was unexpectedly small. This
│ │ │ -might be caused by files being changed by an external process |
│ │ │ +enumeration network devices or adapters |
│ │ │
│ │ │ -| unsupported_url_protocol |
│ │ │ +
| file_stat |
│ │ │ 24 |
│ │ │ -The URL used an unknown protocol. Currently http and
│ │ │ -https (if built with openssl support) are recognized. For
│ │ │ -trackers udp is recognized as well. |
│ │ │ +invoking stat() on a file |
│ │ │
│ │ │ -| url_parse_error |
│ │ │ +
| file_copy |
│ │ │ 25 |
│ │ │ -The URL did not conform to URL syntax and failed to be parsed |
│ │ │ +copying a file |
│ │ │
│ │ │ -| peer_sent_empty_piece |
│ │ │ +
| file_fallocate |
│ │ │ 26 |
│ │ │ -The peer sent a piece message of length 0 |
│ │ │ +allocating storage for a file |
│ │ │
│ │ │ -| parse_failed |
│ │ │ +
| file_hard_link |
│ │ │ 27 |
│ │ │ -A bencoded structure was corrupt and failed to be parsed |
│ │ │ +creating a hard link |
│ │ │
│ │ │ -| invalid_file_tag |
│ │ │ +
| file_remove |
│ │ │ 28 |
│ │ │ -The fast resume file was missing or had an invalid file version
│ │ │ -tag |
│ │ │ +removing a file |
│ │ │
│ │ │ -| missing_info_hash |
│ │ │ +
| file_rename |
│ │ │ 29 |
│ │ │ -The fast resume file was missing or had an invalid info-hash |
│ │ │ +renaming a file |
│ │ │
│ │ │ -| mismatching_info_hash |
│ │ │ +
| file_open |
│ │ │ 30 |
│ │ │ -The info-hash did not match the torrent |
│ │ │ +opening a file |
│ │ │
│ │ │ -| invalid_hostname |
│ │ │ +
| mkdir |
│ │ │ 31 |
│ │ │ -The URL contained an invalid hostname |
│ │ │ +creating a directory |
│ │ │
│ │ │ -| invalid_port |
│ │ │ +
| check_resume |
│ │ │ 32 |
│ │ │ -The URL had an invalid port |
│ │ │ +check fast resume data against files on disk |
│ │ │
│ │ │ -| port_blocked |
│ │ │ +
| exception |
│ │ │ 33 |
│ │ │ -The port is blocked by the port-filter, and prevented the
│ │ │ -connection |
│ │ │ +an unknown exception |
│ │ │
│ │ │ -| expected_close_bracket_in_address |
│ │ │ +
| alloc_cache_piece |
│ │ │ 34 |
│ │ │ -The IPv6 address was expected to end with "]" |
│ │ │ +allocate space for a piece in the cache |
│ │ │
│ │ │ -| destructing_torrent |
│ │ │ +
| partfile_move |
│ │ │ 35 |
│ │ │ -The torrent is being destructed, preventing the operation to
│ │ │ -succeed |
│ │ │ +move a part-file |
│ │ │
│ │ │ -| timed_out |
│ │ │ +
| partfile_read |
│ │ │ 36 |
│ │ │ -The connection timed out |
│ │ │ +read from a part file |
│ │ │
│ │ │ -| upload_upload_connection |
│ │ │ +
| partfile_write |
│ │ │ 37 |
│ │ │ -The peer is upload only, and we are upload only. There's no point
│ │ │ -in keeping the connection |
│ │ │ +write to a part-file |
│ │ │
│ │ │ -| uninteresting_upload_peer |
│ │ │ +
| hostname_lookup |
│ │ │ 38 |
│ │ │ -The peer is upload only, and we're not interested in it. There's
│ │ │ -no point in keeping the connection |
│ │ │ +a hostname lookup |
│ │ │
│ │ │ -| invalid_info_hash |
│ │ │ +
| symlink |
│ │ │ 39 |
│ │ │ -The peer sent an unknown info-hash |
│ │ │ +create or read a symlink |
│ │ │
│ │ │ -| torrent_paused |
│ │ │ +
| handshake |
│ │ │ 40 |
│ │ │ -The torrent is paused, preventing the operation from succeeding |
│ │ │ +handshake with a peer or server |
│ │ │
│ │ │ -| invalid_have |
│ │ │ +
| sock_option |
│ │ │ 41 |
│ │ │ -The peer sent an invalid have message, either wrong size or
│ │ │ -referring to a piece that doesn't exist in the torrent |
│ │ │ +set socket option |
│ │ │
│ │ │ -| invalid_bitfield_size |
│ │ │ +
| enum_route |
│ │ │ 42 |
│ │ │ -The bitfield message had the incorrect size |
│ │ │ +enumeration of network routes |
│ │ │
│ │ │ -| too_many_requests_when_choked |
│ │ │ +
| file_seek |
│ │ │ 43 |
│ │ │ -The peer kept requesting pieces after it was choked, possible
│ │ │ -abuse attempt. |
│ │ │ +moving read/write position in a file, operation_t::hostname_lookup |
│ │ │
│ │ │ -| invalid_piece |
│ │ │ +
| timer |
│ │ │ 44 |
│ │ │ -The peer sent a piece message that does not correspond to a
│ │ │ -piece request sent by the client |
│ │ │ +an async wait operation on a timer |
│ │ │
│ │ │ -| no_memory |
│ │ │ +
| file_mmap |
│ │ │ 45 |
│ │ │ -memory allocation failed |
│ │ │ +call to mmap() (or windows counterpart) |
│ │ │
│ │ │ -| torrent_aborted |
│ │ │ +
| file_truncate |
│ │ │ 46 |
│ │ │ -The torrent is aborted, preventing the operation to succeed |
│ │ │ -
│ │ │ -| self_connection |
│ │ │ -47 |
│ │ │ -The peer is a connection to ourself, no point in keeping it |
│ │ │ -
│ │ │ -| invalid_piece_size |
│ │ │ -48 |
│ │ │ -The peer sent a piece message with invalid size, either negative
│ │ │ -or greater than one block |
│ │ │ -
│ │ │ -| timed_out_no_interest |
│ │ │ -49 |
│ │ │ -The peer has not been interesting or interested in us for too
│ │ │ -long, no point in keeping it around |
│ │ │ -
│ │ │ -| timed_out_inactivity |
│ │ │ -50 |
│ │ │ -The peer has not said anything in a long time, possibly dead |
│ │ │ -
│ │ │ -| timed_out_no_handshake |
│ │ │ -51 |
│ │ │ -The peer did not send a handshake within a reasonable amount of
│ │ │ -time, it might not be a bittorrent peer |
│ │ │ -
│ │ │ -| timed_out_no_request |
│ │ │ -52 |
│ │ │ -The peer has been unchoked for too long without requesting any
│ │ │ -data. It might be lying about its interest in us |
│ │ │ -
│ │ │ -| invalid_choke |
│ │ │ -53 |
│ │ │ -The peer sent an invalid choke message |
│ │ │ -
│ │ │ -| invalid_unchoke |
│ │ │ -54 |
│ │ │ -The peer send an invalid unchoke message |
│ │ │ -
│ │ │ -| invalid_interested |
│ │ │ -55 |
│ │ │ -The peer sent an invalid interested message |
│ │ │ -
│ │ │ -| invalid_not_interested |
│ │ │ -56 |
│ │ │ -The peer sent an invalid not-interested message |
│ │ │ -
│ │ │ -| invalid_request |
│ │ │ -57 |
│ │ │ -The peer sent an invalid piece request message |
│ │ │ -
│ │ │ -| invalid_hash_list |
│ │ │ -58 |
│ │ │ -The peer sent an invalid hash-list message (this is part of the
│ │ │ -merkle-torrent extension) |
│ │ │ -
│ │ │ -| invalid_hash_piece |
│ │ │ -59 |
│ │ │ -The peer sent an invalid hash-piece message (this is part of the
│ │ │ -merkle-torrent extension) |
│ │ │ -
│ │ │ -| invalid_cancel |
│ │ │ -60 |
│ │ │ -The peer sent an invalid cancel message |
│ │ │ -
│ │ │ -| invalid_dht_port |
│ │ │ -61 |
│ │ │ -The peer sent an invalid DHT port-message |
│ │ │ -
│ │ │ -| invalid_suggest |
│ │ │ -62 |
│ │ │ -The peer sent an invalid suggest piece-message |
│ │ │ -
│ │ │ -| invalid_have_all |
│ │ │ -63 |
│ │ │ -The peer sent an invalid have all-message |
│ │ │ -
│ │ │ -| invalid_have_none |
│ │ │ -64 |
│ │ │ -The peer sent an invalid have none-message |
│ │ │ -
│ │ │ -| invalid_reject |
│ │ │ -65 |
│ │ │ -The peer sent an invalid reject message |
│ │ │ -
│ │ │ -| invalid_allow_fast |
│ │ │ -66 |
│ │ │ -The peer sent an invalid allow fast-message |
│ │ │ -
│ │ │ -| invalid_extended |
│ │ │ -67 |
│ │ │ -The peer sent an invalid extension message ID |
│ │ │ -
│ │ │ -| invalid_message |
│ │ │ -68 |
│ │ │ -The peer sent an invalid message ID |
│ │ │ -
│ │ │ -| sync_hash_not_found |
│ │ │ -69 |
│ │ │ -The synchronization hash was not found in the encrypted handshake |
│ │ │ -
│ │ │ -| invalid_encryption_constant |
│ │ │ -70 |
│ │ │ -The encryption constant in the handshake is invalid |
│ │ │ -
│ │ │ -| no_plaintext_mode |
│ │ │ -71 |
│ │ │ -The peer does not support plain text, which is the selected mode |
│ │ │ -
│ │ │ -| no_rc4_mode |
│ │ │ -72 |
│ │ │ -The peer does not support RC4, which is the selected mode |
│ │ │ -
│ │ │ -| unsupported_encryption_mode |
│ │ │ -73 |
│ │ │ -The peer does not support any of the encryption modes that the
│ │ │ -client supports |
│ │ │ -
│ │ │ -| unsupported_encryption_mode_selected |
│ │ │ -74 |
│ │ │ -The peer selected an encryption mode that the client did not
│ │ │ -advertise and does not support |
│ │ │ -
│ │ │ -| invalid_pad_size |
│ │ │ -75 |
│ │ │ -The pad size used in the encryption handshake is of invalid size |
│ │ │ -
│ │ │ -| invalid_encrypt_handshake |
│ │ │ -76 |
│ │ │ -The encryption handshake is invalid |
│ │ │ -
│ │ │ -| no_incoming_encrypted |
│ │ │ -77 |
│ │ │ -The client is set to not support incoming encrypted connections
│ │ │ -and this is an encrypted connection |
│ │ │ -
│ │ │ -| no_incoming_regular |
│ │ │ -78 |
│ │ │ -The client is set to not support incoming regular bittorrent
│ │ │ -connections, and this is a regular connection |
│ │ │ -
│ │ │ -| duplicate_peer_id |
│ │ │ -79 |
│ │ │ -The client is already connected to this peer-ID |
│ │ │ -
│ │ │ -| torrent_removed |
│ │ │ -80 |
│ │ │ -Torrent was removed |
│ │ │ -
│ │ │ -| packet_too_large |
│ │ │ -81 |
│ │ │ -The packet size exceeded the upper sanity check-limit |
│ │ │ -
│ │ │ -| reserved |
│ │ │ -82 |
│ │ │ - |
│ │ │ -
│ │ │ -| http_error |
│ │ │ -83 |
│ │ │ -The web server responded with an error |
│ │ │ -
│ │ │ -| missing_location |
│ │ │ -84 |
│ │ │ -The web server response is missing a location header |
│ │ │ -
│ │ │ -| invalid_redirection |
│ │ │ -85 |
│ │ │ -The web seed redirected to a path that no longer matches the
│ │ │ -.torrent directory structure |
│ │ │ -
│ │ │ -| redirecting |
│ │ │ -86 |
│ │ │ -The connection was closed because it redirected to a different
│ │ │ -URL |
│ │ │ -
│ │ │ -| invalid_range |
│ │ │ -87 |
│ │ │ -The HTTP range header is invalid |
│ │ │ -
│ │ │ -| no_content_length |
│ │ │ -88 |
│ │ │ -The HTTP response did not have a content length |
│ │ │ -
│ │ │ -| banned_by_ip_filter |
│ │ │ -89 |
│ │ │ -The IP is blocked by the IP filter |
│ │ │ -
│ │ │ -| too_many_connections |
│ │ │ -90 |
│ │ │ -At the connection limit |
│ │ │ -
│ │ │ -| peer_banned |
│ │ │ -91 |
│ │ │ -The peer is marked as banned |
│ │ │ -
│ │ │ -| stopping_torrent |
│ │ │ -92 |
│ │ │ -The torrent is stopping, causing the operation to fail |
│ │ │ -
│ │ │ -| too_many_corrupt_pieces |
│ │ │ -93 |
│ │ │ -The peer has sent too many corrupt pieces and is banned |
│ │ │ -
│ │ │ -| torrent_not_ready |
│ │ │ -94 |
│ │ │ -The torrent is not ready to receive peers |
│ │ │ -
│ │ │ -| peer_not_constructed |
│ │ │ -95 |
│ │ │ -The peer is not completely constructed yet |
│ │ │ -
│ │ │ -| session_closing |
│ │ │ -96 |
│ │ │ -The session is closing, causing the operation to fail |
│ │ │ -
│ │ │ -| optimistic_disconnect |
│ │ │ -97 |
│ │ │ -The peer was disconnected in order to leave room for a
│ │ │ -potentially better peer |
│ │ │ -
│ │ │ -| torrent_finished |
│ │ │ -98 |
│ │ │ -The torrent is finished |
│ │ │ -
│ │ │ -| no_router |
│ │ │ -99 |
│ │ │ -No UPnP router found |
│ │ │ -
│ │ │ -| metadata_too_large |
│ │ │ -100 |
│ │ │ -The metadata message says the metadata exceeds the limit |
│ │ │ -
│ │ │ -| invalid_metadata_request |
│ │ │ -101 |
│ │ │ -The peer sent an invalid metadata request message |
│ │ │ -
│ │ │ -| invalid_metadata_size |
│ │ │ -102 |
│ │ │ -The peer advertised an invalid metadata size |
│ │ │ -
│ │ │ -| invalid_metadata_offset |
│ │ │ -103 |
│ │ │ -The peer sent a message with an invalid metadata offset |
│ │ │ -
│ │ │ -| invalid_metadata_message |
│ │ │ -104 |
│ │ │ -The peer sent an invalid metadata message |
│ │ │ -
│ │ │ -| pex_message_too_large |
│ │ │ -105 |
│ │ │ -The peer sent a peer exchange message that was too large |
│ │ │ -
│ │ │ -| invalid_pex_message |
│ │ │ -106 |
│ │ │ -The peer sent an invalid peer exchange message |
│ │ │ -
│ │ │ -| invalid_lt_tracker_message |
│ │ │ -107 |
│ │ │ -The peer sent an invalid tracker exchange message |
│ │ │ -
│ │ │ -| too_frequent_pex |
│ │ │ -108 |
│ │ │ -The peer sent an pex messages too often. This is a possible
│ │ │ -attempt of and attack |
│ │ │ -
│ │ │ -| no_metadata |
│ │ │ -109 |
│ │ │ -The operation failed because it requires the torrent to have
│ │ │ -the metadata (.torrent file) and it doesn't have it yet.
│ │ │ -This happens for magnet links before they have downloaded the
│ │ │ -metadata, and also torrents added by URL. |
│ │ │ -
│ │ │ -| invalid_dont_have |
│ │ │ -110 |
│ │ │ -The peer sent an invalid dont_have message. The don't have
│ │ │ -message is an extension to allow peers to advertise that the
│ │ │ -no longer has a piece they previously had. |
│ │ │ -
│ │ │ -| requires_ssl_connection |
│ │ │ -111 |
│ │ │ -The peer tried to connect to an SSL torrent without connecting
│ │ │ -over SSL. |
│ │ │ -
│ │ │ -| invalid_ssl_cert |
│ │ │ -112 |
│ │ │ -The peer tried to connect to a torrent with a certificate
│ │ │ -for a different torrent. |
│ │ │ -
│ │ │ -| not_an_ssl_torrent |
│ │ │ -113 |
│ │ │ -the torrent is not an SSL torrent, and the operation requires
│ │ │ -an SSL torrent |
│ │ │ -
│ │ │ -| banned_by_port_filter |
│ │ │ -114 |
│ │ │ -peer was banned because its listen port is within a banned port
│ │ │ -range, as specified by the port_filter. |
│ │ │ -
│ │ │ -| invalid_session_handle |
│ │ │ -115 |
│ │ │ -The session_handle is not referring to a valid session_impl |
│ │ │ -
│ │ │ -| invalid_listen_socket |
│ │ │ -116 |
│ │ │ -the listen socket associated with this request was closed |
│ │ │ -
│ │ │ -| invalid_hash_request |
│ │ │ -117 |
│ │ │ - |
│ │ │ -
│ │ │ -| invalid_hashes |
│ │ │ -118 |
│ │ │ - |
│ │ │ -
│ │ │ -| invalid_hash_reject |
│ │ │ -119 |
│ │ │ - |
│ │ │ -
│ │ │ -| deprecated_120 |
│ │ │ -120 |
│ │ │ - |
│ │ │ -
│ │ │ -| deprecated_121 |
│ │ │ -121 |
│ │ │ - |
│ │ │ +call to ftruncate() (or SetEndOfFile() on windows) |
│ │ │
│ │ │ -| deprecated_122 |
│ │ │ -122 |
│ │ │ - |
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
int
│ │ │ +
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
│ │ │ +- user_alert_id
│ │ │ +- user defined alerts should use IDs greater than this
│ │ │ +
│ │ │ +
│ │ │ +- num_alert_types
│ │ │ +- this constant represents "max_alert_index" + 1
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
alert_category_t
│ │ │ +
Declared in "libtorrent/alert.hpp"
│ │ │ +
│ │ │ +- error
│ │ │ +Enables alerts that report an error. This includes:
│ │ │ +
│ │ │ +- tracker errors
│ │ │ +- tracker warnings
│ │ │ +- file errors
│ │ │ +- resume data failures
│ │ │ +- web seed errors
│ │ │ +- .torrent files errors
│ │ │ +- listen socket errors
│ │ │ +- port mapping errors
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +- peer
│ │ │ +- Enables alerts when peers send invalid requests, get banned or
│ │ │ +snubbed.
│ │ │ +
│ │ │ +
│ │ │ +- port_mapping
│ │ │ +- Enables alerts for port mapping events. For NAT-PMP and UPnP.
│ │ │ +
│ │ │ +
│ │ │ +- storage
│ │ │ +- Enables alerts for events related to the storage. File errors and
│ │ │ +synchronization events for moving the storage, renaming files etc.
│ │ │ +
│ │ │ +
│ │ │ +- tracker
│ │ │ +- Enables all tracker events. Includes announcing to trackers,
│ │ │ +receiving responses, warnings and errors.
│ │ │ +
│ │ │ +
│ │ │ +- connect
│ │ │ +- Low level alerts for when peers are connected and disconnected.
│ │ │ +
│ │ │ +
│ │ │ +- status
│ │ │ +- Enables alerts for when a torrent or the session changes state.
│ │ │ +
│ │ │ +
│ │ │ +- ip_block
│ │ │ +- Alerts when a peer is blocked by the ip blocker or port blocker.
│ │ │ +
│ │ │ +
│ │ │ +- performance_warning
│ │ │ +- Alerts when some limit is reached that might limit the download
│ │ │ +or upload rate.
│ │ │ +
│ │ │ +
│ │ │ +- dht
│ │ │ +- Alerts on events in the DHT node. For incoming searches or
│ │ │ +bootstrapping being done etc.
│ │ │ +
│ │ │ +
│ │ │ +- stats
│ │ │ +- If you enable these alerts, you will receive a stats_alert
│ │ │ +approximately once every second, for every active torrent.
│ │ │ +These alerts contain all statistics counters for the interval since
│ │ │ +the lasts stats alert.
│ │ │ +
│ │ │ +
│ │ │ +- session_log
│ │ │ +- Enables debug logging alerts. These are available unless libtorrent
│ │ │ +was built with logging disabled (TORRENT_DISABLE_LOGGING). The
│ │ │ +alerts being posted are log_alert and are session wide.
│ │ │ +
│ │ │ +
│ │ │ +- torrent_log
│ │ │ +- Enables debug logging alerts for torrents. These are available
│ │ │ +unless libtorrent was built with logging disabled
│ │ │ +(TORRENT_DISABLE_LOGGING). The alerts being posted are
│ │ │ +torrent_log_alert and are torrent wide debug events.
│ │ │ +
│ │ │ +
│ │ │ +- peer_log
│ │ │ +- Enables debug logging alerts for peers. These are available unless
│ │ │ +libtorrent was built with logging disabled
│ │ │ +(TORRENT_DISABLE_LOGGING). The alerts being posted are
│ │ │ +peer_log_alert and low-level peer events and messages.
│ │ │ +
│ │ │ +
│ │ │ +- incoming_request
│ │ │ +- enables the incoming_request_alert.
│ │ │ +
│ │ │ +
│ │ │ +- dht_log
│ │ │ +- enables dht_log_alert, debug logging for the DHT
│ │ │ +
│ │ │ +
│ │ │ +- dht_operation
│ │ │ +- enable events from pure dht operations not related to torrents
│ │ │ +
│ │ │ +
│ │ │ +- port_mapping_log
│ │ │ +- enables port mapping log events. This log is useful
│ │ │ +for debugging the UPnP or NAT-PMP implementation
│ │ │ +
│ │ │ +
│ │ │ +- picker_log
│ │ │ +- enables verbose logging from the piece picker.
│ │ │ +
│ │ │ +
│ │ │ +- file_progress
│ │ │ +- alerts when files complete downloading
│ │ │ +
│ │ │ +
│ │ │ +- piece_progress
│ │ │ +- alerts when pieces complete downloading or fail hash check
│ │ │ +
│ │ │ +
│ │ │ +- upload
│ │ │ +- alerts when we upload blocks to other peers
│ │ │ +
│ │ │ +
│ │ │ +- block_progress
│ │ │ +- alerts on individual blocks being requested, downloading, finished,
│ │ │ +rejected, time-out and cancelled. This is likely to post alerts at a
│ │ │ +high rate.
│ │ │ +
│ │ │ +
│ │ │ +- all
│ │ │ +The full bitmask, representing all available categories.
│ │ │ +since the enum is signed, make sure this isn't
│ │ │ +interpreted as -1. For instance, boost.python
│ │ │ +does that and fails when assigning it to an
│ │ │ +unsigned parameter.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
session_params
│ │ │ +
Declared in "libtorrent/session_params.hpp"
│ │ │ +
The session_params is a parameters pack for configuring the session
│ │ │ +before it's started.
│ │ │ +
│ │ │ +struct session_params
│ │ │ +{
│ │ │ + session_params (settings_pack&& sp);
│ │ │ + session_params ();
│ │ │ + session_params (settings_pack const& sp);
│ │ │ + session_params (settings_pack const& sp
│ │ │ + , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ + session_params (settings_pack&& sp
│ │ │ + , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ +
│ │ │ + settings_pack settings;
│ │ │ + std::vector<std::shared_ptr<plugin>> extensions;
│ │ │ + dht::dht_state dht_state;
│ │ │ + dht::dht_storage_constructor_type dht_storage_constructor;
│ │ │ + disk_io_constructor_type disk_io_constructor;
│ │ │ + std::map<std::string, std::string> ext_state;
│ │ │ + libtorrent::ip_filter ip_filter;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
session_params()
│ │ │ +
│ │ │ +session_params (settings_pack&& sp);
│ │ │ +session_params ();
│ │ │ +session_params (settings_pack const& sp);
│ │ │ +
│ │ │ +
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 const& sp
│ │ │ + , std::vector<std::shared_ptr<plugin>> exts);
│ │ │ +session_params (settings_pack&& sp
│ │ │ + , std::vector<std::shared_ptr<plugin>> 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
│ │ │ +- the plugins to add to the session as it is constructed
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- dht_state
│ │ │ +- DHT node ID and node addresses to bootstrap the DHT with.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- dht_storage_constructor
│ │ │ +- function object to construct the storage object for DHT items.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- disk_io_constructor
│ │ │ +- function object to create the disk I/O subsystem. Defaults to
│ │ │ +default_disk_io_constructor.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- ext_state
│ │ │ +- this container can be used by extensions/plugins to store settings. It's
│ │ │ +primarily here to make it convenient to save and restore state across
│ │ │ +sessions, using read_session_params() and write_session_params().
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- ip_filter
│ │ │ +- the IP filter to use for the session. This restricts which peers are allowed
│ │ │ +to connect. As if passed to set_ip_filter().
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
session_proxy
│ │ │ +
Declared in "libtorrent/session.hpp"
│ │ │ +
this is a holder for the internal session implementation object. Once the
│ │ │ +session destruction is explicitly initiated, this holder is used to
│ │ │ +synchronize 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& operator= (session_proxy const&) &;
│ │ │ + session_proxy ();
│ │ │ + session_proxy& operator= (session_proxy&&) & noexcept;
│ │ │ + session_proxy (session_proxy const&);
│ │ │ + ~session_proxy ();
│ │ │ + session_proxy (session_proxy&&) noexcept;
│ │ │ +};
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
operator=() ~session_proxy() session_proxy()
│ │ │ +
│ │ │ +session_proxy& operator= (session_proxy const&) &;
│ │ │ +session_proxy ();
│ │ │ +session_proxy& operator= (session_proxy&&) & noexcept;
│ │ │ +session_proxy (session_proxy const&);
│ │ │ +~session_proxy ();
│ │ │ +session_proxy (session_proxy&&) noexcept;
│ │ │ +
│ │ │ +
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 will be idle as long it doesn't have any
│ │ │ +torrents to participate in.
│ │ │ +
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
│ │ │ +{
│ │ │ + explicit session (session_params&& params);
│ │ │ + session ();
│ │ │ + session (session_params&& params, session_flags_t flags);
│ │ │ + explicit session (session_params const& params);
│ │ │ + session (session_params const& params, session_flags_t flags);
│ │ │ + session (session_params&& params, io_context& ios);
│ │ │ + session (session_params&& 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()
│ │ │ +
│ │ │ +explicit session (session_params&& params);
│ │ │ +session ();
│ │ │ +session (session_params&& params, session_flags_t flags);
│ │ │ +explicit session (session_params const& params);
│ │ │ +session (session_params const& params, session_flags_t flags);
│ │ │ +
│ │ │ +
Constructs the session objects which acts as the container of torrents.
│ │ │ +In order to avoid a race condition between starting the session and
│ │ │ +configuring it, you can pass in a session_params object. Its settings
│ │ │ +will take effect before the session starts up.
│ │ │ +
The overloads taking flags can be used to start a session in
│ │ │ +paused mode (by passing in session::paused). Note that
│ │ │ +add_default_plugins do not have an affect on constructors that
│ │ │ +take a session_params object. It already contains the plugins to use.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
session()
│ │ │ +
│ │ │ +session (session_params&& params, io_context& ios);
│ │ │ +session (session_params&& 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 io_context::run() call must have returned
│ │ │ +before it's safe to destruct the session. Which means you MUST
│ │ │ +call session::abort() and save the session_proxy first, then
│ │ │ +destruct the session object, then sync with the io_context, then
│ │ │ +destruct the session_proxy object.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
~session()
│ │ │ +
│ │ │ +~session ();
│ │ │ +
│ │ │ +
The destructor of session will notify all trackers that our torrents
│ │ │ +have been shut down. If some trackers are down, they will time out.
│ │ │ +All this before the destructor of session returns. So, it's advised
│ │ │ +that any kind of interface (such as windows) are closed before
│ │ │ +destructing the session object. Because it can take a few second for
│ │ │ +it to finish. The timeout can be set with apply_settings().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
abort()
│ │ │ +
│ │ │ +session_proxy abort ();
│ │ │ +
│ │ │ +
In case you want to destruct the session asynchronously, you can
│ │ │ +request a session destruction proxy. If you don't do this, the
│ │ │ +destructor of the session object will block while the trackers are
│ │ │ +contacted. If you keep one session_proxy to the session when
│ │ │ +destructing it, the destructor will not block, but start to close down
│ │ │ +the session, the destructor of the proxy will then synchronize the
│ │ │ +threads. So, the destruction of the session is performed from the
│ │ │ +session destructor call until the session_proxy destructor
│ │ │ +call. The session_proxy does not have any operations on it (since
│ │ │ +the session is being closed down, no operations are allowed on it).
│ │ │ +The only valid operation is calling the destructor:
│ │ │ +
│ │ │ +struct session_proxy {};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
session_handle
│ │ │ +
Declared in "libtorrent/session_handle.hpp"
│ │ │ +
this class provides a non-owning handle to a session and a subset of the
│ │ │ +interface of the session class. If the underlying session is destructed
│ │ │ +any handle to it will no longer be valid. is_valid() will return false and
│ │ │ +any 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<torrent_status>* ret
│ │ │ + , status_flags_t flags = {}) const;
│ │ │ + std::vector<torrent_status> get_torrent_status (
│ │ │ + std::function<bool(torrent_status const&)> const& pred
│ │ │ + , 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 (sha256_hash const& info_hash) const;
│ │ │ + torrent_handle find_torrent (sha1_hash const& info_hash) const;
│ │ │ + std::vector<torrent_handle> get_torrents () const;
│ │ │ + 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, error_code& ec);
│ │ │ + torrent_handle add_torrent (add_torrent_params const& params);
│ │ │ + void async_add_torrent (add_torrent_params&& params);
│ │ │ + torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);
│ │ │ + bool is_paused () const;
│ │ │ + void pause ();
│ │ │ + void resume ();
│ │ │ + bool is_dht_running () const;
│ │ │ + void set_dht_storage (dht::dht_storage_constructor_type sc);
│ │ │ + void add_dht_node (std::pair<std::string, int> const& node);
│ │ │ + void dht_get_item (sha1_hash const& target);
│ │ │ + void dht_get_item (std::array<char, 32> key
│ │ │ + , std::string salt = std::string());
│ │ │ + sha1_hash dht_put_item (entry data);
│ │ │ + void dht_put_item (std::array<char, 32> key
│ │ │ + , std::function<void(entry&, std::array<char, 64>&
│ │ │ + , std::int64_t&, std::string const&)> cb
│ │ │ + , std::string salt = std::string());
│ │ │ + void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});
│ │ │ + void dht_get_peers (sha1_hash const& info_hash);
│ │ │ + void dht_live_nodes (sha1_hash const& nid);
│ │ │ + void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);
│ │ │ + void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});
│ │ │ + void add_extension (std::function<std::shared_ptr<torrent_plugin>(
│ │ │ + torrent_handle const&, client_data_t)> ext);
│ │ │ + void add_extension (std::shared_ptr<plugin> 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_type_filter (peer_class_type_filter const& f);
│ │ │ + peer_class_type_filter get_peer_class_type_filter () const;
│ │ │ + peer_class_t create_peer_class (char const* name);
│ │ │ + void delete_peer_class (peer_class_t cid);
│ │ │ + peer_class_info get_peer_class (peer_class_t cid) const;
│ │ │ + void set_peer_class (peer_class_t cid, peer_class_info const& pci);
│ │ │ + void remove_torrent (const torrent_handle&, remove_flags_t = {});
│ │ │ + void apply_settings (settings_pack const&);
│ │ │ + settings_pack get_settings () const;
│ │ │ + void apply_settings (settings_pack&&);
│ │ │ + void pop_alerts (std::vector<alert*>* alerts);
│ │ │ + alert* wait_for_alert (time_duration max_wait);
│ │ │ + void set_alert_notify (std::function<void()> const& fun);
│ │ │ + void delete_port_mapping (port_mapping_t handle);
│ │ │ + std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);
│ │ │ + void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);
│ │ │ + std::shared_ptr<aux::session_impl> native_handle () const;
│ │ │ +
│ │ │ + static constexpr save_state_flags_t save_settings = 0_bit;
│ │ │ + static constexpr save_state_flags_t save_dht_state = 2_bit;
│ │ │ + static constexpr save_state_flags_t save_extension_state = 11_bit;
│ │ │ + static constexpr save_state_flags_t save_ip_filter = 12_bit;
│ │ │ + static constexpr peer_class_t global_peer_class_id {0};
│ │ │ + static constexpr peer_class_t tcp_peer_class_id {1};
│ │ │ + static constexpr peer_class_t local_peer_class_id {2};
│ │ │ + static constexpr remove_flags_t delete_files = 0_bit;
│ │ │ + static constexpr remove_flags_t delete_partfile = 1_bit;
│ │ │ + static constexpr session_flags_t paused = 2_bit;
│ │ │ + static constexpr portmap_protocol udp = portmap_protocol::udp;
│ │ │ + static constexpr portmap_protocol tcp = portmap_protocol::tcp;
│ │ │ + static constexpr reopen_network_flags_t reopen_map_ports = 0_bit;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
is_valid()
│ │ │ +
│ │ │ +bool is_valid () const;
│ │ │ +
│ │ │ +
returns true if this handle refers to a valid session object. If the
│ │ │ +session has been destroyed, all session_handle objects will expire and
│ │ │ +not be valid.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
session_state()
│ │ │ +
│ │ │ +session_params session_state (save_state_flags_t flags = save_state_flags_t::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<torrent_status>* ret
│ │ │ + , status_flags_t flags = {}) const;
│ │ │ +std::vector<torrent_status> get_torrent_status (
│ │ │ + std::function<bool(torrent_status const&)> const& pred
│ │ │ + , 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 should be included and false means
│ │ │ +excluded. The flags argument is the same as to
│ │ │ +torrent_handle::status(). Since pred is guaranteed to be
│ │ │ +called for every torrent, it may be used to count the number of
│ │ │ +torrents of different categories as well.
│ │ │ +
refresh_torrent_status takes a vector of torrent_status structs
│ │ │ +(for instance the same vector that was returned by
│ │ │ +get_torrent_status() ) and refreshes the status based on the
│ │ │ +handle member. It is possible to use this function by first
│ │ │ +setting up a vector of default constructed torrent_status objects,
│ │ │ +only initializing the handle member, in order to request the
│ │ │ +torrent status for multiple torrents in a single call. This can save a
│ │ │ +significant amount of time if you have a lot of torrents.
│ │ │ +
Any torrent_status object whose handle member is not referring to
│ │ │ +a valid torrent are ignored.
│ │ │ +
The intended use of these functions is to start off by calling
│ │ │ +get_torrent_status() to get a list of all torrents that match your
│ │ │ +criteria. Then call refresh_torrent_status() on that list. This
│ │ │ +will only refresh the status for the torrents in your list, and thus
│ │ │ +ignore all other torrents you might be running. This may save a
│ │ │ +significant amount of time, especially if the number of torrents you're
│ │ │ +interested in is small. In order to keep your list of interested
│ │ │ +torrents up to date, you can either call get_torrent_status() from
│ │ │ +time to time, to include torrents you might have become interested in
│ │ │ +since the last time. In order to stop refreshing a certain torrent,
│ │ │ +simply remove it from the list.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
post_torrent_updates()
│ │ │ +
│ │ │ +void post_torrent_updates (status_flags_t flags = status_flags_t::all());
│ │ │ +
│ │ │ +
This functions instructs the session to post the state_update_alert,
│ │ │ +containing the status of all torrents whose state changed since the
│ │ │ +last time this function was called.
│ │ │ +
Only torrents who has the state subscription flag set will be
│ │ │ +included. This flag is on by default. See add_torrent_params.
│ │ │ +the flags argument is the same as for torrent_handle::status().
│ │ │ +see status_flags_t in torrent_handle.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
post_session_stats()
│ │ │ +
│ │ │ +void post_session_stats ();
│ │ │ +
│ │ │ +
This function will post a session_stats_alert object, containing a
│ │ │ +snapshot of the performance counters from the internals of libtorrent.
│ │ │ +To interpret these counters, query the session via
│ │ │ +session_stats_metrics().
│ │ │ +
For more information, see the session statistics section.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
post_dht_stats()
│ │ │ +
│ │ │ +void post_dht_stats ();
│ │ │ +
│ │ │ +
This will cause a dht_stats_alert to be posted.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
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]
│ │ │ +
│ │ │ +
get_torrents() find_torrent()
│ │ │ +
│ │ │ +torrent_handle find_torrent (sha256_hash const& info_hash) const;
│ │ │ +torrent_handle find_torrent (sha1_hash const& info_hash) const;
│ │ │ +std::vector<torrent_handle> get_torrents () 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()
│ │ │ +
│ │ │ +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, error_code& ec);
│ │ │ +torrent_handle add_torrent (add_torrent_params const& params);
│ │ │ +void async_add_torrent (add_torrent_params&& 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 save_path field in add_torrent_params must be set to a valid
│ │ │ +path where the files for the torrent will be saved. Even when using a
│ │ │ +custom storage, this needs to be set to something. If the save_path
│ │ │ +is empty, the call to add_torrent() will throw a system_error
│ │ │ +exception.
│ │ │ +
The overload that does not take an error_code throws an exception on
│ │ │ +error and is not available when building without exception support.
│ │ │ +The torrent_handle returned by add_torrent() can be used to retrieve
│ │ │ +information about the torrent's progress, its peers etc. It is also
│ │ │ +used to abort a torrent.
│ │ │ +
If the torrent you are trying to add already exists in the session (is
│ │ │ +either queued for checking, being checked or downloading)
│ │ │ +add_torrent() will throw system_error which derives from
│ │ │ +std::exception unless duplicate_is_error is set to false. In that
│ │ │ +case, add_torrent() will return the handle to the existing torrent.
│ │ │ +
The add_torrent_params class has a flags field. It can be used to
│ │ │ +control what state the new torrent will be added in. Common flags to
│ │ │ +want to control are 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]
│ │ │ +
│ │ │ +
pause() is_paused() resume()
│ │ │ +
│ │ │ +bool is_paused () const;
│ │ │ +void pause ();
│ │ │ +void resume ();
│ │ │ +
│ │ │ +
Pausing the session has the same effect as pausing every torrent in
│ │ │ +it, except that torrents will not be resumed by the auto-manage
│ │ │ +mechanism. Resuming will restore the torrents to their previous paused
│ │ │ +state. i.e. the session pause state is separate from the torrent pause
│ │ │ +state. A torrent is inactive if it is paused or if the session is
│ │ │ +paused.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
is_dht_running()
│ │ │ +
│ │ │ +bool is_dht_running () const;
│ │ │ +
│ │ │ +
is_dht_running() returns true if the DHT support has been started
│ │ │ +and false otherwise.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
set_dht_storage()
│ │ │ +
│ │ │ +void set_dht_storage (dht::dht_storage_constructor_type sc);
│ │ │ +
│ │ │ +
set_dht_storage set a dht custom storage constructor function
│ │ │ +to be used internally when the dht is created.
│ │ │ +
Since the dht storage is a critical component for the dht behavior,
│ │ │ +this function will only be effective the next time the dht is started.
│ │ │ +If you never touch this feature, a default map-memory based storage
│ │ │ +is used.
│ │ │ +
If you want to make sure the dht is initially created with your
│ │ │ +custom storage, create a session with the setting
│ │ │ +settings_pack::enable_dht to false, set your constructor function
│ │ │ +and call apply_settings with settings_pack::enable_dht to true.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
add_dht_node()
│ │ │ +
│ │ │ +void add_dht_node (std::pair<std::string, int> const& node);
│ │ │ +
│ │ │ +
add_dht_node takes a host name and port pair. That endpoint will be
│ │ │ +pinged, and if a valid DHT reply is received, the node will be added to
│ │ │ +the routing table.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_get_item()
│ │ │ +
│ │ │ +void dht_get_item (sha1_hash const& target);
│ │ │ +
│ │ │ +
query the DHT for an immutable item at the target hash.
│ │ │ +the result is posted as a dht_immutable_item_alert.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_get_item()
│ │ │ +
│ │ │ +void dht_get_item (std::array<char, 32> key
│ │ │ + , std::string salt = std::string());
│ │ │ +
│ │ │ +
query the DHT for a mutable item under the public key key.
│ │ │ +this is an ed25519 key. salt is optional and may be left
│ │ │ +as an empty string if no salt is to be used.
│ │ │ +if the item is found in the DHT, a dht_mutable_item_alert is
│ │ │ +posted.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_put_item()
│ │ │ +
│ │ │ +sha1_hash dht_put_item (entry data);
│ │ │ +
│ │ │ +
store the given bencoded data as an immutable item in the DHT.
│ │ │ +the returned hash is the key that is to be used to look the item
│ │ │ +up again. It's just the SHA-1 hash of the bencoded form of the
│ │ │ +structure.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_put_item()
│ │ │ +
│ │ │ +void dht_put_item (std::array<char, 32> key
│ │ │ + , std::function<void(entry&, std::array<char, 64>&
│ │ │ + , std::int64_t&, std::string const&)> cb
│ │ │ + , std::string salt = std::string());
│ │ │ +
│ │ │ +
store a mutable item. The key is the public key the blob is
│ │ │ +to be stored under. The optional salt argument is a string that
│ │ │ +is to be mixed in with the key when determining where in the DHT
│ │ │ +the value is to be stored. The callback function is called from within
│ │ │ +the libtorrent network thread once we've found where to store the blob,
│ │ │ +possibly with the current value stored under the key.
│ │ │ +The values passed to the callback functions are:
│ │ │ +
│ │ │ +- entry& value
│ │ │ +- the current value stored under the key (may be empty). Also expected
│ │ │ +to be set to the value to be stored by the function.
│ │ │ +- std::array<char,64>& signature
│ │ │ +- the signature authenticating the current value. This may be zeros
│ │ │ +if there is currently no value stored. The function is expected to
│ │ │ +fill in this buffer with the signature of the new value to store.
│ │ │ +To generate the signature, you may want to use the
│ │ │ +sign_mutable_item function.
│ │ │ +- std::int64_t& seq
│ │ │ +- current sequence number. May be zero if there is no current value.
│ │ │ +The function is expected to set this to the new sequence number of
│ │ │ +the value that is to be stored. Sequence numbers must be monotonically
│ │ │ +increasing. Attempting to overwrite a value with a lower or equal
│ │ │ +sequence number will fail, even if the signature is correct.
│ │ │ +- std::string const& salt
│ │ │ +- this is the salt that was used for this put call.
│ │ │ +
│ │ │ +
Since the callback function cb is called from within libtorrent,
│ │ │ +it is critical to not perform any blocking operations. Ideally not
│ │ │ +even locking a mutex. Pass any data required for this function along
│ │ │ +with the function object's context and make the function entirely
│ │ │ +self-contained. The only reason data blob's value is computed
│ │ │ +via a function instead of just passing in the new value is to avoid
│ │ │ +race conditions. If you want to update the value in the DHT, you
│ │ │ +must first retrieve it, then modify it, then write it back. The way
│ │ │ +the DHT works, it is natural to always do a lookup before storing and
│ │ │ +calling the callback in between is convenient.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_announce() dht_get_peers()
│ │ │ +
│ │ │ +void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});
│ │ │ +void dht_get_peers (sha1_hash const& info_hash);
│ │ │ +
│ │ │ +
dht_get_peers() will issue a DHT get_peer request to the DHT for the
│ │ │ +specified info-hash. The response (the peers) will be posted back in a
│ │ │ +dht_get_peers_reply_alert.
│ │ │ +
dht_announce() will issue a DHT announce request to the DHT to the
│ │ │ +specified info-hash, advertising the specified port. If the port is
│ │ │ +left at its default, 0, the port will be implied by the DHT message's
│ │ │ +source port (which may improve connectivity through a NAT).
│ │ │ +dht_announce() is not affected by the announce_port override setting.
│ │ │ +
Both these functions are exposed for advanced custom use of the DHT.
│ │ │ +All torrents eligible to be announce to the DHT will be automatically,
│ │ │ +by libtorrent.
│ │ │ +
For possible flags, see announce_flags_t.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_live_nodes()
│ │ │ +
│ │ │ +void dht_live_nodes (sha1_hash const& nid);
│ │ │ +
│ │ │ +
Retrieve all the live DHT (identified by nid) nodes. All the
│ │ │ +nodes id and endpoint will be returned in the list of nodes in the
│ │ │ +alert dht_live_nodes_alert.
│ │ │ +Since this alert is a response to an explicit call, it will always be
│ │ │ +posted, regardless of the alert mask.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_sample_infohashes()
│ │ │ +
│ │ │ +void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);
│ │ │ +
│ │ │ +
Query the DHT node specified by ep to retrieve a sample of the
│ │ │ +info-hashes that the node currently have in their storage.
│ │ │ +The target is included for iterative lookups so that indexing nodes
│ │ │ +can perform a key space traversal with a single RPC per node by adjusting
│ │ │ +the target value for each RPC. It has no effect on the returned sample value.
│ │ │ +The result is posted as a dht_sample_infohashes_alert.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_direct_request()
│ │ │ +
│ │ │ +void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});
│ │ │ +
│ │ │ +
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::function<std::shared_ptr<torrent_plugin>(
│ │ │ + torrent_handle const&, client_data_t)> ext);
│ │ │ +void add_extension (std::shared_ptr<plugin> 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<torrent_plugin>. 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
│ │ │ +directly. Makes it possible to join a swarm with just a tracker and
│ │ │ +info-hash.
│ │ │ +
│ │ │ +
│ │ │ + ses.add_extension(<::create_ut_metadata_plugin);
│ │ │ +
│ │ │ +
│ │ │ +- uTorrent peer exchange
│ │ │ +- Exchanges peers between clients.
│ │ │ +
│ │ │ +
│ │ │ + ses.add_extension(<::create_ut_pex_plugin);
│ │ │ +
│ │ │ +
│ │ │ +- smart ban plugin
│ │ │ +- 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.
│ │ │ +
│ │ │ +
│ │ │ + ses.add_extension(<::create_smart_ban_plugin);
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
get_ip_filter() set_ip_filter()
│ │ │ +
│ │ │ +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.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
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() is_listening() 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);
│ │ │ +ip_filter get_peer_class_filter () const;
│ │ │ +
│ │ │ +
Sets the peer class filter for this session. All new peer connections
│ │ │ +will take this into account and be added to the peer classes specified
│ │ │ +by this filter, based on the peer's IP address.
│ │ │ +
The ip-filter essentially maps an IP -> uint32. Each bit in that 32
│ │ │ +bit integer represents a peer class. The least significant bit
│ │ │ +represents class 0, the next bit class 1 and so on.
│ │ │ +
For more info, see ip_filter.
│ │ │ +
For example, to make all peers in the range 200.1.1.0 - 200.1.255.255
│ │ │ +belong to their own peer class, apply the following filter:
│ │ │ +
│ │ │ +ip_filter f = ses.get_peer_class_filter();
│ │ │ +peer_class_t my_class = ses.create_peer_class("200.1.x.x IP range");
│ │ │ +f.add_rule(make_address("200.1.1.0"), make_address("200.1.255.255")
│ │ │ + , 1 << static_cast<std::uint32_t>(my_class));
│ │ │ +ses.set_peer_class_filter(f);
│ │ │ +
│ │ │ +
This setting only applies to new connections, it won't affect existing
│ │ │ +peer connections.
│ │ │ +
This function is limited to only peer class 0-31, since there are only
│ │ │ +32 bits in the IP range mapping. Only the set bits matter; no peer
│ │ │ +class will be removed from a peer as a result of this call, peer
│ │ │ +classes are only added.
│ │ │ +
The peer_class argument cannot be greater than 31. The bitmasks
│ │ │ +representing peer classes in the peer_class_filter are 32 bits.
│ │ │ +
The get_peer_class_filter() function returns the current filter.
│ │ │ +
For more information, see peer classes.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
set_peer_class_type_filter() get_peer_class_type_filter()
│ │ │ +
│ │ │ +void set_peer_class_type_filter (peer_class_type_filter const& f);
│ │ │ +peer_class_type_filter get_peer_class_type_filter () const;
│ │ │ +
│ │ │ +
Sets and gets the peer class type filter. This is controls automatic
│ │ │ +peer class assignments to peers based on what kind of socket it is.
│ │ │ +
It does not only support assigning peer classes, it also supports
│ │ │ +removing peer classes based on socket type.
│ │ │ +
The order of these rules being applied are:
│ │ │ +
│ │ │ +- peer-class IP filter
│ │ │ +- peer-class type filter, removing classes
│ │ │ +- peer-class type filter, adding classes
│ │ │ +
│ │ │ +
For more information, see peer classes.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
create_peer_class()
│ │ │ +
│ │ │ +peer_class_t create_peer_class (char const* name);
│ │ │ +
│ │ │ +
Creates a new peer class (see peer classes) with the given name. The
│ │ │ +returned integer is the new peer class identifier. Peer classes may
│ │ │ +have the same name, so each invocation of this function creates a new
│ │ │ +class and returns a unique identifier.
│ │ │ +
Identifiers are assigned from low numbers to higher. So if you plan on
│ │ │ +using certain peer classes in a call to set_peer_class_filter(),
│ │ │ +make sure to create those early on, to get low identifiers.
│ │ │ +
For more information on peer classes, see peer classes.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
delete_peer_class()
│ │ │ +
│ │ │ +void delete_peer_class (peer_class_t cid);
│ │ │ +
│ │ │ +
This call dereferences the reference count of the specified peer
│ │ │ +class. When creating a peer class it's automatically referenced by 1.
│ │ │ +If you want to recycle a peer class, you may call this function. You
│ │ │ +may only call this function once per peer class you create.
│ │ │ +Calling it more than once for the same class will lead to memory
│ │ │ +corruption.
│ │ │ +
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]
│ │ │ +
│ │ │ +
get_peer_class() set_peer_class()
│ │ │ +
│ │ │ +peer_class_info get_peer_class (peer_class_t cid) const;
│ │ │ +void set_peer_class (peer_class_t cid, peer_class_info const& pci);
│ │ │ +
│ │ │ +
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 any of its classes is the one that is taken into
│ │ │ +account.
│ │ │ +
For more information, see peer classes.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
remove_torrent()
│ │ │ +
│ │ │ +void remove_torrent (const torrent_handle&, remove_flags_t = {});
│ │ │ +
│ │ │ +
remove_torrent() will close all peer connections associated with
│ │ │ +the torrent and tell the tracker that we've stopped participating in
│ │ │ +the swarm. This operation cannot fail. When it completes, you will
│ │ │ +receive a torrent_removed_alert.
│ │ │ +
remove_torrent() is non-blocking, but will remove the torrent from the
│ │ │ +session synchronously. Calling session_handle::add_torrent() immediately
│ │ │ +afterward with the same torrent will succeed. Note that this creates a
│ │ │ +new handle which is not equal to the removed one.
│ │ │ +
The optional second argument options can be used to delete all the
│ │ │ +files downloaded by this torrent. To do so, pass in the value
│ │ │ +session_handle::delete_files. Once the torrent is deleted, a
│ │ │ +torrent_deleted_alert is posted.
│ │ │ +
The torrent_handle remains valid for some time after remove_torrent() is
│ │ │ +called. It will become invalid only after all libtorrent tasks (such as
│ │ │ +I/O tasks) release their references to the torrent. Until this happens,
│ │ │ +torrent_handle::is_valid() will return true, and other calls such
│ │ │ +as torrent_handle::status() will succeed. Because of this, and because
│ │ │ +remove_torrent() is non-blocking, the following sequence usually
│ │ │ +succeeds (does not throw system_error):
│ │ │ +.. code:: c++
│ │ │ +
│ │ │ +session.remove_handle(handle);
│ │ │ +handle.save_resume_data();
│ │ │ +
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()
│ │ │ +
│ │ │ +void apply_settings (settings_pack const&);
│ │ │ +settings_pack get_settings () const;
│ │ │ +void apply_settings (settings_pack&&);
│ │ │ +
│ │ │ +
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() pop_alerts() wait_for_alert()
│ │ │ +
│ │ │ +void pop_alerts (std::vector<alert*>* alerts);
│ │ │ +alert* wait_for_alert (time_duration max_wait);
│ │ │ +void set_alert_notify (std::function<void()> const& fun);
│ │ │ +
│ │ │ +
Alerts is the main mechanism for libtorrent to report errors and
│ │ │ +events. pop_alerts fills in the vector passed to it with pointers
│ │ │ +to new alerts. The session still owns these alerts and they will stay
│ │ │ +valid until the next time pop_alerts is called. You may not delete
│ │ │ +the alert objects.
│ │ │ +
It is safe to call pop_alerts from multiple different threads, as
│ │ │ +long as the alerts themselves are not accessed once another thread
│ │ │ +calls pop_alerts. Doing this requires manual synchronization
│ │ │ +between the popping threads.
│ │ │ +
wait_for_alert will block the current thread for max_wait time
│ │ │ +duration, or until another alert is posted. If an alert is available
│ │ │ +at the time of the call, it returns immediately. The returned alert
│ │ │ +pointer is the head of the alert queue. wait_for_alert does not
│ │ │ +pop alerts from the queue, it merely peeks at it. The returned alert
│ │ │ +will stay valid until pop_alerts is called twice. The first time
│ │ │ +will pop it and the second will free it.
│ │ │ +
If there is no alert in the queue and no alert arrives within the
│ │ │ +specified timeout, wait_for_alert returns nullptr. If there are
│ │ │ +alerts available to be popped, the non-null pointer that's returned
│ │ │ +is of an unspecified alert.
│ │ │ +
In the python binding, wait_for_alert takes the number of
│ │ │ +milliseconds to wait as an integer.
│ │ │ +
The alert queue in the session will not grow indefinitely. Make sure
│ │ │ +to pop periodically to not miss notifications. To control the max
│ │ │ +number of alerts that's queued by the session, see
│ │ │ +settings_pack::alert_queue_size.
│ │ │ +
Some alerts are considered so important that they are posted even when
│ │ │ +the alert queue is full. Some alerts are considered mandatory and cannot
│ │ │ +be disabled by the alert_mask. For instance,
│ │ │ +save_resume_data_alert and save_resume_data_failed_alert are always
│ │ │ +posted, regardless of the alert mask.
│ │ │ +
To control which alerts are posted, set the alert_mask
│ │ │ +(settings_pack::alert_mask).
│ │ │ +
If the alert queue fills up to the point where alerts are dropped, this
│ │ │ +will be indicated by a alerts_dropped_alert, which contains a bitmask
│ │ │ +of which types of alerts were dropped. Generally it is a good idea to
│ │ │ +make sure the alert queue is large enough, the alert_mask doesn't have
│ │ │ +unnecessary categories enabled and to call pop_alert() frequently, to
│ │ │ +avoid alerts being dropped.
│ │ │ +
the set_alert_notify function lets the client set a function object
│ │ │ +to be invoked every time the alert queue goes from having 0 alerts to
│ │ │ +1 alert. This function is called from within libtorrent, it may be the
│ │ │ +main thread, or it may be from within a user call. The intention of
│ │ │ +of the function is that the client wakes up its main thread, to poll
│ │ │ +for more alerts using pop_alerts(). If the notify function fails
│ │ │ +to do so, it won't be called again, until pop_alerts is called for
│ │ │ +some other reason. For instance, it could signal an eventfd, post a
│ │ │ +message to an HWND or some other main message pump. The actual
│ │ │ +retrieval of 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);
│ │ │ +std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);
│ │ │ +
│ │ │ +
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 = reopen_map_ports);
│ │ │ +
│ │ │ +
Instructs the session to reopen all listen and outgoing sockets.
│ │ │ +
It's useful in the case your platform doesn't support the built in
│ │ │ +IP notifier mechanism, or if you have a better more reliable way to
│ │ │ +detect changes in the IP routing table.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
native_handle()
│ │ │ +
│ │ │ +std::shared_ptr<aux::session_impl> native_handle () const;
│ │ │ +
│ │ │ +
This function is intended only for use by plugins. This type does
│ │ │ +not have a stable API and should be relied on as little as possible.
│ │ │ +
[report issue]
│ │ │ +- save_settings
│ │ │ +- saves settings (i.e. the settings_pack)
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- save_dht_state
│ │ │ +- saves dht state such as nodes and node-id, possibly accelerating
│ │ │ +joining the DHT if provided at next session startup.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- save_extension_state
│ │ │ +- load or save state from plugins
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- save_ip_filter
│ │ │ +- load or save the IP filter set on the session
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- global_peer_class_id tcp_peer_class_id local_peer_class_id
│ │ │ +- built-in peer classes
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- delete_files
│ │ │ +- delete the files belonging to the torrent from disk.
│ │ │ +including the part-file, if there is one
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- delete_partfile
│ │ │ +- delete just the part-file associated with this torrent
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- paused
│ │ │ +- when set, the session will start paused. Call
│ │ │ +session_handle::resume() to start
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- udp tcp
│ │ │ +- 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_buf() read_session_params() write_session_params()
│ │ │ +
Declared in "libtorrent/session_params.hpp"
│ │ │ +
│ │ │ +entry write_session_params (session_params const& sp
│ │ │ + , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ +session_params read_session_params (span<char const> buf
│ │ │ + , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ +std::vector<char> write_session_params_buf (session_params const& sp
│ │ │ + , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ +session_params read_session_params (bdecode_node const& e
│ │ │ + , 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 separately.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
web_seed_entry
│ │ │ +
Declared in "libtorrent/torrent_info.hpp"
│ │ │ +
the web_seed_entry holds information about a web seed (also known
│ │ │ +as URL seed or HTTP seed). It is essentially a URL with some state
│ │ │ +associated with it. For more information, see BEP 17 and BEP 19.
│ │ │ +
│ │ │ +struct web_seed_entry
│ │ │ +{
│ │ │ + bool operator== (web_seed_entry const& e) const;
│ │ │ + bool operator< (web_seed_entry const& e) const;
│ │ │ +
│ │ │ + enum type_t
│ │ │ + {
│ │ │ + url_seed,
│ │ │ + http_seed,
│ │ │ + };
│ │ │ +
│ │ │ + std::string url;
│ │ │ + std::string auth;
│ │ │ + headers_t extra_headers;
│ │ │ + std::uint8_t type;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
operator==()
│ │ │ +
│ │ │ +bool operator== (web_seed_entry const& e) const;
│ │ │ +
│ │ │ +
URL and type comparison
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
operator<()
│ │ │ +
│ │ │ +bool operator< (web_seed_entry const& e) const;
│ │ │ +
│ │ │ +
URL and type less-than comparison
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum type_t
│ │ │ +
Declared in "libtorrent/torrent_info.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │
│ │ │ -| deprecated_123 |
│ │ │ -123 |
│ │ │ +
│ │ │ +
│ │ │ +| url_seed |
│ │ │ +0 |
│ │ │ |
│ │ │
│ │ │ -| deprecated_124 |
│ │ │ -124 |
│ │ │ +
| http_seed |
│ │ │ +1 |
│ │ │ |
│ │ │
│ │ │ -| missing_file_sizes |
│ │ │ -130 |
│ │ │ -The resume data file is missing the file sizes entry |
│ │ │ -
│ │ │ -| no_files_in_resume_data |
│ │ │ -131 |
│ │ │ -The resume data file file sizes entry is empty |
│ │ │ -
│ │ │ -| missing_pieces |
│ │ │ -132 |
│ │ │ -The resume data file is missing the pieces and slots entry |
│ │ │ -
│ │ │ -| mismatching_number_of_files |
│ │ │ -133 |
│ │ │ -The number of files in the resume data does not match the number
│ │ │ -of files in the torrent |
│ │ │ -
│ │ │ -| mismatching_file_size |
│ │ │ -134 |
│ │ │ -One of the files on disk has a different size than in the fast
│ │ │ -resume file |
│ │ │ -
│ │ │ -| mismatching_file_timestamp |
│ │ │ -135 |
│ │ │ -One of the files on disk has a different timestamp than in the
│ │ │ -fast resume file |
│ │ │ -
│ │ │ -| not_a_dictionary |
│ │ │ -136 |
│ │ │ -The resume data file is not a dictionary |
│ │ │ -
│ │ │ -| invalid_blocks_per_piece |
│ │ │ -137 |
│ │ │ -The blocks per piece entry is invalid in the resume data file |
│ │ │ -
│ │ │ -| missing_slots |
│ │ │ -138 |
│ │ │ -The resume file is missing the slots entry, which is required
│ │ │ -for torrents with compact allocation. DEPRECATED |
│ │ │ -
│ │ │ -| too_many_slots |
│ │ │ -139 |
│ │ │ -The resume file contains more slots than the torrent |
│ │ │ -
│ │ │ -| invalid_slot_list |
│ │ │ -140 |
│ │ │ -The slot entry is invalid in the resume data |
│ │ │ -
│ │ │ -| invalid_piece_index |
│ │ │ -141 |
│ │ │ -One index in the slot list is invalid |
│ │ │ -
│ │ │ -| pieces_need_reorder |
│ │ │ -142 |
│ │ │ -The pieces on disk needs to be re-ordered for the specified
│ │ │ -allocation mode. This happens if you specify sparse allocation
│ │ │ -and the files on disk are using compact storage. The pieces needs
│ │ │ -to be moved to their right position. DEPRECATED |
│ │ │ -
│ │ │ -| resume_data_not_modified |
│ │ │ -143 |
│ │ │ -this error is returned when asking to save resume data and
│ │ │ -specifying the flag to only save when there's anything new to save
│ │ │ -(torrent_handle::only_if_modified) and there wasn't anything changed. |
│ │ │ -
│ │ │ -| invalid_save_path |
│ │ │ -144 |
│ │ │ -the save_path in add_torrent_params is not valid |
│ │ │ -
│ │ │ -| http_parse_error |
│ │ │ -150 |
│ │ │ -The HTTP header was not correctly formatted |
│ │ │ -
│ │ │ -| http_missing_location |
│ │ │ -151 |
│ │ │ -The HTTP response was in the 300-399 range but lacked a location
│ │ │ -header |
│ │ │ -
│ │ │ -| http_failed_decompress |
│ │ │ -152 |
│ │ │ -The HTTP response was encoded with gzip or deflate but
│ │ │ -decompressing it failed |
│ │ │ -
│ │ │ -| no_i2p_router |
│ │ │ -160 |
│ │ │ -The URL specified an i2p address, but no i2p router is configured |
│ │ │ -
│ │ │ -| no_i2p_endpoint |
│ │ │ -161 |
│ │ │ -i2p acceptor is not available yet, can't announce without endpoint |
│ │ │ -
│ │ │ -| scrape_not_available |
│ │ │ -170 |
│ │ │ -The tracker URL doesn't support transforming it into a scrape
│ │ │ -URL. i.e. it doesn't contain "announce. |
│ │ │ -
│ │ │ -| invalid_tracker_response |
│ │ │ -171 |
│ │ │ -invalid tracker response |
│ │ │ -
│ │ │ -| invalid_peer_dict |
│ │ │ -172 |
│ │ │ -invalid peer dictionary entry. Not a dictionary |
│ │ │ -
│ │ │ -| tracker_failure |
│ │ │ -173 |
│ │ │ -tracker sent a failure message |
│ │ │ -
│ │ │ -| invalid_files_entry |
│ │ │ -174 |
│ │ │ -missing or invalid files entry |
│ │ │ -
│ │ │ -| invalid_hash_entry |
│ │ │ -175 |
│ │ │ -missing or invalid hash entry |
│ │ │ -
│ │ │ -| invalid_peers_entry |
│ │ │ -176 |
│ │ │ -missing or invalid peers and peers6 entry |
│ │ │ -
│ │ │ -| invalid_tracker_response_length |
│ │ │ -177 |
│ │ │ -UDP tracker response packet has invalid size |
│ │ │ -
│ │ │ -| invalid_tracker_transaction_id |
│ │ │ -178 |
│ │ │ -invalid transaction id in UDP tracker response |
│ │ │ -
│ │ │ -| invalid_tracker_action |
│ │ │ -179 |
│ │ │ -invalid action field in UDP tracker response |
│ │ │ -
│ │ │ -| announce_skipped |
│ │ │ -180 |
│ │ │ -skipped announce (because it's assumed to be unreachable over the
│ │ │ -given source network interface) |
│ │ │ -
│ │ │ -| no_entropy |
│ │ │ -200 |
│ │ │ -random number generation failed |
│ │ │ -
│ │ │ -| ssrf_mitigation |
│ │ │ -201 |
│ │ │ -blocked by SSRF mitigation |
│ │ │ -
│ │ │ -| blocked_by_idna |
│ │ │ -202 |
│ │ │ -blocked because IDNA host names are banned |
│ │ │ -
│ │ │ -| torrent_unknown_version |
│ │ │ -210 |
│ │ │ -the torrent file has an unknown meta version |
│ │ │ -
│ │ │ -| torrent_missing_file_tree |
│ │ │ -211 |
│ │ │ -the v2 torrent file has no file tree |
│ │ │ -
│ │ │ -| torrent_missing_meta_version |
│ │ │ -212 |
│ │ │ -the torrent contains v2 keys but does not specify meta version 2 |
│ │ │ -
│ │ │ -| torrent_inconsistent_files |
│ │ │ -213 |
│ │ │ -the v1 and v2 file metadata does not match |
│ │ │ -
│ │ │ -| torrent_missing_piece_layer |
│ │ │ -214 |
│ │ │ -one or more files are missing piece layer hashes |
│ │ │ -
│ │ │ -| torrent_invalid_piece_layer |
│ │ │ -215 |
│ │ │ -a piece layer has the wrong size or failed hash check |
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- url
│ │ │ +- The URL of the web seed
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- auth
│ │ │ +- Optional authentication. If set, this string is sent verbatim as the
│ │ │ +value of the HTTP Authorization header, and it overrides any
│ │ │ +credentials embedded in the URL. It is not transformed in any way, so
│ │ │ +it must be the complete header value. For HTTP basic authentication
│ │ │ +that means "Basic " followed by the base64 encoding of
│ │ │ +username:password.
│ │ │ +For security, this value (as well as any credentials embedded in the
│ │ │ +URL as "username:password@host") is only sent to the origin of the
│ │ │ +web seed URL. If the web seed responds with a redirect to a different
│ │ │ +origin (a different scheme, host or port), it is not forwarded to
│ │ │ +the new origin.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- extra_headers
│ │ │ +- Any extra HTTP headers that need to be passed to the web seed.
│ │ │ +Warning: unlike auth, these headers are sent verbatim with
│ │ │ +every request, including requests to a different origin that the web
│ │ │ +seed may redirect to. Do not put sensitive credentials (such as an
│ │ │ +Authorization or Cookie header) here unless you trust every
│ │ │ +host the web seed might redirect to.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- type
│ │ │ +- The type of web seed (see type_t)
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
load_torrent_limits
│ │ │ +
Declared in "libtorrent/torrent_info.hpp"
│ │ │ +
this object holds configuration options for limits to use when loading
│ │ │ +torrents. They are meant to prevent loading potentially malicious torrents
│ │ │ +that cause excessive memory allocations.
│ │ │ +
│ │ │ +struct load_torrent_limits
│ │ │ +{
│ │ │ + int max_buffer_size = 10000000;
│ │ │ + int max_pieces = 0x200000;
│ │ │ + int max_decode_depth = 100;
│ │ │ + int max_decode_tokens = 3000000;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- max_buffer_size
│ │ │ +- the max size of a .torrent file to load into RAM
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- max_pieces
│ │ │ +- the max number of pieces allowed in the torrent
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- max_decode_depth
│ │ │ +- the max recursion depth in the bdecoded structure
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- max_decode_tokens
│ │ │ +- 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
│ │ │ +{
│ │ │ + torrent_info (char const* buffer, int size);
│ │ │ + explicit torrent_info (bdecode_node const& torrent_file);
│ │ │ + torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);
│ │ │ + explicit torrent_info (std::string const& filename);
│ │ │ + torrent_info (char const* buffer, int size, error_code& ec);
│ │ │ + torrent_info (torrent_info const& t);
│ │ │ + torrent_info (span<char const> buffer, error_code& ec, from_span_t);
│ │ │ + torrent_info (std::string const& filename, error_code& ec);
│ │ │ + torrent_info (std::string const& filename, load_torrent_limits const& cfg);
│ │ │ + torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);
│ │ │ + explicit torrent_info (info_hash_t const& info_hash);
│ │ │ + torrent_info (bdecode_node const& torrent_file, error_code& ec);
│ │ │ + explicit torrent_info (span<char const> buffer, 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);
│ │ │ + std::vector<announce_entry> const& trackers () const;
│ │ │ + void add_tracker (std::string const& url, int tier
│ │ │ + , announce_entry::tracker_source source);
│ │ │ + void clear_trackers ();
│ │ │ + void add_tracker (std::string const& url, int tier = 0);
│ │ │ + std::vector<std::string> collections () const;
│ │ │ + std::vector<sha1_hash> similar_torrents () const;
│ │ │ + 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::vector<web_seed_entry> const& web_seeds () const;
│ │ │ + void add_url_seed (std::string const& url
│ │ │ + , std::string const& extern_auth = std::string()
│ │ │ + , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());
│ │ │ + void set_web_seeds (std::vector<web_seed_entry> seeds);
│ │ │ + std::int64_t total_size () const;
│ │ │ + int piece_length () const;
│ │ │ + int num_pieces () const;
│ │ │ + int blocks_per_piece () const;
│ │ │ + index_range<piece_index_t> piece_range () const;
│ │ │ + piece_index_t last_piece () const;
│ │ │ + piece_index_t end_piece () 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<file_slice> map_block (piece_index_t const piece
│ │ │ + , std::int64_t offset, int size) const;
│ │ │ + peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;
│ │ │ + string_view ssl_cert () const;
│ │ │ + bool is_valid () const;
│ │ │ + bool priv () const;
│ │ │ + bool is_i2p () const;
│ │ │ + int piece_size (piece_index_t index) const;
│ │ │ + int piece_size_for_req (piece_index_t index) const;
│ │ │ + sha1_hash hash_for_piece (piece_index_t index) const;
│ │ │ + char const* hash_for_piece_ptr (piece_index_t const index) const;
│ │ │ + bool is_loaded () const;
│ │ │ + const std::string& name () const;
│ │ │ + std::time_t creation_date () const;
│ │ │ + const std::string& creator () const;
│ │ │ + const std::string& comment () const;
│ │ │ + std::vector<std::pair<std::string, int>> const& nodes () const;
│ │ │ + void add_node (std::pair<std::string, int> const& node);
│ │ │ + bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);
│ │ │ + bdecode_node info (char const* key) const;
│ │ │ + span<char const> info_section () const;
│ │ │ + span<char const> piece_layer (file_index_t) const;
│ │ │ + void free_piece_layers ();
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
torrent_info()
│ │ │ +
│ │ │ +torrent_info (char const* buffer, int size);
│ │ │ +explicit torrent_info (bdecode_node const& torrent_file);
│ │ │ +torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);
│ │ │ +explicit torrent_info (std::string const& filename);
│ │ │ +torrent_info (char const* buffer, int size, error_code& ec);
│ │ │ +torrent_info (torrent_info const& t);
│ │ │ +torrent_info (span<char const> buffer, error_code& ec, from_span_t);
│ │ │ +torrent_info (std::string const& filename, error_code& ec);
│ │ │ +torrent_info (std::string const& filename, load_torrent_limits const& cfg);
│ │ │ +torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);
│ │ │ +explicit torrent_info (info_hash_t const& info_hash);
│ │ │ +torrent_info (bdecode_node const& torrent_file, error_code& ec);
│ │ │ +explicit torrent_info (span<char const> buffer, 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 into a bdecode_node, use bdecode().
│ │ │ +
The version that takes a buffer pointer and a size will decode it as a
│ │ │ +.torrent file and initialize the torrent_info object for you.
│ │ │ +
The version that takes a filename will simply load the torrent file
│ │ │ +and decode it inside the constructor, for convenience. This might not
│ │ │ +be the most suitable for applications that want to be able to report
│ │ │ +detailed errors on what might go wrong.
│ │ │ +
There is an upper limit on the size of the torrent file that will be
│ │ │ +loaded by the overload taking a filename. If it's important that even
│ │ │ +very large torrent files are loaded, use one of the other overloads.
│ │ │ +
The overloads that takes an error_code const& never throws if an
│ │ │ +error occur, they will simply set the error code to describe what went
│ │ │ +wrong and not fully initialize the torrent_info object. The overloads
│ │ │ +that do not take the extra error_code parameter will always throw if
│ │ │ +an error occurs. These overloads are not available when building
│ │ │ +without exception support.
│ │ │ +
The overload that takes a span also needs an extra parameter of
│ │ │ +type 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]
│ │ │ +
│ │ │ +
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 file.
│ │ │ +
orig_files() returns the original (unmodified) file storage for
│ │ │ +this torrent. This is used by the web server connection, which needs
│ │ │ +to request files with the original names. Filename may be changed using
│ │ │ +torrent_info::rename_file().
│ │ │ +
For more information on the file_storage object, see the separate
│ │ │ +document on how to create torrents.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
rename_file()
│ │ │ +
│ │ │ +void rename_file (file_index_t index, std::string const& new_filename);
│ │ │ +
│ │ │ +
Renames the file with the specified index to the new name. The new
│ │ │ +filename is reflected by the file_storage returned by files()
│ │ │ +but not by the one returned by orig_files().
│ │ │ +
If you want to rename the base name of the torrent (for a multi file
│ │ │ +torrent), you can copy the file_storage (see files() and
│ │ │ +orig_files() ), change the name, and then use remap_files().
│ │ │ +
The new_filename can both be a relative path, in which case the
│ │ │ +file name is relative to the save_path of the torrent. If the
│ │ │ +new_filename is an absolute path (i.e. is_complete(new_filename)
│ │ │ +== true), then the file is detached from the save_path of the
│ │ │ +torrent. In this case the file is not moved when move_storage() is
│ │ │ +invoked.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
remap_files()
│ │ │ +
│ │ │ +void remap_files (file_storage const& f);
│ │ │ +
│ │ │ +
│ │ │ +
Warning
│ │ │ +
Using remap_files() is discouraged as it's incompatible with v2
│ │ │ +torrents. This is because the piece boundaries and piece hashes in
│ │ │ +v2 torrents are intimately tied to the file boundaries. Instead,
│ │ │ +just rename individual files, or implement a custom disk_interface
│ │ │ +to customize how to store files.
│ │ │ +
│ │ │ +
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()
│ │ │ +
│ │ │ +std::vector<announce_entry> const& trackers () const;
│ │ │ +void add_tracker (std::string const& url, int tier
│ │ │ + , announce_entry::tracker_source source);
│ │ │ +void clear_trackers ();
│ │ │ +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]
│ │ │ +
│ │ │ +
similar_torrents() collections()
│ │ │ +
│ │ │ +std::vector<std::string> collections () const;
│ │ │ +std::vector<sha1_hash> 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]
│ │ │ +
│ │ │ +
add_http_seed() web_seeds() add_url_seed() set_web_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::vector<web_seed_entry> const& web_seeds () const;
│ │ │ +void add_url_seed (std::string const& url
│ │ │ + , std::string const& extern_auth = std::string()
│ │ │ + , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());
│ │ │ +void set_web_seeds (std::vector<web_seed_entry> seeds);
│ │ │ +
│ │ │ +
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.
│ │ │ +
set_web_seeds() replaces all web seeds with the ones specified in
│ │ │ +the seeds vector.
│ │ │ +
The extern_auth argument sets the auth field of the
│ │ │ +web_seed_entry. If set, it overrides any username and password found
│ │ │ +in the URL itself, and it is sent verbatim as the value of the HTTP
│ │ │ +Authorization header (it is not transformed in any way). For HTTP
│ │ │ +basic authentication the value must therefore be "Basic " followed
│ │ │ +by the base64 encoding of username:password. See web_seed_entry
│ │ │ +for the security implications of this field across redirects.
│ │ │ +
The extra_headers argument defaults to an empty list, but can be
│ │ │ +used to insert custom HTTP headers in the requests to a specific web
│ │ │ +seed.
│ │ │ +
See http seeding for more information.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
total_size()
│ │ │ +
│ │ │ +std::int64_t total_size () const;
│ │ │ +
│ │ │ +
total_size() returns the total number of bytes the torrent-file
│ │ │ +represents. Note that this is the number of pieces times the piece
│ │ │ +size (modulo the last piece possibly being smaller). With pad files,
│ │ │ +the total size will be larger than the sum of all (regular) file
│ │ │ +sizes.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_length() num_pieces()
│ │ │ +
│ │ │ +int piece_length () const;
│ │ │ +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]
│ │ │ +
│ │ │ +
blocks_per_piece()
│ │ │ +
│ │ │ +int blocks_per_piece () const;
│ │ │ +
│ │ │ +
returns the number of blocks there are in the typical piece. There
│ │ │ +may be fewer in the last piece)
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_range() end_piece() last_piece()
│ │ │ +
│ │ │ +index_range<piece_index_t> piece_range () const;
│ │ │ +piece_index_t last_piece () const;
│ │ │ +piece_index_t end_piece () 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]
│ │ │ +
│ │ │ +
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()
│ │ │ +
│ │ │ +int num_files () const;
│ │ │ +
│ │ │ +
If you need index-access to files you can use the num_files() along
│ │ │ +with the file_path(), file_size()-family of functions to access
│ │ │ +files using indices.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
map_block()
│ │ │ +
│ │ │ +std::vector<file_slice> map_block (piece_index_t const piece
│ │ │ + , std::int64_t offset, int size) const;
│ │ │ +
│ │ │ +
This function will map a piece index, a byte offset within that piece
│ │ │ +and a size (in bytes) into the corresponding files with offsets where
│ │ │ +that data for that piece is supposed to be stored. See file_slice.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
map_file()
│ │ │ +
│ │ │ +peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;
│ │ │ +
│ │ │ +
This function will map a range in a specific file into a range in the
│ │ │ +torrent. The file_offset parameter is the offset in the file,
│ │ │ +given in bytes, where 0 is the start of the file. See peer_request.
│ │ │ +
The input range is assumed to be valid within the torrent.
│ │ │ +file_offset + size is not allowed to be greater than the file
│ │ │ +size. file_index must refer to a valid file, i.e. it cannot be >=
│ │ │ +num_files().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
ssl_cert()
│ │ │ +
│ │ │ +string_view ssl_cert () const;
│ │ │ +
│ │ │ +
Returns the SSL root certificate for the torrent, if it is an SSL
│ │ │ +torrent. Otherwise returns an empty string. The certificate is
│ │ │ +the public certificate in x509 format.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
is_valid()
│ │ │ +
│ │ │ +bool is_valid () const;
│ │ │ +
│ │ │ +
returns true if this torrent_info object has a torrent loaded.
│ │ │ +This is primarily used to determine if a magnet link has had its
│ │ │ +metadata resolved yet or not.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
priv()
│ │ │ +
│ │ │ +bool priv () const;
│ │ │ +
│ │ │ +
returns true if this torrent is private. i.e., the client should not
│ │ │ +advertise itself on the trackerless network (the Kademlia DHT) for this torrent.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
is_i2p()
│ │ │ +
│ │ │ +bool is_i2p () const;
│ │ │ +
│ │ │ +
returns true if this is an i2p torrent. This is determined by whether
│ │ │ +or not it has a tracker whose URL domain name ends with ".i2p". i2p
│ │ │ +torrents disable the DHT and local peer discovery as well as talking
│ │ │ +to peers over anything other 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]
│ │ │ +
│ │ │ +
piece_size_for_req()
│ │ │ +
│ │ │ +int piece_size_for_req (piece_index_t index) const;
│ │ │ +
│ │ │ +
returns the piece size appropriate for computing request lengths.
│ │ │ +for v2-only torrents, pieces at the end of files may be shorter than
│ │ │ +the main piece size. For v1 and hybrid torrents, piece sizes must be
│ │ │ +full (except for the last piece) in order to correctly compute the
│ │ │ +piece hash.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
hash_for_piece_ptr() hash_for_piece()
│ │ │ +
│ │ │ +sha1_hash hash_for_piece (piece_index_t index) const;
│ │ │ +char const* hash_for_piece_ptr (piece_index_t const 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]
│ │ │ +
│ │ │ +
name()
│ │ │ +
│ │ │ +const std::string& name () const;
│ │ │ +
│ │ │ +
name() returns the name of the torrent.
│ │ │ +name contains UTF-8 encoded string.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
creator()
│ │ │ +
│ │ │ +const std::string& creator () const;
│ │ │ +
│ │ │ +
creator() returns the creator string in the torrent. If there is
│ │ │ +no creator string it will return an empty string.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
nodes()
│ │ │ +
│ │ │ +std::vector<std::pair<std::string, int>> const& nodes () const;
│ │ │ +
│ │ │ +
If this torrent contains any DHT nodes, they are put in this vector in
│ │ │ +their original form (host name and port number).
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
add_node()
│ │ │ +
│ │ │ +void add_node (std::pair<std::string, int> const& node);
│ │ │ +
│ │ │ +
This is used when creating torrent. Use this to add a known DHT node.
│ │ │ +It may be used, by the client, to bootstrap into the DHT network.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
parse_info_section()
│ │ │ +
│ │ │ +bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);
│ │ │ +
│ │ │ +
populates the torrent_info by providing just the info-dict buffer.
│ │ │ +This is used when loading a torrent from a magnet link for instance,
│ │ │ +where we only have the info-dict. The bdecode_node e points to a
│ │ │ +parsed info-dictionary. ec returns an error code if something
│ │ │ +fails (typically if the info dictionary is malformed).
│ │ │ +The max_pieces parameter allows limiting the amount of memory
│ │ │ +dedicated to loading the torrent, and fails for torrents that exceed
│ │ │ +the limit. To load large torrents, this limit may also need to be
│ │ │ +raised in settings_pack::max_piece_count and in calls to
│ │ │ +read_resume_data().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
info()
│ │ │ +
│ │ │ +bdecode_node info (char const* key) const;
│ │ │ +
│ │ │ +
This function looks up keys from the info-dictionary of the loaded
│ │ │ +torrent file. It can be used to access extension values put in the
│ │ │ +.torrent file. If the specified key cannot be found, it returns nullptr.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
info_section()
│ │ │ +
│ │ │ +span<char const> info_section () const;
│ │ │ +
│ │ │ +
returns a the raw info section of the torrent file.
│ │ │ +The underlying buffer is still owned by the torrent_info object
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_layer()
│ │ │ +
│ │ │ +span<char const> piece_layer (file_index_t) const;
│ │ │ +
│ │ │ +
return the bytes of the piece layer hashes for the specified file. If
│ │ │ +the file doesn't have a piece layer, an empty span is returned.
│ │ │ +The span size is divisible by 32, the size of a SHA-256 hash.
│ │ │ +If the size of the file is smaller than or equal to the piece size,
│ │ │ +the files "root hash" is the hash of the file and is not saved
│ │ │ +separately in the "piece layers" field, but this function still
│ │ │ +returns the root hash of the file in that case.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
free_piece_layers()
│ │ │ +
│ │ │ +void free_piece_layers ();
│ │ │ +
│ │ │ +
clears the piece layers from the torrent_info. This is done by the
│ │ │ +session when a torrent is added, to avoid storing it twice. The piece
│ │ │ +layer (or other hashes part of the merkle tree) are stored in the
│ │ │ +internal torrent object.
│ │ │ +
[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);
│ │ │ +
│ │ │ + enum block_state_t
│ │ │ + {
│ │ │ + none,
│ │ │ + requested,
│ │ │ + writing,
│ │ │ + finished,
│ │ │ + };
│ │ │ +
│ │ │ + unsigned bytes_progress:15;
│ │ │ + unsigned block_size:15;
│ │ │ + unsigned state:2;
│ │ │ + unsigned num_peers:14;
│ │ │ +};
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
set_peer() peer()
│ │ │ +
│ │ │ +tcp::endpoint peer () const;
│ │ │ +void set_peer (tcp::endpoint const& ep);
│ │ │ +
│ │ │ +
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 |
│ │ │
│ │ │ -| torrent_missing_pieces_root |
│ │ │ -216 |
│ │ │ -a v2 file entry has no root hash |
│ │ │ +
│ │ │ +
│ │ │ +| none |
│ │ │ +0 |
│ │ │ +This block has not been downloaded or requested form any peer. |
│ │ │
│ │ │ -| torrent_inconsistent_hashes |
│ │ │ -217 |
│ │ │ -the v1 and v2 hashes do not describe the same data |
│ │ │ +
| requested |
│ │ │ +1 |
│ │ │ +The block has been requested, but not completely downloaded yet. |
│ │ │
│ │ │ -| torrent_invalid_pad_file |
│ │ │ -218 |
│ │ │ -a file in the v2 metadata has the pad attribute set |
│ │ │ +
| writing |
│ │ │ +2 |
│ │ │ +The block has been downloaded and is currently queued for being
│ │ │ +written to disk. |
│ │ │
│ │ │ -| error_code_max |
│ │ │ -219 |
│ │ │ -the number of error codes |
│ │ │ +
| finished |
│ │ │ +3 |
│ │ │ +The block has been written to disk. |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum http_errors
│ │ │ -
Declared in "libtorrent/error_code.hpp"
│ │ │ +
[report issue]
│ │ │ +- bytes_progress
│ │ │ +- the number of bytes that have been received for this block
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- block_size
│ │ │ +- the total number of bytes in this block.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- state
│ │ │ +- the state this block is in (see block_state_t)
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_peers
│ │ │ +- the number of peers that is currently requesting this block. Typically
│ │ │ +this is 0 or 1, but at the end of the torrent blocks may be requested
│ │ │ +by more peers in parallel to speed things up.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
partial_piece_info
│ │ │ +
Declared in "libtorrent/torrent_handle.hpp"
│ │ │ +
This class holds information about pieces that have outstanding requests
│ │ │ +or outstanding writes
│ │ │ +
│ │ │ +struct partial_piece_info
│ │ │ +{
│ │ │ + piece_index_t piece_index;
│ │ │ + int blocks_in_piece;
│ │ │ + int finished;
│ │ │ + int writing;
│ │ │ + int requested;
│ │ │ + block_info const* blocks;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- piece_index
│ │ │ +- the index of the piece in question. blocks_in_piece is the number
│ │ │ +of blocks in this particular piece. This number will be the same for
│ │ │ +most pieces, but
│ │ │ +the last piece may have fewer blocks than the standard pieces.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- blocks_in_piece
│ │ │ +- the number of blocks in this piece
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- finished
│ │ │ +- the number of blocks that are in the finished state
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- writing
│ │ │ +- the number of blocks that are in the writing state
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- requested
│ │ │ +- the number of blocks that are in the requested state
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- blocks
│ │ │ +this is an array of blocks_in_piece number of
│ │ │ +items. One for each block in the piece.
│ │ │ +
│ │ │ +
Warning
│ │ │ +
This is a pointer that points to an array
│ │ │ +that's owned by the session object. The next time
│ │ │ +get_download_queue() is called, it will be invalidated.
│ │ │ +In the case of piece_info_alert, these pointers point into the alert
│ │ │ +object itself, and will be invalidated when the alert destruct.
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
torrent_handle
│ │ │ +
Declared in "libtorrent/torrent_handle.hpp"
│ │ │ +
You will usually have to store your torrent handles somewhere, since it's
│ │ │ +the object through which you retrieve information about the torrent and
│ │ │ +aborts the torrent.
│ │ │ +
│ │ │ +
Warning
│ │ │ +
Any member function that returns a value or fills in a value has to be
│ │ │ +made synchronously. This means it has to wait for the main thread to
│ │ │ +complete the query before it can return. This might potentially be
│ │ │ +expensive if done from within a GUI thread that needs to stay
│ │ │ +responsive. Try to avoid querying for information you don't need, and
│ │ │ +try to do it in as few calls as possible. You can get most of the
│ │ │ +interesting information about a torrent from the
│ │ │ +torrent_handle::status() call.
│ │ │ +
│ │ │ +
The default constructor will initialize the handle to an invalid state.
│ │ │ +Which means you cannot perform any operation on it, unless you first
│ │ │ +assign it a valid handle. If you try to perform any operation on an
│ │ │ +uninitialized handle, it will throw invalid_handle.
│ │ │ +
│ │ │ +
Warning
│ │ │ +
All operations on a torrent_handle may throw system_error
│ │ │ +exception, in case the handle is no longer referring to a torrent.
│ │ │ +There is one exception is_valid() will never throw. Since the torrents
│ │ │ +are processed by a background thread, there is no guarantee that a
│ │ │ +handle will remain valid between two calls.
│ │ │ +
│ │ │ +
│ │ │ +struct torrent_handle
│ │ │ +{
│ │ │ + friend std::size_t hash_value (torrent_handle const& th);
│ │ │ + 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;
│ │ │ + void post_peer_info () const;
│ │ │ + void post_status (status_flags_t flags = status_flags_t::all()) const;
│ │ │ + torrent_status status (status_flags_t flags = status_flags_t::all()) const;
│ │ │ + void post_download_queue () const;
│ │ │ + void get_download_queue (std::vector<partial_piece_info>& queue) const;
│ │ │ + std::vector<partial_piece_info> get_download_queue () const;
│ │ │ + void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;
│ │ │ + void reset_piece_deadline (piece_index_t index) const;
│ │ │ + void clear_piece_deadlines () const;
│ │ │ + std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;
│ │ │ + void post_file_progress (file_progress_flags_t flags) const;
│ │ │ + void file_progress (std::vector<std::int64_t>& 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;
│ │ │ + std::vector<announce_entry> trackers () const;
│ │ │ + void add_tracker (announce_entry const&) const;
│ │ │ + void post_trackers () const;
│ │ │ + void add_url_seed (std::string const& url) const;
│ │ │ + void remove_url_seed (std::string const& url) const;
│ │ │ + std::set<std::string> url_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;
│ │ │ + 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;
│ │ │ + add_torrent_params get_resume_data (resume_data_flags_t flags = {}) const;
│ │ │ + void save_resume_data (resume_data_flags_t flags = {}) const;
│ │ │ + bool need_save_resume_data () const;
│ │ │ + bool need_save_resume_data (resume_data_flags_t flags) const;
│ │ │ + void queue_position_down () const;
│ │ │ + queue_position_t queue_position () const;
│ │ │ + void queue_position_top () const;
│ │ │ + void queue_position_bottom () const;
│ │ │ + void queue_position_up () const;
│ │ │ + void queue_position_set (queue_position_t p) const;
│ │ │ + 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<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 post_piece_availability () const;
│ │ │ + void piece_availability (std::vector<int>& avail) const;
│ │ │ + void piece_priority (piece_index_t index, download_priority_t priority) const;
│ │ │ + void prioritize_pieces (std::vector<download_priority_t> const& pieces) 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 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_dht_announce () const;
│ │ │ + void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;
│ │ │ + void force_lsd_announce () const;
│ │ │ + void scrape_tracker (int idx = -1) const;
│ │ │ + int download_limit () const;
│ │ │ + void set_download_limit (int limit) const;
│ │ │ + void set_upload_limit (int limit) const;
│ │ │ + int upload_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;
│ │ │ + 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;
│ │ │ + static constexpr status_flags_t query_accurate_download_counters = 1_bit;
│ │ │ + static constexpr status_flags_t query_last_seen_complete = 2_bit;
│ │ │ + static constexpr status_flags_t query_pieces = 3_bit;
│ │ │ + static constexpr status_flags_t query_verified_pieces = 4_bit;
│ │ │ + static constexpr status_flags_t query_torrent_file = 5_bit;
│ │ │ + static constexpr status_flags_t query_name = 6_bit;
│ │ │ + static constexpr status_flags_t query_save_path = 7_bit;
│ │ │ + static constexpr deadline_flags_t alert_when_available = 0_bit;
│ │ │ + static constexpr file_progress_flags_t piece_granularity = 0_bit;
│ │ │ + static constexpr pause_flags_t graceful_pause = 0_bit;
│ │ │ + static constexpr resume_data_flags_t flush_disk_cache = 0_bit;
│ │ │ + static constexpr resume_data_flags_t save_info_dict = 1_bit;
│ │ │ + static constexpr resume_data_flags_t only_if_modified = 2_bit;
│ │ │ + static constexpr resume_data_flags_t if_counters_changed = 3_bit;
│ │ │ + static constexpr resume_data_flags_t if_download_progress = 4_bit;
│ │ │ + static constexpr resume_data_flags_t if_config_changed = 5_bit;
│ │ │ + static constexpr resume_data_flags_t if_state_changed = 6_bit;
│ │ │ + static constexpr resume_data_flags_t if_metadata_changed = 7_bit;
│ │ │ + static constexpr reannounce_flags_t ignore_min_interval = 0_bit;
│ │ │ + static constexpr reannounce_flags_t high_priority = 1_bit;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
torrent_handle()
│ │ │ +
│ │ │ +torrent_handle () noexcept = default;
│ │ │ +
│ │ │ +
constructs a torrent handle that does not refer to a torrent.
│ │ │ +i.e. is_valid() will return false.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
add_piece()
│ │ │ +
│ │ │ +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;
│ │ │ +
│ │ │ +
This function will write data to the storage as piece piece,
│ │ │ +as if it had been downloaded from a peer.
│ │ │ +
By default, data that's already been downloaded is not overwritten by
│ │ │ +this buffer. If you trust this data to be correct (and pass the piece
│ │ │ +hash check) you may pass the overwrite_existing flag. This will
│ │ │ +instruct libtorrent to overwrite any data that may already have been
│ │ │ +downloaded with this data.
│ │ │ +
Since the data is written asynchronously, you may know that is passed
│ │ │ +or failed the hash check by waiting for piece_finished_alert or
│ │ │ +hash_failed_alert.
│ │ │ +
Adding pieces while the torrent is being checked (i.e. in
│ │ │ +torrent_status::checking_files state) is not supported.
│ │ │ +
The overload taking a raw pointer to the data is a blocking call. It
│ │ │ +won't return until the libtorrent thread has copied the data into its
│ │ │ +disk write buffer. data is expected to point to a buffer of as
│ │ │ +many bytes as the size of the specified piece.
│ │ │ +For v2-only torrents, pieces at the end of files may not be full sized.
│ │ │ +
The data in the buffer is copied and passed on to the disk IO thread
│ │ │ +to be written at some later point in time.
│ │ │ +
The overload taking a std::vector<char> is not blocking, it will
│ │ │ +send the buffer to the main thread and return immediately.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
read_piece()
│ │ │ +
│ │ │ +void read_piece (piece_index_t piece) const;
│ │ │ +
│ │ │ +
This function starts an asynchronous read operation of the specified
│ │ │ +piece from this torrent. You must have completed the download of the
│ │ │ +specified piece before calling this function.
│ │ │ +
When the read operation is completed, it is passed back through an
│ │ │ +alert, read_piece_alert. Since this alert is a response to an explicit
│ │ │ +call, it will always be posted, regardless of the alert mask.
│ │ │ +
│ │ │ +
Note
│ │ │ +
that if you read multiple pieces, the read operations are not
│ │ │ +guaranteed to finish in the same order as you initiated them.
│ │ │ +
│ │ │ +
│ │ │ +
Note
│ │ │ +
the size of the buffer passed back in the alert is not
│ │ │ +necessarily piece_length() long. The last piece or pieces at the end
│ │ │ +of files (in v2 and hybrid torrents) are not full size.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
have_piece()
│ │ │ +
│ │ │ +bool have_piece (piece_index_t piece) const;
│ │ │ +
│ │ │ +
Returns true if this piece has been completely downloaded and written
│ │ │ +to disk, and false otherwise.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
get_peer_info() post_peer_info()
│ │ │ +
│ │ │ +void get_peer_info (std::vector<peer_info>& v) const;
│ │ │ +void post_peer_info () const;
│ │ │ +
│ │ │ +
Query information about connected peers for this torrent. If the
│ │ │ +torrent_handle is invalid, it will throw a system_error exception.
│ │ │ +
post_peer_info() is asynchronous and will trigger the posting of
│ │ │ +a peer_info_alert. The alert contain a list of peer_info objects, one
│ │ │ +for each connected peer.
│ │ │ +
get_peer_info() is synchronous and takes a reference to a vector
│ │ │ +that will be cleared and filled with one entry for each peer
│ │ │ +connected to this torrent, given the handle is valid. Each entry in
│ │ │ +the vector contains information about that particular peer. See
│ │ │ +peer_info.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
status() post_status()
│ │ │ +
│ │ │ +void post_status (status_flags_t flags = status_flags_t::all()) const;
│ │ │ +torrent_status status (status_flags_t flags = status_flags_t::all()) const;
│ │ │ +
│ │ │ +
status() will return a structure with information about the status
│ │ │ +of this torrent. If the torrent_handle is invalid, it will throw
│ │ │ +system_error exception. See torrent_status. The flags
│ │ │ +argument filters what information is 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.
│ │ │ +
The status() function will block until the internal libtorrent
│ │ │ +thread responds with the torrent_status object. To avoid blocking,
│ │ │ +instead call post_status(). It will trigger posting of a
│ │ │ +state_update_alert with a single torrent_status object for this
│ │ │ +torrent.
│ │ │ +
In order to get regular updates for torrents whose status changes,
│ │ │ +consider calling session::post_torrent_updates()`` instead.
│ │ │ +
By default everything is included. The flags you can use to decide
│ │ │ +what to include are defined in this class.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
post_download_queue() get_download_queue()
│ │ │ +
│ │ │ +void post_download_queue () const;
│ │ │ +void get_download_queue (std::vector<partial_piece_info>& queue) const;
│ │ │ +std::vector<partial_piece_info> get_download_queue () const;
│ │ │ +
│ │ │ +
post_download_queue() triggers a download_queue_alert to be
│ │ │ +posted.
│ │ │ +get_download_queue() is a synchronous call and 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.
│ │ │ +
│ │ │ +
Warning
│ │ │ +
get_download_queue() is prone to threading errors. The
│ │ │ +block_info pointers its return value points to are owned by the
│ │ │ +session and will be cleared the next time get_download_queue()
│ │ │ +is called. Therefore it's not safe to call this function from
│ │ │ +multiple threads. Using post_download_queue() is a safe
│ │ │ +alternative.
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
set_piece_deadline() reset_piece_deadline() clear_piece_deadlines()
│ │ │ +
│ │ │ +void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) 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, unless the alert_when_available flag is set, in which case it
│ │ │ +will have the same effect as calling read_piece() for index.
│ │ │ +
deadline is the number of milliseconds until this piece should be
│ │ │ +completed.
│ │ │ +
reset_piece_deadline removes the deadline from the piece. If it
│ │ │ +hasn't already been downloaded, it will no longer be considered a
│ │ │ +priority.
│ │ │ +
clear_piece_deadlines() removes deadlines on all pieces in
│ │ │ +the torrent. As if reset_piece_deadline() was called on all pieces.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
post_file_progress() file_progress()
│ │ │ +
│ │ │ +std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;
│ │ │ +void post_file_progress (file_progress_flags_t flags) const;
│ │ │ +void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;
│ │ │ +
│ │ │ +
This function fills in the supplied vector, or returns a vector, with
│ │ │ +the number of bytes downloaded of each file in this torrent. The
│ │ │ +progress values are ordered the same as the files in the
│ │ │ +torrent_info.
│ │ │ +
This operation is not very cheap. Its complexity is O(n + mj).
│ │ │ +Where n is the number of files, m is the number of currently
│ │ │ +downloading pieces and j is the number of blocks in a piece.
│ │ │ +
The flags parameter can be used to specify the granularity of the
│ │ │ +file progress. If left at the default value of 0, the progress will be
│ │ │ +as accurate as possible, but also more expensive to calculate. If
│ │ │ +torrent_handle::piece_granularity is specified, the progress will
│ │ │ +be specified in piece granularity. i.e. only pieces that have been
│ │ │ +fully downloaded and passed the hash check count. When specifying
│ │ │ +piece granularity, the operation is a lot cheaper, since libtorrent
│ │ │ +already keeps track of this internally and no calculation is required.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_status()
│ │ │ +
│ │ │ +std::vector<open_file_state> file_status () const;
│ │ │ +
│ │ │ +
This function returns a vector with status about files
│ │ │ +that are open for this torrent. Any file that is not open
│ │ │ +will not be reported in the vector, i.e. it's possible that
│ │ │ +the vector is empty when returning, if none of the files in the
│ │ │ +torrent are currently open.
│ │ │ +
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]
│ │ │ +
│ │ │ +
trackers() post_trackers() add_tracker() replace_trackers()
│ │ │ +
│ │ │ +void replace_trackers (std::vector<announce_entry> const&) const;
│ │ │ +std::vector<announce_entry> trackers () const;
│ │ │ +void add_tracker (announce_entry const&) const;
│ │ │ +void post_trackers () const;
│ │ │ +
│ │ │ +
trackers() returns 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, you have to call force_reannounce(). See
│ │ │ +announce_entry.
│ │ │ +
post_trackers() is the asynchronous version of trackers(). It
│ │ │ +will trigger a tracker_list_alert to be posted.
│ │ │ +
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]
│ │ │ +
│ │ │ +
remove_url_seed() add_url_seed() url_seeds()
│ │ │ +
│ │ │ +void add_url_seed (std::string const& url) const;
│ │ │ +void remove_url_seed (std::string const& url) const;
│ │ │ +std::set<std::string> url_seeds () 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]
│ │ │ +
│ │ │ +
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<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()
│ │ │ +
│ │ │ +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{});
│ │ │ +
│ │ │ +
add the specified extension to this torrent. The ext argument is
│ │ │ +a function that will be called from within libtorrent's context
│ │ │ +passing in the internal torrent object and the specified userdata
│ │ │ +pointer. The function is expected to return a shared pointer to
│ │ │ +a torrent_plugin instance.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
is_valid()
│ │ │ +
│ │ │ +bool is_valid () const;
│ │ │ +
│ │ │ +
Returns true if this handle refers to a valid torrent and false if it
│ │ │ +hasn't been initialized or if the torrent it refers to has been
│ │ │ +removed from the session AND destructed.
│ │ │ +
To tell if the torrent_handle is in the session, use
│ │ │ +torrent_handle::in_session(). This will return true before
│ │ │ +session_handle::remove_torrent() is called, and false
│ │ │ +afterward.
│ │ │ +
Clients should only use is_valid() to determine if the result of
│ │ │ +session::find_torrent() was successful.
│ │ │ +
Unlike other member functions which return a value, is_valid()
│ │ │ +completes immediately, without blocking on a result from the
│ │ │ +network thread. Also unlike other functions, it never throws
│ │ │ +the system_error exception.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
pause() resume()
│ │ │ +
│ │ │ +void resume () const;
│ │ │ +void pause (pause_flags_t flags = {}) const;
│ │ │ +
│ │ │ +
pause(), and resume() will disconnect all peers and reconnect
│ │ │ +all peers respectively. When a torrent is paused, it will however
│ │ │ +remember all share ratios to all peers and remember all potential (not
│ │ │ +connected) peers. Torrents may be paused automatically if there is a
│ │ │ +file error (e.g. disk full) or something similar. See
│ │ │ +file_error_alert.
│ │ │ +
For possible values of the flags parameter, see pause_flags_t.
│ │ │ +
To know if a torrent is paused or not, call
│ │ │ +torrent_handle::flags() and check for the
│ │ │ +torrent_status::paused flag.
│ │ │ +
│ │ │ +
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()
│ │ │ +
│ │ │ +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.
│ │ │ +
The seed_mode flag is special, it can only be cleared once the
│ │ │ +torrent has been added, and it can only be set as part of the
│ │ │ +add_torrent_params flags, when adding the torrent.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
flush_cache()
│ │ │ +
│ │ │ +void flush_cache () const;
│ │ │ +
│ │ │ +
Instructs libtorrent to flush all the disk caches for this torrent and
│ │ │ +close all file handles. This is done asynchronously and you will be
│ │ │ +notified that it's complete through cache_flushed_alert.
│ │ │ +
Note that by the time you get the alert, libtorrent may have cached
│ │ │ +more data for the torrent, but you are guaranteed that whatever cached
│ │ │ +data libtorrent had by the time you called
│ │ │ +torrent_handle::flush_cache() has been written to disk.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
force_recheck()
│ │ │ +
│ │ │ +void force_recheck () const;
│ │ │ +
│ │ │ +
force_recheck puts the torrent back in a state where it assumes to
│ │ │ +have no resume data. All peers will be disconnected and the torrent
│ │ │ +will stop announcing to the tracker. The torrent will be added to the
│ │ │ +checking queue, and will be checked (all the files will be read and
│ │ │ +compared to the piece hashes). Once the check is complete, the torrent
│ │ │ +will start connecting to peers again, as normal.
│ │ │ +The torrent will be placed last in queue, i.e. its queue position
│ │ │ +will be the highest of all torrents in the session.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
get_resume_data() save_resume_data()
│ │ │ +
│ │ │ +add_torrent_params get_resume_data (resume_data_flags_t flags = {}) const;
│ │ │ +void save_resume_data (resume_data_flags_t flags = {}) const;
│ │ │ +
│ │ │ +
save_resume_data() and get_resume_data() asks libtorrent to
│ │ │ +generate fast-resume data for this torrent. The fast resume data
│ │ │ +(stored in an add_torrent_params object) can be used to resume a
│ │ │ +torrent in the next session without having to check all files for
│ │ │ +which pieces have been downloaded. It can also be used to save a
│ │ │ +.torrent file for a torrent_handle.
│ │ │ +
`get_resume_data() is synchronous and will block the calling
│ │ │ +thread until the resume data is ready and returned from the
│ │ │ +libtorrent main thread.
│ │ │ +/
│ │ │ +save_resume_data() is asynchronous. It will return immediately
│ │ │ +and deliver the resume data is when it's done through a
│ │ │ +save_resume_data_alert.
│ │ │ +
The operation will fail, and post a save_resume_data_failed_alert
│ │ │ +instead, in the following cases:
│ │ │ +
│ │ │ +
│ │ │ +- The torrent is in the process of being removed.
│ │ │ +- No torrent state has changed since the last saving of resume
│ │ │ +data, and the only_if_modified flag is set.
│ │ │ +metadata (see libtorrent's metadata from peers extension)
│ │ │ +
│ │ │ +
│ │ │ +
Note that some counters may be outdated by the time you receive the fast resume data
│ │ │ +
When saving resume data because of shutting down, make sure not to
│ │ │ +remove_torrent() before you receive the save_resume_data_alert.
│ │ │ +There's no need to pause the session or torrent when saving resume
│ │ │ +data.
│ │ │ +
The paused state of a torrent is saved in the resume data, so pausing
│ │ │ +all torrents before saving resume data will all torrents be restored
│ │ │ +in a paused state.
│ │ │ +
│ │ │ +
Note
│ │ │ +
It is typically a good idea to save resume data whenever a torrent
│ │ │ +is completed or paused. If you save resume data for torrents when they are
│ │ │ +paused, you can accelerate the shutdown process by not saving resume
│ │ │ +data again for those torrents. Completed torrents should have their
│ │ │ +resume data saved when they complete and on exit, since their
│ │ │ +statistics might be updated.
│ │ │ +
│ │ │ +
Example code to pause and save resume data for all torrents and wait
│ │ │ +for the alerts:
│ │ │ +
│ │ │ +extern int outstanding_resume_data; std::vector<torrent_handle> handles = ses.get_torrents();
│ │ │ +for (torrent_handle const& h : handles) try
│ │ │ +{
│ │ │ + h.save_resume_data(torrent_handle::only_if_modified);
│ │ │ + ++outstanding_resume_data;
│ │ │ +}
│ │ │ +catch (lt::system_error const& e)
│ │ │ +{
│ │ │ + }
│ │ │ +
│ │ │ +while (outstanding_resume_data > 0)
│ │ │ +{
│ │ │ + if (!ses.wait_for_alert(seconds(30))) break;
│ │ │ +
│ │ │ + std::vector<alert*> alerts;
│ │ │ + ses.pop_alerts(&alerts);
│ │ │ +
│ │ │ + for (alert* i : alerts)
│ │ │ + {
│ │ │ + if (alert_cast<save_resume_data_failed_alert>(i))
│ │ │ + {
│ │ │ + process_alert(i);
│ │ │ + --outstanding_resume_data;
│ │ │ + continue;
│ │ │ + }
│ │ │ +
│ │ │ + save_resume_data_alert const* rd = alert_cast<save_resume_data_alert>(i);
│ │ │ + if (rd == nullptr)
│ │ │ + {
│ │ │ + process_alert(i);
│ │ │ + continue;
│ │ │ + }
│ │ │ +
│ │ │ + std::ofstream out((rd->params.save_path
│ │ │ + + "/" + rd->params.name + ".fastresume").c_str()
│ │ │ + , std::ios_base::binary);
│ │ │ + std::vector<char> buf = write_resume_data_buf(rd->params);
│ │ │ + out.write(buf.data(), buf.size());
│ │ │ + --outstanding_resume_data;
│ │ │ + }
│ │ │ +}
│ │ │ +
│ │ │ +
│ │ │ +
Note
│ │ │ +
Note how outstanding_resume_data is a global counter in this
│ │ │ +example. This is deliberate, otherwise there is a race condition for
│ │ │ +torrents that was just asked to save their resume data, they posted
│ │ │ +the alert, but it has not been received yet. Those torrents would
│ │ │ +report that they don't need to save resume data again, and skipped by
│ │ │ +the initial loop, and thwart the counter otherwise.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
need_save_resume_data()
│ │ │ +
│ │ │ +bool need_save_resume_data () const;
│ │ │ +bool need_save_resume_data (resume_data_flags_t flags) const;
│ │ │ +
│ │ │ +
This function returns true if anything that is stored in the resume
│ │ │ +data has changed since the last time resume data was saved.
│ │ │ +The overload that takes flags let you ask if specific categories
│ │ │ +of properties have changed. These flags have the same behavior as in
│ │ │ +the save_resume_data() call.
│ │ │ +
This is a blocking call. It will wait for a response from
│ │ │ +libtorrent's main thread. A way to avoid blocking is to instead
│ │ │ +call save_resume_data() directly, specifying the conditions under
│ │ │ +which resume data should be saved.
│ │ │ +
│ │ │ +
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_bottom() queue_position_down() queue_position() queue_position_up() queue_position_top()
│ │ │ +
│ │ │ +void queue_position_down () const;
│ │ │ +queue_position_t queue_position () const;
│ │ │ +void queue_position_top () const;
│ │ │ +void queue_position_bottom () const;
│ │ │ +void queue_position_up () 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 positions have their positions decreased to fill in the
│ │ │ +space in the sequence.
│ │ │ +
queue_position() returns the torrent's position in the download
│ │ │ +queue. The torrents with the smallest numbers are the ones that are
│ │ │ +being downloaded. The smaller number, the closer the torrent is to the
│ │ │ +front of the line to be started.
│ │ │ +
The queue position is also available in the torrent_status.
│ │ │ +
The queue_position_*() functions adjust the torrents position in
│ │ │ +the queue. Up means closer to the front and down means closer to the
│ │ │ +back of the queue. Top and bottom refers to the front and the back of
│ │ │ +the queue respectively.
│ │ │ +
[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() set_ssl_certificate_buffer()
│ │ │ +
│ │ │ +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.
│ │ │ +
private_key is a path to the private key for the specified
│ │ │ +certificate. This must be in .pem format.
│ │ │ +
dh_params is a path to the Diffie-Hellman parameter file, which
│ │ │ +needs to be in .pem format. You can generate this file using the
│ │ │ +openssl command like this: openssl dhparam -outform PEM -out
│ │ │ +dhparams.pem 512.
│ │ │ +
passphrase may be specified if the private key is encrypted and
│ │ │ +requires a passphrase to be decrypted.
│ │ │ +
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<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.
│ │ │ +
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, dht nodes and trackers. A torrent_info object does
│ │ │ +not round-trip cleanly when added to a session.
│ │ │ +
If you want to save a .torrent file from the torrent_handle, instead
│ │ │ +call save_resume_data() and write_torrent_file() the
│ │ │ +add_torrent_params object passed back in the alert.
│ │ │ +
torrent_file_with_hashes() returns a copy of the internal
│ │ │ +torrent_info and piece layer hashes (if it's a v2 torrent). The piece
│ │ │ +layers will only be included if they are available. If this torrent
│ │ │ +was added from a .torrent file with piece layers or if it's seeding,
│ │ │ +the piece layers are available. This function is more expensive than
│ │ │ +torrent_file() since it needs to make copies of this information.
│ │ │ +
The torrent_file_with_hashes() is here for backwards compatibility
│ │ │ +when constructing a create_torrent object from a torrent_info that's
│ │ │ +in a session. Prefer save_resume_data() + write_torrent_file().
│ │ │ +
Note that a torrent added from a magnet link may not have the full
│ │ │ +merkle trees for all files, and hence not have the complete piece
│ │ │ +layers. In that state, you cannot create a .torrent file even from
│ │ │ +the torrent_info returned from torrent_file_with_hashes(). Once the
│ │ │ +torrent completes downloading all files, becoming a seed, you can
│ │ │ +make a .torrent file from it.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_layers()
│ │ │ +
│ │ │ +std::vector<std::vector<sha256_hash>> piece_layers () const;
│ │ │ +
│ │ │ +
returns the piece layers for all files in the torrent. If this is a
│ │ │ +v1 torrent (and doesn't have any piece layers) it returns an empty
│ │ │ +vector. This is a blocking call that will synchronize with the
│ │ │ +libtorrent network thread.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_availability() post_piece_availability()
│ │ │ +
│ │ │ +void post_piece_availability () const;
│ │ │ +void piece_availability (std::vector<int>& avail) const;
│ │ │ +
│ │ │ +
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.
│ │ │ +
post_piece_availability() will trigger a piece_availability_alert
│ │ │ +to be posted.
│ │ │ +
piece_availability() fills the specified std::vector<int>
│ │ │ +with the availability for each piece in 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.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
get_piece_priorities() piece_priority() prioritize_pieces()
│ │ │ +
│ │ │ +void piece_priority (piece_index_t index, download_priority_t priority) const;
│ │ │ +void prioritize_pieces (std::vector<download_priority_t> const& pieces) 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;
│ │ │ +
│ │ │ +
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 piece with priority 7
│ │ │ +will be attempted to be picked before a priority 6 piece and so on.
│ │ │ +
The default priority of pieces is 4.
│ │ │ +
Piece priorities can not be changed for torrents that have not
│ │ │ +downloaded the metadata yet. Magnet links won't have metadata
│ │ │ +immediately. see the metadata_received_alert.
│ │ │ +
piece_priority sets or gets the priority for an individual piece,
│ │ │ +specified by index.
│ │ │ +
prioritize_pieces takes a vector of integers, one integer per
│ │ │ +piece in the torrent. All the piece priorities will be updated with
│ │ │ +the priorities in the vector.
│ │ │ +The second overload of prioritize_pieces that takes a vector of pairs
│ │ │ +will update the priorities of only select pieces, and leave all other
│ │ │ +unaffected. Each pair is (piece, priority). That is, the first item is
│ │ │ +the piece index and the second item is the priority of that piece.
│ │ │ +Invalid entries, where the piece index or priority is out of range, are
│ │ │ +not allowed.
│ │ │ +
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]
│ │ │ +
│ │ │ +
file_priority() get_file_priorities() prioritize_files()
│ │ │ +
│ │ │ +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;
│ │ │ +
│ │ │ +
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
│ │ │ +download_priority_t.
│ │ │ +
Whenever a file priority is changed, all other piece priorities are
│ │ │ +reset to match the file priorities. In order to maintain special
│ │ │ +priorities for particular pieces, piece_priority() has to be called
│ │ │ +again for those pieces.
│ │ │ +
You cannot set the file priorities on a torrent that does not yet have
│ │ │ +metadata or a torrent that is a seed. file_priority(int, int) and
│ │ │ +prioritize_files() are both no-ops for such torrents.
│ │ │ +
Since changing file priorities may involve disk operations (of moving
│ │ │ +files in- and out of the part file), the internal accounting of file
│ │ │ +priorities happen asynchronously. i.e. setting file priorities and then
│ │ │ +immediately querying them may not yield the same priorities just set.
│ │ │ +To synchronize with the priorities taking effect, wait for the
│ │ │ +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_lsd_announce() force_dht_announce() force_reannounce()
│ │ │ +
│ │ │ +void force_dht_announce () const;
│ │ │ +void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) 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 -1 (which is the default), all trackers are re-announce.
│ │ │ +
The flags argument can be used to affect the re-announce. See
│ │ │ +ignore_min_interval and high_priority.
│ │ │ +
force_dht_announce will announce the torrent to the DHT
│ │ │ +immediately.
│ │ │ +
force_lsd_announce will announce the torrent on LSD
│ │ │ +immediately.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
scrape_tracker()
│ │ │ +
│ │ │ +void scrape_tracker (int idx = -1) const;
│ │ │ +
│ │ │ +
scrape_tracker() will send a scrape request to a tracker. By
│ │ │ +default (idx = -1) it will scrape the last working tracker. If
│ │ │ +idx is >= 0, the tracker with the specified index will scraped.
│ │ │ +
A scrape request queries the tracker for statistics such as total
│ │ │ +number of incomplete peers, complete peers, number of downloads etc.
│ │ │ +
This request will specifically update the num_complete and
│ │ │ +num_incomplete 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]
│ │ │ +
│ │ │ +
set_download_limit() upload_limit() set_upload_limit() download_limit()
│ │ │ +
│ │ │ +int download_limit () const;
│ │ │ +void set_download_limit (int limit) const;
│ │ │ +void set_upload_limit (int limit) const;
│ │ │ +int upload_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.
│ │ │ +
upload_limit and download_limit will return the current limit
│ │ │ +setting, for upload and download, respectively.
│ │ │ +
Local peers are not rate limited by default. see peer classes.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
connect_peer()
│ │ │ +
│ │ │ +void connect_peer (tcp::endpoint const& adr, peer_source_flags_t source = {}
│ │ │ + , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;
│ │ │ +
│ │ │ +
connect_peer() is a way to manually connect to peers that one
│ │ │ +believe is a part of the torrent. If the peer does not respond, or is
│ │ │ +not a member of this torrent, it will simply be disconnected. No harm
│ │ │ +can be done by using this other than an unnecessary connection attempt
│ │ │ +is made. If the torrent is uninitialized or in queued or checking
│ │ │ +mode, this will throw system_error. The second (optional)
│ │ │ +argument will be bitwise ORed into the source mask of this peer.
│ │ │ +Typically this is one of the source flags in peer_info. i.e.
│ │ │ +tracker, pex, dht etc.
│ │ │ +
For possible values of flags, see pex_flags_t.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
clear_peers()
│ │ │ +
│ │ │ +void clear_peers ();
│ │ │ +
│ │ │ +
This will disconnect all peers and clear the peer list for this
│ │ │ +torrent. New peers will have to be acquired before resuming, from
│ │ │ +trackers, DHT or local service discovery, for example.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
max_uploads() set_max_uploads()
│ │ │ +
│ │ │ +void set_max_uploads (int max_uploads) const;
│ │ │ +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]
│ │ │ +
│ │ │ +
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
│ │ │ +connections_limit in settings_pack.
│ │ │ +
max_connections() returns the current settings.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
move_storage()
│ │ │ +
│ │ │ +void move_storage (std::string const& save_path
│ │ │ + , move_flags_t flags = move_flags_t::always_replace_files
│ │ │ + ) const;
│ │ │ +
│ │ │ +
Moves the file(s) that this torrent are currently seeding from or
│ │ │ +downloading to. If the given save_path is not located on the same
│ │ │ +drive as the original save path, the files will be copied to the new
│ │ │ +drive and removed from their original location. This will block all
│ │ │ +other disk IO, and other torrents download and upload rates may drop
│ │ │ +while copying the file.
│ │ │ +
Since disk IO is performed in a separate thread, this operation is
│ │ │ +also asynchronous. Once the operation completes, the
│ │ │ +storage_moved_alert is generated, with the new path as the
│ │ │ +message. If the move fails for some reason,
│ │ │ +storage_moved_failed_alert is generated instead, containing the
│ │ │ +error message.
│ │ │ +
The flags argument determines the behavior of the copying/moving
│ │ │ +of the files in the torrent. see move_flags_t.
│ │ │ +
always_replace_files is the default and replaces any file that
│ │ │ +exist in both the source directory and the target directory.
│ │ │ +
fail_if_exist first check to see that none of the copy operations
│ │ │ +would cause an overwrite. If it would, it will fail. Otherwise it will
│ │ │ +proceed as if it was in always_replace_files mode. Note that there
│ │ │ +is an inherent race condition here. If the files in the target
│ │ │ +directory appear after the check but before the copy or move
│ │ │ +completes, they will be overwritten. When failing because of files
│ │ │ +already existing in the target path, the error of
│ │ │ +move_storage_failed_alert is set to
│ │ │ +boost::system::errc::file_exists.
│ │ │ +
The intention is that a client may use this as a probe, and if it
│ │ │ +fails, ask the user which mode to use. The client may then re-issue
│ │ │ +the move_storage call with one of the other modes.
│ │ │ +
dont_replace always keeps the existing file in the target
│ │ │ +directory, if there is one. The source files will still be removed in
│ │ │ +that case. Note that it won't automatically re-check files. If an
│ │ │ +incomplete torrent is moved into a directory with the complete files,
│ │ │ +pause, move, force-recheck and resume. Without the re-checking, the
│ │ │ +torrent will keep downloading and files in the new download directory
│ │ │ +will be overwritten.
│ │ │ +
Files that have been renamed to have absolute paths are not moved by
│ │ │ +this function. Keep in mind that files that don't belong to the
│ │ │ +torrent but are stored in the torrent's directory may be moved as
│ │ │ +well. This goes for files that have been renamed to absolute paths
│ │ │ +that still end up inside the save path.
│ │ │ +
When copying files, sparse regions are not likely to be preserved.
│ │ │ +This makes it proportionally more expensive to move a large torrent
│ │ │ +when only few pieces have been downloaded, since the files are then
│ │ │ +allocated with zeros in the destination directory.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
rename_file()
│ │ │ +
│ │ │ +void rename_file (file_index_t index, std::string const& new_name) const;
│ │ │ +
│ │ │ +
Renames the file with the given index asynchronously. The rename
│ │ │ +operation is complete when either a file_renamed_alert or
│ │ │ +file_rename_failed_alert is posted.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
info_hashes() info_hash()
│ │ │ +
│ │ │ +info_hash_t info_hashes () const;
│ │ │ +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;
│ │ │ +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]
│ │ │ +
│ │ │ +
native_handle()
│ │ │ +
│ │ │ +std::shared_ptr<torrent> native_handle () const;
│ │ │ +
│ │ │ +
This function is intended only for use by plugins and the alert
│ │ │ +dispatch function. This type does not have a stable ABI and should
│ │ │ +be relied on as little as possible. Accessing the handle returned by
│ │ │ +this function is not thread safe outside of libtorrent's internal
│ │ │ +thread (which is used to invoke plugin callbacks).
│ │ │ +The torrent class is not only eligible for changing ABI across
│ │ │ +minor versions of libtorrent, its layout is also dependent on build
│ │ │ +configuration. This adds additional requirements on a client to be
│ │ │ +built with the exact same build configuration as libtorrent itself.
│ │ │ +i.e. the TORRENT_ macros must match between libtorrent and the
│ │ │ +client builds.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
userdata()
│ │ │ +
│ │ │ +client_data_t userdata () const;
│ │ │ +
│ │ │ +
returns the userdata pointer as set in add_torrent_params
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
in_session()
│ │ │ +
│ │ │ +bool in_session () const;
│ │ │ +
│ │ │ +
Returns true if the torrent is in the session. It returns true before
│ │ │ +session::remove_torrent() is called, and false afterward.
│ │ │ +
Note that this is a blocking function, unlike torrent_handle::is_valid()
│ │ │ +which returns immediately.
│ │ │ +
[report issue]
│ │ │ +- overwrite_existing
│ │ │ +- instruct libtorrent to overwrite any data that may already have been
│ │ │ +downloaded with the data of the new piece being added. Using this
│ │ │ +flag when adding a piece that is actively being downloaded from other
│ │ │ +peers may have some unexpected consequences, as blocks currently
│ │ │ +being downloaded from peers may not be replaced.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- query_distributed_copies
│ │ │ +- calculates distributed_copies, distributed_full_copies and
│ │ │ +distributed_fraction.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- query_accurate_download_counters
│ │ │ +- includes partial downloaded blocks in total_done and
│ │ │ +total_wanted_done.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- query_last_seen_complete
│ │ │ +- includes last_seen_complete.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- query_pieces
│ │ │ +- populate the pieces field in torrent_status.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- query_verified_pieces
│ │ │ +- includes verified_pieces (only applies to torrents in seed
│ │ │ +mode).
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- query_torrent_file
│ │ │ +- includes torrent_file, which is all the static information from
│ │ │ +the .torrent file.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- query_name
│ │ │ +- includes name, the name of the torrent. This is either derived
│ │ │ +from the .torrent file, or from the &dn= magnet link argument
│ │ │ +or possibly some other source. If the name of the torrent is not
│ │ │ +known, this is an empty string.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- query_save_path
│ │ │ +- includes save_path, the path to the directory the files of the
│ │ │ +torrent are saved to.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- alert_when_available
│ │ │ +- used to ask libtorrent to send an alert once the piece has been
│ │ │ +downloaded, by passing alert_when_available. When set, the
│ │ │ +read_piece_alert alert will be delivered, with the piece data, when
│ │ │ +it's downloaded.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- piece_granularity
│ │ │ +- only calculate file progress at piece granularity. This makes
│ │ │ +the file_progress() call cheaper and also only takes bytes that
│ │ │ +have passed the hash check into account, so progress cannot
│ │ │ +regress in this mode.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- graceful_pause
│ │ │ +- will delay the disconnect of peers that we're still downloading
│ │ │ +outstanding requests from. The torrent will not accept any more
│ │ │ +requests and will disconnect all idle peers. As soon as a peer is done
│ │ │ +transferring the blocks that were requested from it, it is
│ │ │ +disconnected. This is a graceful shut down of the torrent in the sense
│ │ │ +that no downloaded bytes are wasted.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- flush_disk_cache
│ │ │ +- the disk cache will be flushed before creating the resume data.
│ │ │ +This avoids a problem with file timestamps in the resume data in
│ │ │ +case the cache hasn't been flushed yet.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- save_info_dict
│ │ │ +- the resume data will contain the metadata from the torrent file as
│ │ │ +well. This is useful for clients that don't keep .torrent files
│ │ │ +around separately, or for torrents that were added via a magnet link.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- only_if_modified
│ │ │ +- this flag has the same behavior as the combination of:
│ │ │ +if_counters_changed | if_download_progress | if_config_changed |
│ │ │ +if_state_changed | if_metadata_changed
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- if_counters_changed
│ │ │ +- save resume data if any counters has changed since the last time
│ │ │ +resume data was saved. This includes upload/download counters, active
│ │ │ +time counters and scrape data. A torrent that is not paused will have
│ │ │ +its active time counters incremented continuously.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- if_download_progress
│ │ │ +- save the resume data if any blocks have been downloaded since the
│ │ │ +last time resume data was saved. This includes:
│ │ │ +* checking existing files on disk
│ │ │ +* downloading a block from a peer
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- if_config_changed
│ │ │ +- save the resume data if configuration options changed since last time
│ │ │ +the resume data was saved. This includes:
│ │ │ +* file- or piece priorities
│ │ │ +* upload- and download rate limits
│ │ │ +* change max-uploads (unchoke slots)
│ │ │ +* change max connection limit
│ │ │ +* enable/disable peer-exchange, local service discovery or DHT
│ │ │ +* enable/disable apply IP-filter
│ │ │ +* enable/disable auto-managed
│ │ │ +* enable/disable share-mode
│ │ │ +* enable/disable sequential-mode
│ │ │ +* files renamed
│ │ │ +* storage moved (save_path changed)
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- if_state_changed
│ │ │ +- save the resume data if torrent state has changed since last time the
│ │ │ +resume data was saved. This includes:
│ │ │ +* upload mode
│ │ │ +* paused state
│ │ │ +* super-seeding
│ │ │ +* seed-mode
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- if_metadata_changed
│ │ │ +- save the resume data if any metadata changed since the last time
│ │ │ +resume data was saved. This includes:
│ │ │ +* add/remove web seeds
│ │ │ +* add/remove trackers
│ │ │ +* receiving metadata for a magnet link
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- ignore_min_interval
│ │ │ +- by default, force-reannounce will still honor the min-interval
│ │ │ +published by the tracker. If this flag is set, it will be ignored
│ │ │ +and the tracker is announced immediately.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- high_priority
│ │ │ +- by default, force-reannounce will queue the announce normally.
│ │ │ +If this flag is set, the announce will be put at the front of the
│ │ │ +tracker queue for immediate processing.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
hash_value()
│ │ │ +
Declared in "libtorrent/torrent_handle.hpp"
│ │ │ +
│ │ │ +std::size_t hash_value (torrent_handle const& h);
│ │ │ +
│ │ │ +
for std::hash (and to support using this type in unordered_map etc.)
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
storage_params
│ │ │ +
Declared in "libtorrent/storage_defs.hpp"
│ │ │ +
a parameter pack used to construct the storage for a torrent, used in
│ │ │ +disk_interface
│ │ │ +
│ │ │ +struct storage_params
│ │ │ +{
│ │ │ + storage_params (file_storage const& f, file_storage const* mf
│ │ │ + , std::string const& sp, storage_mode_t const sm
│ │ │ + , aux::vector<download_priority_t, file_index_t> const& prio
│ │ │ + , sha1_hash const& ih);
│ │ │ +
│ │ │ + file_storage const& files;
│ │ │ + file_storage const* mapped_files = nullptr;
│ │ │ + std::string const& path;
│ │ │ + storage_mode_t mode {storage_mode_sparse};
│ │ │ + aux::vector<download_priority_t, file_index_t> const& priorities;
│ │ │ + sha1_hash info_hash;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_slice
│ │ │ +
Declared in "libtorrent/file_storage.hpp"
│ │ │ +
represents a window of a file in a torrent.
│ │ │ +
The file_index refers to the index of the file (in the torrent_info).
│ │ │ +To get the path and filename, use file_path() and give the file_index
│ │ │ +as argument. The offset is the byte offset in the file where the range
│ │ │ +starts, and size is the number of bytes this range is. The size + offset
│ │ │ +will never be greater than the file size.
│ │ │ +
│ │ │ +struct file_slice
│ │ │ +{
│ │ │ + file_index_t file_index;
│ │ │ + std::int64_t offset;
│ │ │ + std::int64_t size;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- file_index
│ │ │ +- the index of the file
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- offset
│ │ │ +- the offset from the start of the file, in bytes
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- size
│ │ │ +- the size of the window, in bytes
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_storage
│ │ │ +
Declared in "libtorrent/file_storage.hpp"
│ │ │ +
The file_storage class represents a file list and the piece
│ │ │ +size. Everything necessary to interpret a regular bittorrent storage
│ │ │ +file structure.
│ │ │ +
│ │ │ +class file_storage
│ │ │ +{
│ │ │ + bool is_valid () const;
│ │ │ + void reserve (int num_files);
│ │ │ + 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 (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 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;
│ │ │ + std::int64_t total_size () const;
│ │ │ + int num_pieces () const;
│ │ │ + void set_num_pieces (int n);
│ │ │ + piece_index_t end_piece () const;
│ │ │ + piece_index_t last_piece () const;
│ │ │ + index_range<piece_index_t> piece_range () const noexcept;
│ │ │ + void set_piece_length (int l);
│ │ │ + int piece_length () const;
│ │ │ + 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;
│ │ │ + int blocks_per_piece () const;
│ │ │ + std::string const& name () const;
│ │ │ + void set_name (std::string const& n);
│ │ │ + void swap (file_storage& ti) noexcept;
│ │ │ + void canonicalize ();
│ │ │ + sha256_hash root (file_index_t index) const;
│ │ │ + std::string symlink (file_index_t index) const;
│ │ │ + bool pad_file_at (file_index_t index) const;
│ │ │ + std::int64_t file_offset (file_index_t index) const;
│ │ │ + string_view file_name (file_index_t index) const;
│ │ │ + sha1_hash hash (file_index_t index) const;
│ │ │ + char const* root_ptr (file_index_t const index) const;
│ │ │ + std::string file_path (file_index_t index, std::string const& save_path = "") const;
│ │ │ + std::time_t mtime (file_index_t index) const;
│ │ │ + std::int64_t file_size (file_index_t index) 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_piece_node (file_index_t index) const;
│ │ │ + int file_first_block_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;
│ │ │ + file_index_t file_index_at_piece (piece_index_t piece) const;
│ │ │ + file_index_t file_index_for_root (sha256_hash const& root_hash) const;
│ │ │ + piece_index_t piece_index_at_file (file_index_t f) const;
│ │ │ + void sanitize_symlinks ();
│ │ │ + bool v2 () const;
│ │ │ +
│ │ │ + static constexpr file_flags_t flag_pad_file = 0_bit;
│ │ │ + static constexpr file_flags_t flag_hidden = 1_bit;
│ │ │ + static constexpr file_flags_t flag_executable = 2_bit;
│ │ │ + static constexpr file_flags_t flag_symlink = 3_bit;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
is_valid()
│ │ │ +
│ │ │ +bool is_valid () const;
│ │ │ +
│ │ │ +
returns true if the piece length has been initialized
│ │ │ +on the file_storage. This is typically taken as a proxy
│ │ │ +of whether the file_storage as a whole is initialized or
│ │ │ +not.
│ │ │ +
[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_borrow() add_file()
│ │ │ +
│ │ │ +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 (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);
│ │ │ +
│ │ │ +
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.
│ │ │ +
The path argument is the full path (in the torrent file) to
│ │ │ +the file to add. Note that this is not supposed to be an absolute
│ │ │ +path, but it is expected to include the name of the torrent as the
│ │ │ +first path element.
│ │ │ +
file_size is the size of the file in bytes.
│ │ │ +
The file_flags argument sets attributes on the file. The file
│ │ │ +attributes is an extension and may not work in all bittorrent clients.
│ │ │ +
For possible file attributes, see file_storage::flags_t.
│ │ │ +
The mtime argument is optional and can be set to 0. If non-zero,
│ │ │ +it is the posix time of the last modification time of this file.
│ │ │ +
symlink_path is the path the file is a symlink to. To make this a
│ │ │ +symlink you also need to set the file_storage::flag_symlink file flag.
│ │ │ +
root_hash is an optional pointer to a 32 byte SHA-256 hash, being
│ │ │ +the merkle tree root hash for this file. This is only used for v2
│ │ │ +torrents. If the root hash is specified for one file, it has to
│ │ │ +be specified for all, otherwise this function will fail.
│ │ │ +Note that the buffer root_hash points to must out-live the
│ │ │ +file_storage object, it will not be copied. This parameter is only
│ │ │ +used when loading torrents, that already have their file hashes
│ │ │ +computed. When creating torrents, the file hashes will be computed by
│ │ │ +the piece hashes.
│ │ │ +
If more files than one are added, certain restrictions to their paths
│ │ │ +apply. In a multi-file file storage (torrent), all files must share
│ │ │ +the same root directory.
│ │ │ +
That is, the first path element of all files must be the same.
│ │ │ +This shared path element is also set to the name of the torrent. It
│ │ │ +can be changed by calling set_name.
│ │ │ +
The overloads that take an error_code reference will report failures
│ │ │ +via that variable, otherwise system_error is thrown.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
rename_file()
│ │ │ +
│ │ │ +void rename_file (file_index_t index, std::string const& new_filename);
│ │ │ +
│ │ │ +
renames the file at index to new_filename. Keep in mind
│ │ │ +that filenames are expected to be UTF-8 encoded.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
map_block()
│ │ │ +
│ │ │ +std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset
│ │ │ + , std::int64_t size) const;
│ │ │ +
│ │ │ +
returns a list of file_slice objects representing the portions of
│ │ │ +files the specified piece index, byte offset and size range overlaps.
│ │ │ +this is the inverse mapping of map_file().
│ │ │ +
Preconditions of this function is that the input range is within the
│ │ │ +torrents address space. piece may not be negative and
│ │ │ +
│ │ │ +piece * piece_size + offset + size
│ │ │ +
may not exceed the total size of the torrent.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
map_file()
│ │ │ +
│ │ │ +peer_request map_file (file_index_t file, std::int64_t offset, int size) const;
│ │ │ +
│ │ │ +
returns a peer_request representing the piece index, byte offset
│ │ │ +and size the specified file range overlaps. This is the inverse
│ │ │ +mapping over map_block(). Note that the peer_request return type
│ │ │ +is meant to hold bittorrent block requests, which may not be larger
│ │ │ +than 16 kiB. Mapping a range larger than that may return an overflown
│ │ │ +integer.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
num_files()
│ │ │ +
│ │ │ +int num_files () const noexcept;
│ │ │ +
│ │ │ +
returns the number of files in the file_storage
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
end_file()
│ │ │ +
│ │ │ +file_index_t end_file () const noexcept;
│ │ │ +
│ │ │ +
returns the index of the one-past-end file in the file storage
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_range()
│ │ │ +
│ │ │ +index_range<file_index_t> file_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
│ │ │ +files in the file_storage.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
total_size()
│ │ │ +
│ │ │ +std::int64_t total_size () const;
│ │ │ +
│ │ │ +
returns the total number of bytes all the files in this torrent spans
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
set_num_pieces() num_pieces()
│ │ │ +
│ │ │ +int num_pieces () const;
│ │ │ +void set_num_pieces (int n);
│ │ │ +
│ │ │ +
set and get the number of pieces in the torrent
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
end_piece()
│ │ │ +
│ │ │ +piece_index_t end_piece () const;
│ │ │ +
│ │ │ +
returns the index of the one-past-end piece in the file storage
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
last_piece()
│ │ │ +
│ │ │ +piece_index_t last_piece () const;
│ │ │ +
│ │ │ +
returns the index of the last piece in the torrent. The last piece is
│ │ │ +special in that it may be smaller than the other pieces (and the other
│ │ │ +pieces are all the same size).
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
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()
│ │ │ +
│ │ │ +void set_piece_length (int l);
│ │ │ +int piece_length () const;
│ │ │ +
│ │ │ +
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;
│ │ │ +
│ │ │ +
returns the piece size of index. This will be the same as piece_length(), except
│ │ │ +for the last piece, which may be shorter.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_size2()
│ │ │ +
│ │ │ +int piece_size2 (piece_index_t index) const;
│ │ │ +
│ │ │ +
Returns the size of the given piece. If the piece spans multiple files,
│ │ │ +only the first file is considered part of the piece. This is used for
│ │ │ +v2 torrents, 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]
│ │ │ +
│ │ │ +
blocks_per_piece()
│ │ │ +
│ │ │ +int blocks_per_piece () const;
│ │ │ +
│ │ │ +
returns the number of blocks there are in the typical piece. There
│ │ │ +may be fewer in the last piece)
│ │ │ +
│ │ │ +
[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]
│ │ │ +
│ │ │ +
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_offset() pad_file_at() mtime() symlink() file_size() file_path() file_name() hash() root_ptr() root()
│ │ │ +
│ │ │ +sha256_hash root (file_index_t index) const;
│ │ │ +std::string symlink (file_index_t index) const;
│ │ │ +bool pad_file_at (file_index_t index) const;
│ │ │ +std::int64_t file_offset (file_index_t index) const;
│ │ │ +string_view file_name (file_index_t index) const;
│ │ │ +sha1_hash hash (file_index_t index) const;
│ │ │ +char const* root_ptr (file_index_t const index) const;
│ │ │ +std::string file_path (file_index_t index, std::string const& save_path = "") const;
│ │ │ +std::time_t mtime (file_index_t index) const;
│ │ │ +std::int64_t file_size (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 SHA-256 merkle tree root hash
│ │ │ +for the specified file. The pointer points into storage referred to
│ │ │ +when the file was added, it is not owned by this object. Torrents
│ │ │ +that are not v2 torrents return nullptr.
│ │ │ +
The mtime() is the modification time is the posix
│ │ │ +time when a file was last modified when the torrent
│ │ │ +was created, or 0 if it was not included in the torrent file.
│ │ │ +
file_path() returns the full path to a file.
│ │ │ +
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_blocks() file_piece_range() file_num_pieces()
│ │ │ +
│ │ │ +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_piece_node() file_first_block_node()
│ │ │ +
│ │ │ +int file_first_piece_node (file_index_t index) const;
│ │ │ +int file_first_block_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;
│ │ │ +
│ │ │ +
returns the crc32 hash of file_path(index)
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
all_path_hashes()
│ │ │ +
│ │ │ +void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;
│ │ │ +
│ │ │ +
this will add the CRC32 hash of all directory entries to the table. No
│ │ │ +filename will be included, just directories. Every depth of directories
│ │ │ +are added separately to allow test for collisions with files at all
│ │ │ +levels. i.e. if one path in the torrent is foo/bar/baz, the CRC32
│ │ │ +hashes for foo, foo/bar and foo/bar/baz will be added to
│ │ │ +the set.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
file_flags()
│ │ │ +
│ │ │ +file_flags_t file_flags (file_index_t index) const;
│ │ │ +
│ │ │ +
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_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 file with the root hash, file_index_t{-1} is returned
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_index_at_file()
│ │ │ +
│ │ │ +piece_index_t piece_index_at_file (file_index_t f) const;
│ │ │ +
│ │ │ +
returns the piece index the given file starts at
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
sanitize_symlinks()
│ │ │ +
│ │ │ +void sanitize_symlinks ();
│ │ │ +
│ │ │ +
validate any symlinks, to ensure they all point to
│ │ │ +other files or directories inside this storage. Any invalid symlinks
│ │ │ +are updated to point to themselves.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
v2()
│ │ │ +
│ │ │ +bool v2 () const;
│ │ │ +
│ │ │ +
returns true if this torrent contains v2 metadata.
│ │ │ +
[report issue]
│ │ │ +- flag_pad_file
│ │ │ +- the file is a pad file. It's required to contain zeros
│ │ │ +at it will not be saved to disk. Its purpose is to make
│ │ │ +the following file start on a piece boundary.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- flag_hidden
│ │ │ +- this file has the hidden attribute set. This is primarily
│ │ │ +a windows attribute
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- flag_executable
│ │ │ +- this file has the executable attribute set.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- flag_symlink
│ │ │ +- this file is a symbolic link. It should have a link
│ │ │ +target string associated with it.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
mmap_disk_io_constructor()
│ │ │ +
Declared in "libtorrent/mmap_disk_io.hpp"
│ │ │ +
│ │ │ +std::unique_ptr<disk_interface> mmap_disk_io_constructor (
│ │ │ + io_context& ios, settings_interface const&, counters& cnt);
│ │ │ +
│ │ │ +
constructs a memory mapped file disk I/O object.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
default_disk_io_constructor()
│ │ │ +
Declared in "libtorrent/session.hpp"
│ │ │ +
│ │ │ +std::unique_ptr<disk_interface> default_disk_io_constructor (
│ │ │ + io_context& ios, settings_interface const&, counters& cnt);
│ │ │ +
│ │ │ +
the constructor function for the default storage. On systems that support
│ │ │ +memory mapped files (and a 64 bit address space) the memory mapped storage
│ │ │ +will be constructed, otherwise the portable posix storage.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
disabled_disk_io_constructor()
│ │ │ +
Declared in "libtorrent/disabled_disk_io.hpp"
│ │ │ +
│ │ │ +std::unique_ptr<disk_interface> disabled_disk_io_constructor (
│ │ │ + io_context& ios, settings_interface const&, counters& cnt);
│ │ │ +
│ │ │ +
creates a disk io object that discards all data written to it, and only
│ │ │ +returns zero-buffers when read from. May be useful for testing and
│ │ │ +benchmarking.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
posix_disk_io_constructor()
│ │ │ +
Declared in "libtorrent/posix_disk_io.hpp"
│ │ │ +
│ │ │ +std::unique_ptr<disk_interface> posix_disk_io_constructor (
│ │ │ + io_context& ios, settings_interface const&, counters& cnt);
│ │ │ +
│ │ │ +
this is a simple posix disk I/O back-end, used for systems that don't
│ │ │ +have a 64 bit virtual address space or don't support memory mapped files.
│ │ │ +It's implemented using portable C file functions and is single-threaded.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum storage_mode_t
│ │ │ +
Declared in "libtorrent/storage_defs.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| cont |
│ │ │ -100 |
│ │ │ - |
│ │ │ -
│ │ │ -| ok |
│ │ │ -200 |
│ │ │ - |
│ │ │ -
│ │ │ -| created |
│ │ │ -201 |
│ │ │ - |
│ │ │ -
│ │ │ -| accepted |
│ │ │ -202 |
│ │ │ - |
│ │ │ -
│ │ │ -| no_content |
│ │ │ -204 |
│ │ │ - |
│ │ │ -
│ │ │ -| multiple_choices |
│ │ │ -300 |
│ │ │ - |
│ │ │ -
│ │ │ -| moved_permanently |
│ │ │ -301 |
│ │ │ - |
│ │ │ -
│ │ │ -| moved_temporarily |
│ │ │ -302 |
│ │ │ - |
│ │ │ -
│ │ │ -| not_modified |
│ │ │ -304 |
│ │ │ - |
│ │ │ -
│ │ │ -| bad_request |
│ │ │ -400 |
│ │ │ - |
│ │ │ -
│ │ │ -| unauthorized |
│ │ │ -401 |
│ │ │ - |
│ │ │ -
│ │ │ -| forbidden |
│ │ │ -403 |
│ │ │ - |
│ │ │ -
│ │ │ -| not_found |
│ │ │ -404 |
│ │ │ - |
│ │ │ -
│ │ │ -| internal_server_error |
│ │ │ -500 |
│ │ │ - |
│ │ │ -
│ │ │ -| not_implemented |
│ │ │ -501 |
│ │ │ - |
│ │ │ -
│ │ │ -| bad_gateway |
│ │ │ -502 |
│ │ │ - |
│ │ │ +
| storage_mode_allocate |
│ │ │ +0 |
│ │ │ +All pieces will be written to their final position, all files will be
│ │ │ +allocated in full when the torrent is first started. This mode minimizes
│ │ │ +fragmentation but could be a costly operation. |
│ │ │
│ │ │ -| service_unavailable |
│ │ │ -503 |
│ │ │ - |
│ │ │ +
| storage_mode_sparse |
│ │ │ +1 |
│ │ │ +All pieces will be written to the place where they belong and sparse files
│ │ │ +will be used. This is the recommended, and default mode. |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
enum status_t
│ │ │ +
Declared in "libtorrent/storage_defs.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ | no_error |
│ │ │ 0 |
│ │ │ -Not an error |
│ │ │ + |
│ │ │
│ │ │ -| expected_digit |
│ │ │ +
| fatal_disk_error |
│ │ │ 1 |
│ │ │ -expected digit in bencoded string |
│ │ │ + |
│ │ │
│ │ │ -| expected_colon |
│ │ │ +
| need_full_check |
│ │ │ 2 |
│ │ │ -expected colon in bencoded string |
│ │ │ + |
│ │ │
│ │ │ -| unexpected_eof |
│ │ │ +
| file_exist |
│ │ │ 3 |
│ │ │ -unexpected end of file in bencoded string |
│ │ │ -
│ │ │ -| expected_value |
│ │ │ -4 |
│ │ │ -expected value (list, dict, int or string) in bencoded string |
│ │ │ -
│ │ │ -| depth_exceeded |
│ │ │ -5 |
│ │ │ -bencoded recursion depth limit exceeded |
│ │ │ -
│ │ │ -| limit_exceeded |
│ │ │ -6 |
│ │ │ -bencoded item count limit exceeded |
│ │ │ -
│ │ │ -| overflow |
│ │ │ -7 |
│ │ │ -integer overflow |
│ │ │ + |
│ │ │
│ │ │ -| error_code_max |
│ │ │ -8 |
│ │ │ -the number of error codes |
│ │ │ +
| oversized_file |
│ │ │ +16 |
│ │ │ +this is not an enum value, but a flag that can be set in the return
│ │ │ +from async_check_files, in case an existing file was found larger than
│ │ │ +specified in the torrent. i.e. it has garbage at the end
│ │ │ +the status_t field is used for this to preserve ABI. |
│ │ │
│ │ │
│ │ │
│ │ │ -
Bencoding is a common representation in bittorrent used for dictionary,
│ │ │ -list, int and string hierarchies. It's used to encode .torrent files and
│ │ │ -some messages in the network protocol. libtorrent also uses it to store
│ │ │ -settings, resume data and other session state.
│ │ │ -
Strings in bencoded structures do not necessarily represent text.
│ │ │ -Strings are raw byte buffers of a certain length. If a string is meant to be
│ │ │ -interpreted as text, it is required to be UTF-8 encoded. See BEP 3.
│ │ │ -
The function for decoding bencoded data bdecode(), returning a bdecode_node.
│ │ │ -This function builds a tree that points back into the original buffer. The
│ │ │ -returned bdecode_node will not be valid once the buffer it was parsed out of
│ │ │ -is discarded.
│ │ │ -
It's possible to construct an entry from a bdecode_node, if a structure needs
│ │ │ -to be altered and re-encoded.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
entry
│ │ │ -
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 (dictionary_type);
│ │ │ - entry (preformatted_type);
│ │ │ - entry (list_type);
│ │ │ - entry (span<char const>);
│ │ │ - entry (integer_type);
│ │ │ - entry (data_type t);
│ │ │ - entry (bdecode_node const& n);
│ │ │ - entry& operator= (bdecode_node const&) &;
│ │ │ - entry& operator= (list_type) &;
│ │ │ - entry& operator= (dictionary_type) &;
│ │ │ - entry& operator= (preformatted_type) &;
│ │ │ - entry& operator= (integer_type) &;
│ │ │ - entry& operator= (span<char const>) &;
│ │ │ - entry& operator= (entry&&) & noexcept;
│ │ │ - entry& operator= (entry const&) &;
│ │ │ - preformatted_type const& preformatted () const;
│ │ │ - list_type const& list () const;
│ │ │ - string_type& string ();
│ │ │ - dictionary_type const& dict () const;
│ │ │ - string_type const& string () const;
│ │ │ - preformatted_type& preformatted ();
│ │ │ - integer_type& integer ();
│ │ │ - dictionary_type& dict ();
│ │ │ - integer_type const& integer () const;
│ │ │ - list_type& list ();
│ │ │ - void swap (entry& e);
│ │ │ - entry& operator[] (string_view key);
│ │ │ - entry const& operator[] (string_view key) const;
│ │ │ - 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,
│ │ │ - dictionary_t,
│ │ │ - undefined_t,
│ │ │ - preformatted_t,
│ │ │ - };
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
type()
│ │ │ -
│ │ │ -data_type type () const;
│ │ │ -
│ │ │ -
returns the concrete type of the entry
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
entry()
│ │ │ -
│ │ │ -entry (dictionary_type);
│ │ │ -entry (preformatted_type);
│ │ │ -entry (list_type);
│ │ │ -entry (span<char const>);
│ │ │ -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= (bdecode_node const&) &;
│ │ │ -entry& operator= (list_type) &;
│ │ │ -entry& operator= (dictionary_type) &;
│ │ │ -entry& operator= (preformatted_type) &;
│ │ │ -entry& operator= (integer_type) &;
│ │ │ -entry& operator= (span<char const>) &;
│ │ │ -entry& operator= (entry&&) & noexcept;
│ │ │ -entry& operator= (entry const&) &;
│ │ │ -
│ │ │ -
copies the structure of the right hand side into this
│ │ │ -entry.
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[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;
│ │ │ -
│ │ │ -
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* 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()
│ │ │ -
│ │ │ -std::string to_string (bool single_line = false) const;
│ │ │ -
│ │ │ -
returns a pretty-printed string representation
│ │ │ -of the bencoded structure, with JSON-style syntax
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
enum move_flags_t
│ │ │ +
Declared in "libtorrent/storage_defs.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| int_t |
│ │ │ +
| always_replace_files |
│ │ │ 0 |
│ │ │ - |
│ │ │ +replace any files in the destination when copying
│ │ │ +or moving the storage |
│ │ │
│ │ │ -| string_t |
│ │ │ +
| fail_if_exist |
│ │ │ 1 |
│ │ │ - |
│ │ │ +if any files that we want to copy exist in the destination
│ │ │ +exist, fail the whole operation and don't perform
│ │ │ +any copy or move. There is an inherent race condition
│ │ │ +in this mode. The files are checked for existence before
│ │ │ +the operation starts. In between the check and performing
│ │ │ +the copy, the destination files may be created, in which
│ │ │ +case they are replaced. |
│ │ │
│ │ │ -| list_t |
│ │ │ +
| dont_replace |
│ │ │ 2 |
│ │ │ - |
│ │ │ +if any file exist in the target, take those files instead
│ │ │ +of the ones we may have in the source. |
│ │ │
│ │ │ -| dictionary_t |
│ │ │ +
| reset_save_path |
│ │ │ 3 |
│ │ │ - |
│ │ │ +don't move any source files, just forget about them
│ │ │ +and begin checking files at new save path |
│ │ │
│ │ │ -| undefined_t |
│ │ │ +
| reset_save_path_unchecked |
│ │ │ 4 |
│ │ │ - |
│ │ │ -
│ │ │ -| preformatted_t |
│ │ │ -5 |
│ │ │ - |
│ │ │ +don't move any source files, just change save path
│ │ │ +and continue working without any checks |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
operator<<()
│ │ │ -
Declared in "libtorrent/entry.hpp"
│ │ │ -
│ │ │ -inline std::ostream& operator<< (std::ostream& os, const entry& e);
│ │ │ -
│ │ │ -
prints the bencoded structure to the ostream as a JSON-style structure.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
bencode()
│ │ │ -
Declared in "libtorrent/bencode.hpp"
│ │ │ -
│ │ │ -template<class OutIt> int bencode (OutIt out, const entry& e);
│ │ │ -
│ │ │ -
This function will encode data to bencoded form.
│ │ │ -
The entry class is the internal representation of the bencoded data
│ │ │ -and it can be used to retrieve information, an entry can also be build by
│ │ │ -the program and given to bencode() to encode it into the OutIt
│ │ │ -iterator.
│ │ │ -
OutIt is an OutputIterator. It's a template and usually
│ │ │ -instantiated as ostream_iterator or back_insert_iterator. This
│ │ │ -function assumes the value_type of the iterator is a char.
│ │ │ -In order to encode entry e into a buffer, do:
│ │ │ -
│ │ │ -std::vector<char> buf;
│ │ │ -bencode(std::back_inserter(buf), e);
│ │ │ -
│ │ │
This section describes the functions and classes that are used
│ │ │ to create torrent files. It is a layered API with low level classes
│ │ │ and higher level convenience functions. A torrent is created in 4
│ │ │ steps:
│ │ │
│ │ │ - first the files that will be part of the torrent are determined.
│ │ │ - the torrent properties are set, such as tracker url, web seeds,
│ │ │ @@ -15833,27 +16334,27 @@
│ │ │ void set_hash (piece_index_t index, sha1_hash const& h);
│ │ │ void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);
│ │ │ void add_url_seed (string_view url);
│ │ │ 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);
│ │ │ - void set_priv (bool p);
│ │ │ bool priv () const;
│ │ │ - bool is_v1_only () const;
│ │ │ + void set_priv (bool p);
│ │ │ bool is_v2_only () const;
│ │ │ + bool is_v1_only () const;
│ │ │ int num_pieces () const;
│ │ │ piece_index_t end_piece () const;
│ │ │ index_range<piece_index_t> piece_range () const noexcept;
│ │ │ file_index_t end_file () const;
│ │ │ index_range<file_index_t> file_range () const noexcept;
│ │ │ index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);
│ │ │ std::int64_t total_size () const;
│ │ │ - int piece_size (piece_index_t i) const;
│ │ │ int piece_length () const;
│ │ │ + int piece_size (piece_index_t i) const;
│ │ │ void add_similar_torrent (sha1_hash ih);
│ │ │ void add_collection (string_view c);
│ │ │
│ │ │ static constexpr create_flags_t modification_time = 2_bit;
│ │ │ static constexpr create_flags_t symlinks = 3_bit;
│ │ │ static constexpr create_flags_t v2_only = 5_bit;
│ │ │ static constexpr create_flags_t v1_only = 6_bit;
│ │ │ @@ -15887,18 +16388,18 @@
│ │ │ have any affect. Instead of using this overload, consider using
│ │ │ write_torrent_file() instead.
│ │ │
│ │ │ -
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
generate_buf() generate()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
generate() generate_buf()
│ │ │
│ │ │ entry generate () const;
│ │ │ std::vector<char> generate_buf () 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.
│ │ │ @@ -16032,21 +16533,21 @@
│ │ │
│ │ │
This function sets an X.509 certificate in PEM format to the torrent. This makes the
│ │ │ torrent an SSL torrent. An SSL torrent requires that each peer has a valid certificate
│ │ │ signed by this root certificate. For SSL torrents, all peers are connecting over SSL
│ │ │ connections. For more information, see the section on ssl torrents.
│ │ │
The string is not the path to the cert, it's the actual content of the
│ │ │ certificate.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
priv() set_priv()
│ │ │
│ │ │ -void set_priv (bool p);
│ │ │ bool priv () const;
│ │ │ +void set_priv (bool p);
│ │ │
│ │ │
Sets and queries the private flag of the torrent.
│ │ │ Torrents with the private flag set ask the client to not use any other
│ │ │ sources than the tracker for peers, and to not use DHT to advertise itself publicly,
│ │ │ only the tracker.
│ │ │
[report issue]
│ │ │
│ │ │
│ │ │
total_size()
│ │ │
│ │ │ std::int64_t total_size () const;
│ │ │
│ │ │
the total number of bytes of all files and pad files
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
piece_size() piece_length()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
piece_length() piece_size()
│ │ │
│ │ │ -int piece_size (piece_index_t i) const;
│ │ │ int piece_length () const;
│ │ │ +int piece_size (piece_index_t i) const;
│ │ │
│ │ │
piece_length() returns the piece size of all pieces but the
│ │ │ last one. piece_size() returns the size of the specified piece.
│ │ │ these functions are just forwarding to the associated file_storage.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
add_collection() add_similar_torrent()
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
add_similar_torrent() add_collection()
│ │ │
│ │ │ void add_similar_torrent (sha1_hash ih);
│ │ │ void add_collection (string_view c);
│ │ │
│ │ │
Add similar torrents (by info-hash) or collections of similar torrents.
│ │ │ Similar torrents are expected to share some files with this torrent.
│ │ │ Torrents sharing a collection name with this torrent are also expected
│ │ │ @@ -16194,26 +16695,26 @@
│ │ │
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);
│ │ │ inline void set_piece_hashes (create_torrent& t, std::string const& p);
│ │ │ -inline void set_piece_hashes (create_torrent& t, std::string const& p
│ │ │ - , std::function<void(piece_index_t)> const& f);
│ │ │ -inline void set_piece_hashes (create_torrent& t, std::string const& p
│ │ │ - , settings_interface const& settings
│ │ │ - , std::function<void(piece_index_t)> const& f);
│ │ │ void set_piece_hashes (create_torrent& t, std::string const& p
│ │ │ , settings_interface const& settings, disk_io_constructor_type disk_io
│ │ │ , std::function<void(piece_index_t)> const& f, error_code& ec);
│ │ │ +inline void set_piece_hashes (create_torrent& t, std::string const& p
│ │ │ + , settings_interface const& settings
│ │ │ + , std::function<void(piece_index_t)> const& f);
│ │ │ +inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);
│ │ │ void set_piece_hashes (create_torrent& t, std::string const& p
│ │ │ , 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);
│ │ │ 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);
│ │ │
│ │ │
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
│ │ │ @@ -16221,4376 +16722,3901 @@
│ │ │
│ │ │ 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.
│ │ │
The overloads that don't take an error_code& may throw an exception in case of a
│ │ │ file error, the other overloads sets the error code to reflect the error, if any.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
client_data_t
│ │ │ -
Declared in "libtorrent/client_data.hpp"
│ │ │ -
A thin wrapper around a void pointer used as "user data". i.e. an opaque
│ │ │ -cookie passed in to libtorrent and returned on demand. It adds type-safety by
│ │ │ -requiring the same type be requested out of it as was assigned to it.
│ │ │ -
│ │ │ -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;
│ │ │ - client_data_t& operator= (void const*) = delete;
│ │ │ - client_data_t& operator= (void*) = delete;
│ │ │ - operator void const* () const = delete;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
client_data_t()
│ │ │ -
│ │ │ -client_data_t () = default;
│ │ │ -
│ │ │ -
construct a nullptr client data
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
client_data_t()
│ │ │ -
│ │ │ -explicit client_data_t (T* v);
│ │ │ -
│ │ │ -
initialize the client data with the specified pointer
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
operator=()
│ │ │ -
│ │ │ -client_data_t& operator= (T* v);
│ │ │ -
│ │ │ -
assigns a new pointer to the client data
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
T() get()
│ │ │ -
│ │ │ -T* get () const;
│ │ │ -explicit operator T () const;
│ │ │ -
│ │ │ -
request to retrieve the pointer back again. The type T must be
│ │ │ -identical to the type of the pointer assigned earlier, including
│ │ │ -const & volatile qualifiers.
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
const*() void*() operator=()
│ │ │ -
│ │ │ -operator void* () const = delete;
│ │ │ -client_data_t& operator= (void const*) = delete;
│ │ │ -client_data_t& operator= (void*) = delete;
│ │ │ -operator void const* () 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:
│ │ │ +
libtorrent has a plugin interface for implementing extensions to the protocol.
│ │ │ +These can be general extensions for transferring metadata or peer exchange
│ │ │ +extensions, or it could be used to provide a way to customize the protocol
│ │ │ +to fit a particular (closed) network.
│ │ │ +
In short, the plugin interface makes it possible to:
│ │ │
│ │ │ -- ti - the immutable info-dict part of the torrent
│ │ │ -- info_hash - when you don't have the metadata (.torrent file). This
│ │ │ -uniquely identifies the torrent and can validate the info-dict when
│ │ │ -received from the swarm.
│ │ │ +- register extension messages (sent in the extension handshake), see
│ │ │ +extensions.
│ │ │ +- add data and parse data from the extension handshake.
│ │ │ +- send extension messages and standard bittorrent messages.
│ │ │ +- override or block the handling of standard bittorrent messages.
│ │ │ +- save and restore state via the session state
│ │ │ +- see all alerts that are posted
│ │ │
│ │ │ -
In order to add a torrent to a session, one of those fields must be set
│ │ │ -in addition to save_path. The add_torrent_params object can then be
│ │ │ -passed into one of the session::add_torrent() overloads or
│ │ │ -session::async_add_torrent().
│ │ │ -
If you only specify the info-hash, the torrent file will be downloaded
│ │ │ -from peers, which requires them to support the metadata extension. For
│ │ │ -the metadata extension to work, libtorrent must be built with extensions
│ │ │ -enabled (TORRENT_DISABLE_EXTENSIONS must not be defined). It also
│ │ │ -takes an optional name argument. This may be left empty in case no
│ │ │ -name should be assigned to the torrent. In case it's not, the name is
│ │ │ -used for the torrent as long as it doesn't have metadata. See
│ │ │ -torrent_handle::name.
│ │ │ -
The add_torrent_params is also used when requesting resume data for a
│ │ │ -torrent. It can be saved to and restored from a file and added back to a
│ │ │ -new session. For serialization and de-serialization of
│ │ │ -add_torrent_params objects, see read_resume_data() and
│ │ │ -write_resume_data().
│ │ │ -
The add_torrent_params is also used to represent a parsed .torrent
│ │ │ -file. It can be loaded via load_torrent_file(), load_torrent_buffer() and
│ │ │ -load_torrent_parsed(). It can be saved via write_torrent_file().
│ │ │ -
│ │ │ -struct add_torrent_params
│ │ │ -{
│ │ │ - int version = LIBTORRENT_VERSION_NUM;
│ │ │ - std::shared_ptr<torrent_info> ti;
│ │ │ - aux::noexcept_movable<std::vector<std::string>> trackers;
│ │ │ - aux::noexcept_movable<std::vector<int>> tracker_tiers;
│ │ │ - aux::noexcept_movable<std::vector<std::pair<std::string, int>>> dht_nodes;
│ │ │ - std::string name;
│ │ │ - std::string save_path;
│ │ │ - storage_mode_t storage_mode = storage_mode_sparse;
│ │ │ - client_data_t userdata;
│ │ │ - aux::noexcept_movable<std::vector<download_priority_t>> file_priorities;
│ │ │ - std::string trackerid;
│ │ │ - torrent_flags_t flags = torrent_flags::default_flags;
│ │ │ - info_hash_t info_hashes;
│ │ │ - int max_uploads = -1;
│ │ │ - int max_connections = -1;
│ │ │ - int upload_limit = -1;
│ │ │ - int download_limit = -1;
│ │ │ - std::int64_t total_uploaded = 0;
│ │ │ - std::int64_t total_downloaded = 0;
│ │ │ - int active_time = 0;
│ │ │ - int finished_time = 0;
│ │ │ - int seeding_time = 0;
│ │ │ - std::time_t added_time = 0;
│ │ │ - std::time_t completed_time = 0;
│ │ │ - std::time_t last_seen_complete = 0;
│ │ │ - int num_complete = -1;
│ │ │ - int num_incomplete = -1;
│ │ │ - int num_downloaded = -1;
│ │ │ - aux::noexcept_movable<std::vector<std::string>> http_seeds;
│ │ │ - aux::noexcept_movable<std::vector<std::string>> url_seeds;
│ │ │ - aux::noexcept_movable<std::vector<tcp::endpoint>> peers;
│ │ │ - aux::noexcept_movable<std::vector<tcp::endpoint>> banned_peers;
│ │ │ - aux::noexcept_movable<std::map<piece_index_t, bitfield>> unfinished_pieces;
│ │ │ - typed_bitfield<piece_index_t> have_pieces;
│ │ │ - typed_bitfield<piece_index_t> verified_pieces;
│ │ │ - aux::noexcept_movable<std::vector<download_priority_t>> piece_priorities;
│ │ │ - aux::vector<std::vector<sha256_hash>, file_index_t> merkle_trees;
│ │ │ - aux::vector<std::vector<bool>, file_index_t> merkle_tree_mask;
│ │ │ - aux::vector<std::vector<bool>, file_index_t> verified_leaf_hashes;
│ │ │ - aux::noexcept_movable<std::map<file_index_t, std::string>> renamed_files;
│ │ │ - std::time_t last_download = 0;
│ │ │ - std::time_t last_upload = 0;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- version
│ │ │ -- filled in by the constructor and should be left untouched. It is used
│ │ │ -for forward binary compatibility.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- ti
│ │ │ -- torrent_info object with the torrent to add. Unless the
│ │ │ -info_hash is set, this is required to be initialized.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- trackers
│ │ │ -- If the torrent doesn't have a tracker, but relies on the DHT to find
│ │ │ -peers, the trackers can specify tracker URLs for the torrent.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- tracker_tiers
│ │ │ -- the tiers the URLs in trackers belong to. Trackers belonging to
│ │ │ -different tiers may be treated differently, as defined by the multi
│ │ │ -tracker extension. This is optional, if not specified trackers are
│ │ │ -assumed to be part of tier 0, or whichever the last tier was as
│ │ │ -iterating over the trackers.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- dht_nodes
│ │ │ -- a list of hostname and port pairs, representing DHT nodes to be added
│ │ │ -to the session (if DHT is enabled). The hostname may be an IP address.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- name
│ │ │ -- in case there's no other name in this torrent, this name will be used.
│ │ │ -The name out of the torrent_info object takes precedence if available.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- save_path
│ │ │ -the path where the torrent is or will be stored.
│ │ │ -
│ │ │ -
Note
│ │ │ -
On windows this path (and other paths) are interpreted as UNC
│ │ │ -paths. This means they must use backslashes as directory separators
│ │ │ -and may not contain the special directories "." or "..".
│ │ │ -
│ │ │ -Setting this to an absolute path performs slightly better than a
│ │ │ -relative path.
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- storage_mode
│ │ │ -- One of the values from storage_mode_t. For more information, see
│ │ │ -storage allocation.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- userdata
│ │ │ -- The userdata parameter is optional and will be passed on to the
│ │ │ -extension constructor functions, if any
│ │ │ -(see torrent_handle::add_extension()). It will also be stored in the
│ │ │ -torrent object and can be retrieved by calling userdata().
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- file_priorities
│ │ │ -- can be set to control the initial file priorities when adding a
│ │ │ -torrent. The semantics are the same as for
│ │ │ -torrent_handle::prioritize_files(). The file priorities specified
│ │ │ -in here take precedence over those specified in the resume data, if
│ │ │ -any.
│ │ │ -If this vector of file priorities is shorter than the number of files
│ │ │ -in the torrent, the remaining files (not covered by this) will still
│ │ │ -have the default download priority. This default can be changed by
│ │ │ -setting the default_dont_download torrent_flag.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- trackerid
│ │ │ -- the default tracker id to be used when announcing to trackers. By
│ │ │ -default this is empty, and no tracker ID is used, since this is an
│ │ │ -optional argument. If a tracker returns a tracker ID, that ID is used
│ │ │ -instead of this.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- flags
│ │ │ -flags controlling aspects of this torrent and how it's added. See
│ │ │ -torrent_flags_t for details.
│ │ │ -
│ │ │ -
Note
│ │ │ -
The flags field is initialized with default flags by the
│ │ │ -constructor. In order to preserve default behavior when clearing or
│ │ │ -setting other flags, make sure to bitwise OR or in a flag or bitwise
│ │ │ -AND the inverse of a flag to clear it.
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- info_hashes
│ │ │ -- set this to the info hash of the torrent to add in case the info-hash
│ │ │ -is the only known property of the torrent. i.e. you don't have a
│ │ │ -.torrent file nor a magnet link.
│ │ │ -To add a magnet link, use parse_magnet_uri() to populate fields in the
│ │ │ -add_torrent_params object.
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- max_uploads max_connections
│ │ │ -max_uploads, max_connections, upload_limit,
│ │ │ -download_limit correspond to the set_max_uploads(),
│ │ │ -set_max_connections(), set_upload_limit() and
│ │ │ -set_download_limit() functions on torrent_handle. These values let
│ │ │ -you initialize these settings when the torrent is added, instead of
│ │ │ -calling these functions immediately following adding it.
│ │ │ --1 means unlimited on these settings just like their counterpart
│ │ │ -functions on torrent_handle
│ │ │ -For fine grained control over rate limits, including making them apply
│ │ │ -to local peers, see peer classes.
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- upload_limit download_limit
│ │ │ -- the upload and download rate limits for this torrent, specified in
│ │ │ -bytes per second. -1 means unlimited.
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- total_uploaded total_downloaded
│ │ │ -- the total number of bytes uploaded and downloaded by this torrent so
│ │ │ -far.
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- active_time finished_time seeding_time
│ │ │ -- the number of seconds this torrent has spent in started, finished and
│ │ │ -seeding state so far, respectively.
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- added_time completed_time
│ │ │ -- if set to a non-zero value, this is the posix time of when this torrent
│ │ │ -was first added, including previous runs/sessions. If set to zero, the
│ │ │ -internal added_time will be set to the time of when add_torrent() is
│ │ │ -called.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- last_seen_complete
│ │ │ -- if set to non-zero, initializes the time (expressed in posix time) when
│ │ │ -we last saw a seed or peers that together formed a complete copy of the
│ │ │ -torrent. If left set to zero, the internal counterpart to this field
│ │ │ -will be updated when we see a seed or a distributed copies >= 1.0.
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- num_complete num_incomplete num_downloaded
│ │ │ -these field can be used to initialize the torrent's cached scrape data.
│ │ │ -The scrape data is high level metadata about the current state of the
│ │ │ -swarm, as returned by the tracker (either when announcing to it or by
│ │ │ -sending a specific scrape request). num_complete is the number of
│ │ │ -peers in the swarm that are seeds, or have every piece in the torrent.
│ │ │ -num_incomplete is the number of peers in the swarm that do not have
│ │ │ -every piece. num_downloaded is the number of times the torrent has
│ │ │ -been downloaded (not initiated, but the number of times a download has
│ │ │ -completed).
│ │ │ -Leaving any of these values set to -1 indicates we don't know, or we
│ │ │ -have not received any scrape data.
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- http_seeds url_seeds
│ │ │ -URLs can be added to these two lists to specify additional web
│ │ │ -seeds to be used by the torrent. If the flag_override_web_seeds
│ │ │ -is set, these will be the _only_ ones to be used. i.e. any web seeds
│ │ │ -found in the .torrent file will be overridden.
│ │ │ -http_seeds expects URLs to web servers implementing the original HTTP
│ │ │ -seed specification BEP 17.
│ │ │ -url_seeds expects URLs to regular web servers, aka "get right" style,
│ │ │ -specified in BEP 19.
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- peers
│ │ │ -- peers to add to the torrent, to be tried to be connected to as
│ │ │ -bittorrent peers.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- banned_peers
│ │ │ -- peers banned from this torrent. The will not be connected to
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- unfinished_pieces
│ │ │ -- this is a map of partially downloaded piece. The key is the piece index
│ │ │ -and the value is a bitfield where each bit represents a 16 kiB block.
│ │ │ -A set bit means we have that block.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- have_pieces
│ │ │ -- this is a bitfield indicating which pieces we already have of this
│ │ │ -torrent.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- verified_pieces
│ │ │ -- when in seed_mode, pieces with a set bit in this bitfield have been
│ │ │ -verified to be valid. Other pieces will be verified the first time a
│ │ │ -peer requests it.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- piece_priorities
│ │ │ -- this sets the priorities for each individual piece in the torrent. Each
│ │ │ -element in the vector represent the piece with the same index. If you
│ │ │ -set both file- and piece priorities, file priorities will take
│ │ │ -precedence.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- merkle_trees
│ │ │ -- v2 hashes, if known
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- merkle_tree_mask
│ │ │ -- if set, indicates which hashes are included in the corresponding
│ │ │ -vector of merkle_trees. These bitmasks always cover the full
│ │ │ -tree, a cleared bit means the hash is all zeros (i.e. not set) and
│ │ │ -set bit means the next hash in the corresponding vector in
│ │ │ -merkle_trees is the hash for that node. This is an optimization
│ │ │ -to avoid storing a lot of zeros.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- verified_leaf_hashes
│ │ │ -- bit-fields indicating which v2 leaf hashes have been verified
│ │ │ -against the root hash. If this vector is empty and merkle_trees is
│ │ │ -non-empty it implies that all hashes in merkle_trees are verified.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- renamed_files
│ │ │ -- this is a map of file indices in the torrent and new filenames to be
│ │ │ -applied before the torrent is added.
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- last_download last_upload
│ │ │ -- the posix time of the last time payload was received or sent for this
│ │ │ -torrent, respectively. A value of 0 means we don't know when we last
│ │ │ -uploaded or downloaded, or we have never uploaded or downloaded any
│ │ │ -payload for this torrent.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
bdecode_node
│ │ │ -
Declared in "libtorrent/bdecode.hpp"
│ │ │ -
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 (bdecode_node&&) noexcept;
│ │ │ - bdecode_node& operator= (bdecode_node const&) &;
│ │ │ - bdecode_node& operator= (bdecode_node&&) & = default;
│ │ │ - type_t type () const noexcept;
│ │ │ - explicit operator bool () const noexcept;
│ │ │ - bdecode_node non_owning () const;
│ │ │ - std::ptrdiff_t data_offset () const noexcept;
│ │ │ - span<char const> data_section () const noexcept;
│ │ │ - int list_size () const;
│ │ │ - string_view list_string_value_at (int i
│ │ │ - , string_view default_val = string_view()) const;
│ │ │ - std::int64_t list_int_value_at (int i
│ │ │ - , std::int64_t default_val = 0) const;
│ │ │ - bdecode_node list_at (int i) const;
│ │ │ - bdecode_node dict_find (string_view key) const;
│ │ │ - std::int64_t dict_find_int_value (string_view key
│ │ │ - , std::int64_t default_val = 0) const;
│ │ │ - std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;
│ │ │ - int dict_size () const;
│ │ │ - string_view dict_find_string_value (string_view key
│ │ │ - , string_view default_value = string_view()) const;
│ │ │ - bdecode_node dict_find_list (string_view key) const;
│ │ │ - bdecode_node dict_find_int (string_view key) const;
│ │ │ - std::pair<string_view, bdecode_node> dict_at (int i) const;
│ │ │ - bdecode_node dict_find_dict (string_view key) const;
│ │ │ - bdecode_node dict_find_string (string_view key) const;
│ │ │ - std::int64_t int_value () const;
│ │ │ - int string_length () const;
│ │ │ - char const* string_ptr () const;
│ │ │ - std::ptrdiff_t string_offset () const;
│ │ │ - string_view string_value () 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;
│ │ │ -
│ │ │ - enum type_t
│ │ │ - {
│ │ │ - none_t,
│ │ │ - dict_t,
│ │ │ - list_t,
│ │ │ - string_t,
│ │ │ - int_t,
│ │ │ - };
│ │ │ -};
│ │ │ -
│ │ │ -
[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 (bdecode_node&&) noexcept;
│ │ │ -bdecode_node& operator= (bdecode_node const&) &;
│ │ │ -bdecode_node& operator= (bdecode_node&&) & = default;
│ │ │ -
│ │ │ -
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]
│ │ │ -
│ │ │ -
bool()
│ │ │ -
│ │ │ -explicit operator bool () const noexcept;
│ │ │ -
│ │ │ -
returns true if type() != none_t.
│ │ │ -
[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_offset() data_section()
│ │ │ -
│ │ │ -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_string_value_at() list_int_value_at() list_at() list_size()
│ │ │ -
│ │ │ -int list_size () const;
│ │ │ -string_view list_string_value_at (int i
│ │ │ - , string_view default_val = string_view()) const;
│ │ │ -std::int64_t list_int_value_at (int i
│ │ │ - , std::int64_t default_val = 0) 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() dict_find_dict() dict_find_int_value() dict_find_int() dict_find_list() dict_find_string_value() dict_at_node() dict_at() dict_size() dict_find_string()
│ │ │ -
│ │ │ -bdecode_node dict_find (string_view key) const;
│ │ │ -std::int64_t dict_find_int_value (string_view key
│ │ │ - , std::int64_t default_val = 0) const;
│ │ │ -std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;
│ │ │ -int dict_size () const;
│ │ │ -string_view dict_find_string_value (string_view key
│ │ │ - , string_view default_value = string_view()) const;
│ │ │ -bdecode_node dict_find_list (string_view key) const;
│ │ │ -bdecode_node dict_find_int (string_view key) const;
│ │ │ -std::pair<string_view, bdecode_node> dict_at (int i) const;
│ │ │ -bdecode_node dict_find_dict (string_view key) const;
│ │ │ -bdecode_node dict_find_string (string_view key) 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 than the nodes. In case the node is not found, or it has
│ │ │ -a different type, a default value is returned (which can be specified).
│ │ │ -
dict_at() returns the (key, value)-pair at the specified index in a
│ │ │ -dictionary. Keys are only allowed to be strings. dict_at_node() also
│ │ │ -returns the (key, value)-pair, but the key is returned as a
│ │ │ -bdecode_node (and it will always be a 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_value() string_length() string_ptr() string_offset()
│ │ │ -
│ │ │ -int string_length () const;
│ │ │ -char const* string_ptr () const;
│ │ │ -std::ptrdiff_t string_offset () const;
│ │ │ -string_view string_value () 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()
│ │ │ -
│ │ │ -void clear ();
│ │ │ -
│ │ │ -
resets the bdecoded_node to a default constructed state. If this is
│ │ │ -an owning node, the tree is freed and all child nodes are invalidated.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
swap()
│ │ │ -
│ │ │ -void swap (bdecode_node& n);
│ │ │ -
│ │ │ -
Swap contents.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
reserve()
│ │ │ -
│ │ │ -void reserve (int tokens);
│ │ │ -
│ │ │ -
preallocate memory for the specified numbers of tokens. This is
│ │ │ -useful if you know approximately how many tokens are in the file
│ │ │ -you are about to parse. Doing so will save realloc operations
│ │ │ -while parsing. You should only call this on the root node, before
│ │ │ -passing it in to bdecode().
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
switch_underlying_buffer()
│ │ │ -
│ │ │ -void switch_underlying_buffer (char const* buf) noexcept;
│ │ │ -
│ │ │ -
this buffer MUST be identical to the one originally parsed. This
│ │ │ -operation is only defined on owning root nodes, i.e. the one passed in to
│ │ │ -decode().
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
has_soft_error()
│ │ │ -
│ │ │ -bool has_soft_error (span<char> error) const;
│ │ │ -
│ │ │ -
returns true if there is a non-fatal error in the bencoding of this node
│ │ │ -or its children
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum type_t
│ │ │ -
Declared in "libtorrent/bdecode.hpp"
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| name |
│ │ │ -value |
│ │ │ -description |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| none_t |
│ │ │ -0 |
│ │ │ -uninitialized or default constructed. This is also used
│ │ │ -to indicate that a node was not found in some cases. |
│ │ │ -
│ │ │ -| dict_t |
│ │ │ -1 |
│ │ │ -a dictionary node. The dict_find_ functions are valid. |
│ │ │ -
│ │ │ -| list_t |
│ │ │ -2 |
│ │ │ -a list node. The list_ functions are valid. |
│ │ │ -
│ │ │ -| string_t |
│ │ │ -3 |
│ │ │ -a string node, the string_ functions are valid. |
│ │ │ -
│ │ │ -| int_t |
│ │ │ -4 |
│ │ │ -an integer node. The int_ functions are valid. |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
print_entry()
│ │ │ -
Declared in "libtorrent/bdecode.hpp"
│ │ │ -
│ │ │ -std::string print_entry (bdecode_node const& e
│ │ │ - , bool single_line = false, int indent = 0);
│ │ │ -
│ │ │ -
print the bencoded structure in a human-readable format to a string
│ │ │ -that's returned.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
bdecode()
│ │ │ -
Declared in "libtorrent/bdecode.hpp"
│ │ │ -
│ │ │ -bdecode_node bdecode (span<char const> buffer
│ │ │ - , error_code& ec, int* error_pos = nullptr, int depth_limit = 100
│ │ │ - , int token_limit = 2000000);
│ │ │ -bdecode_node bdecode (span<char const> buffer
│ │ │ - , int depth_limit = 100, int token_limit = 2000000);
│ │ │ -int bdecode (char const* start, char const* end, bdecode_node& ret
│ │ │ - , error_code& ec, int* error_pos = nullptr, int depth_limit = 100
│ │ │ - , int token_limit = 2000000);
│ │ │ -
│ │ │ -
This function decodes/parses bdecoded data (for example a .torrent file).
│ │ │ -The data structure is returned in the ret argument. the buffer to parse
│ │ │ -is specified by the start of the buffer as well as the end, i.e. one
│ │ │ -byte past the end. If the buffer fails to parse, the function returns a
│ │ │ -non-zero value and fills in ec with the error code. The optional
│ │ │ -argument error_pos, if set to non-nullptr, will be set to the byte offset
│ │ │ -into the buffer where the parse failure occurred.
│ │ │ -
depth_limit specifies the max number of nested lists or dictionaries are
│ │ │ -allowed in the data structure. (This affects the stack usage of the
│ │ │ -function, be careful not to set it too high).
│ │ │ -
token_limit is the max number of tokens allowed to be parsed from the
│ │ │ -buffer. This is simply a sanity check to not have unbounded memory usage.
│ │ │ -
The resulting bdecode_node is an owning node. That means it will
│ │ │ -be holding the whole parsed tree. When iterating lists and dictionaries,
│ │ │ -those bdecode_node objects will simply have references to the root or
│ │ │ -owning bdecode_node. If the root node is destructed, all other nodes
│ │ │ -that refer to anything in that tree become invalid.
│ │ │ -
However, the underlying buffer passed in to this function (start, end)
│ │ │ -must also remain valid while the bdecoded tree is used. The parsed tree
│ │ │ -produced by this function does not copy any data out of the buffer, but
│ │ │ -simply produces references back into it.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
announce_infohash
│ │ │ -
Declared in "libtorrent/announce_entry.hpp"
│ │ │ -
│ │ │ -struct announce_infohash
│ │ │ -{
│ │ │ - std::string message;
│ │ │ - error_code last_error;
│ │ │ - int scrape_incomplete = -1;
│ │ │ - int scrape_complete = -1;
│ │ │ - int scrape_downloaded = -1;
│ │ │ - std::uint8_t fails : 7;
│ │ │ - bool updating : 1;
│ │ │ - bool start_sent : 1;
│ │ │ - bool complete_sent : 1;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- message
│ │ │ -- if this tracker has returned an error or warning message
│ │ │ -that message is stored here
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- last_error
│ │ │ -- if this tracker failed the last time it was contacted
│ │ │ -this error code specifies what error occurred
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- scrape_incomplete scrape_complete scrape_downloaded
│ │ │ -- if this tracker has returned scrape data, these fields are filled in
│ │ │ -with valid numbers. Otherwise they are set to -1. incomplete counts
│ │ │ -the number of current downloaders. complete counts the number of
│ │ │ -current peers completed the download, or "seeds". downloaded is the
│ │ │ -cumulative number of completed downloads.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- fails
│ │ │ -- the number of times in a row we have failed to announce to this
│ │ │ -tracker.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- updating
│ │ │ -- true while we're waiting for a response from the tracker.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- start_sent
│ │ │ -- set to true when we get a valid response from an announce
│ │ │ -with event=started. If it is set, we won't send start in the subsequent
│ │ │ -announces.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- complete_sent
│ │ │ -- set to true when we send a event=completed.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
announce_endpoint
│ │ │ -
Declared in "libtorrent/announce_entry.hpp"
│ │ │ -
announces are sent to each tracker using every listen socket
│ │ │ -this class holds information about one listen socket for one tracker
│ │ │ -
│ │ │ -struct announce_endpoint
│ │ │ -{
│ │ │ - announce_endpoint ();
│ │ │ -
│ │ │ - tcp::endpoint local_endpoint;
│ │ │ - aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;
│ │ │ - bool enabled = true;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- local_endpoint
│ │ │ -- the local endpoint of the listen interface associated with this endpoint
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- info_hashes
│ │ │ -- info_hashes[0] is the v1 info hash (SHA1)
│ │ │ -info_hashes[1] is the v2 info hash (truncated SHA-256)
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- enabled
│ │ │ -- set to false to not announce from this endpoint
│ │ │ -
│ │ │ -
[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& operator= (announce_entry const&) &;
│ │ │ - explicit announce_entry (string_view u);
│ │ │ - announce_entry (announce_entry const&);
│ │ │ -
│ │ │ - enum tracker_source
│ │ │ - {
│ │ │ - source_torrent,
│ │ │ - source_client,
│ │ │ - source_magnet_link,
│ │ │ - source_tex,
│ │ │ - };
│ │ │ -
│ │ │ - std::string url;
│ │ │ - std::string trackerid;
│ │ │ - std::vector<announce_endpoint> endpoints;
│ │ │ - 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& operator= (announce_entry const&) &;
│ │ │ -explicit announce_entry (string_view u);
│ │ │ -announce_entry (announce_entry const&);
│ │ │ -
│ │ │ -
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 |
│ │ │ -
│ │ │ -| source_client |
│ │ │ -2 |
│ │ │ -the tracker was added programmatically via the add_tracker() function |
│ │ │ -
│ │ │ -| source_magnet_link |
│ │ │ -4 |
│ │ │ -the tracker was part of a magnet link |
│ │ │ -
│ │ │ -| source_tex |
│ │ │ -8 |
│ │ │ -the tracker was received from the swarm via tracker exchange |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- url
│ │ │ -- tracker URL as it appeared in the torrent file
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- trackerid
│ │ │ -- the current &trackerid= argument passed to the tracker.
│ │ │ -this is optional and is normally empty (in which case no
│ │ │ -trackerid is sent).
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- endpoints
│ │ │ -- each local listen socket (endpoint) will announce to the tracker. This
│ │ │ -list contains state per endpoint.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- tier
│ │ │ -- the tier this tracker belongs to
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- fail_limit
│ │ │ -- the max number of failures to announce to this tracker in
│ │ │ -a row, before this tracker is not used anymore. 0 means unlimited
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- source
│ │ │ -- a bitmask specifying which sources we got this tracker from.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- verified
│ │ │ -- set to true the first time we receive a valid response
│ │ │ -from this tracker.
│ │ │ -
│ │ │ -
The pop_alerts() function on session is the main interface for retrieving
│ │ │ -alerts (warnings, messages and errors from libtorrent). If no alerts have
│ │ │ -been posted by libtorrent pop_alerts() will return an empty list.
│ │ │ -
By default, only errors are reported. settings_pack::alert_mask can be
│ │ │ -used to specify which kinds of events should be reported. The alert mask is
│ │ │ -a combination of the alert_category_t flags in the alert class.
│ │ │ -
Every alert belongs to one or more category. There is a cost associated with
│ │ │ -posting alerts. Only alerts that belong to an enabled category are
│ │ │ -posted. Setting the alert bitmask to 0 will disable all alerts (except those
│ │ │ -that are non-discardable). Alerts that are responses to API calls such as
│ │ │ -save_resume_data() and post_session_stats() are non-discardable and will be
│ │ │ -posted even if their category is disabled.
│ │ │ -
There are other alert base classes that some alerts derive from, all the
│ │ │ -alerts that are generated for a specific torrent are derived from
│ │ │ -torrent_alert, and tracker events derive from tracker_alert.
│ │ │ -
Alerts returned by pop_alerts() are only valid until the next call to
│ │ │ -pop_alerts(). You may not copy an alert object to access it after the next
│ │ │ -call to pop_alerts(). Internal members of alerts also become invalid once
│ │ │ -pop_alerts() is called again.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
dht_routing_bucket
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
struct to hold information about a single DHT routing table bucket
│ │ │ -
│ │ │ -struct dht_routing_bucket
│ │ │ -{
│ │ │ - int num_nodes = 0;
│ │ │ - int num_replacements = 0;
│ │ │ - int last_active = 0;
│ │ │ -};
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- num_nodes num_replacements
│ │ │ -- the total number of nodes and replacement nodes
│ │ │ -in the routing table
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- last_active
│ │ │ -- number of seconds since last activity
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
torrent_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is a base class for alerts that are associated with a
│ │ │ -specific torrent. It contains a handle to the torrent.
│ │ │ -
Note that by the time the client receives a torrent_alert, its
│ │ │ -handle member may be invalid.
│ │ │ -
│ │ │ -struct torrent_alert : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* torrent_name () const;
│ │ │ -
│ │ │ - torrent_handle handle;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
message()
│ │ │ -
│ │ │ -std::string message () const override;
│ │ │ -
│ │ │ -
returns the message associated with this alert
│ │ │ -
[report issue]
│ │ │ -- handle
│ │ │ -- The torrent_handle pointing to the torrent this
│ │ │ -alert is associated with.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
peer_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
The peer alert is a base class for alerts that refer to a specific peer. It includes all
│ │ │ -the information to identify the peer. i.e. ip and peer-id.
│ │ │ -
│ │ │ -struct peer_alert : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - aux::noexcept_movable<tcp::endpoint> endpoint;
│ │ │ - peer_id pid;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- endpoint
│ │ │ -- The peer's IP address and port.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- pid
│ │ │ -- the peer ID, if known.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
tracker_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is a base class used for alerts that are associated with a
│ │ │ -specific tracker. It derives from torrent_alert since a tracker
│ │ │ -is also associated with a specific torrent.
│ │ │ -
│ │ │ -struct tracker_alert : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* tracker_url () const;
│ │ │ -
│ │ │ - aux::noexcept_movable<tcp::endpoint> local_endpoint;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
tracker_url()
│ │ │ -
│ │ │ -char const* tracker_url () const;
│ │ │ -
│ │ │ -
returns a 0-terminated string of the tracker's URL
│ │ │ -
[report issue]
│ │ │ -- local_endpoint
│ │ │ -- endpoint of the listen interface being announced
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
torrent_removed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
The torrent_removed_alert is posted whenever a torrent is removed. Since
│ │ │ -the torrent handle in its base class will usually be invalid (since the torrent
│ │ │ -is already removed) it has the info hash as a member, to identify it.
│ │ │ -It's posted when the alert_category::status bit is set in the alert_mask.
│ │ │ -
Note that the handle remains valid for some time after
│ │ │ -torrent_removed_alert is posted, as long as some internal libtorrent
│ │ │ -task (such as an I/O task) refers to it. Additionally, other alerts like
│ │ │ -save_resume_data_alert may be posted after torrent_removed_alert.
│ │ │ -To synchronize on whether the torrent has been removed or not, call
│ │ │ -torrent_handle::in_session(). This will return true before
│ │ │ -torrent_removed_alert is posted, and false afterward.
│ │ │ -
Even though the handle member doesn't point to an existing torrent anymore,
│ │ │ -it is still useful for comparing to other handles, which may also no
│ │ │ -longer point to existing torrents, but to the same non-existing torrents.
│ │ │ -
The torrent_handle acts as a weak_ptr, even though its object no
│ │ │ -longer exists, it can still compare equal to another weak pointer which
│ │ │ -points to the same non-existent object.
│ │ │ -
│ │ │ -struct torrent_removed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - info_hash_t info_hashes;
│ │ │ - client_data_t userdata;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- userdata
│ │ │ -- 'userdata` as set in add_torrent_params at torrent creation.
│ │ │ -This can be used to associate this torrent with related data
│ │ │ -in the client application more efficiently than info_hashes.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
read_piece_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted when the asynchronous read operation initiated by
│ │ │ -a call to torrent_handle::read_piece() is completed. If the read failed, the torrent
│ │ │ -is paused and an error state is set and the buffer member of the alert
│ │ │ -is 0. If successful, buffer points to a buffer containing all the data
│ │ │ -of the piece. piece is the piece index that was read. size is the
│ │ │ -number of bytes that was read.
│ │ │ -
If the operation fails, error will indicate what went wrong.
│ │ │ -
│ │ │ -struct read_piece_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ - error_code const error;
│ │ │ - boost::shared_array<char> const buffer;
│ │ │ - piece_index_t const piece;
│ │ │ - int const size;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
file_completed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is posted whenever an individual file completes its download. i.e.
│ │ │ -All pieces overlapping this file have passed their hash check.
│ │ │ -
│ │ │ -struct file_completed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - file_index_t const index;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- index
│ │ │ -- refers to the index of the file that completed.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
file_renamed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is posted as a response to a torrent_handle::rename_file() call, if the rename
│ │ │ -operation succeeds.
│ │ │ -
│ │ │ -struct file_renamed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* old_name () const;
│ │ │ - char const* new_name () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ - file_index_t const index;
│ │ │ -};
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
new_name() old_name()
│ │ │ -
│ │ │ -char const* old_name () const;
│ │ │ -char const* new_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]
│ │ │ -
│ │ │ -
│ │ │ -
file_rename_failed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is posted as a response to a torrent_handle::rename_file() call, if the rename
│ │ │ -operation failed.
│ │ │ -
│ │ │ -struct file_rename_failed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ - file_index_t const index;
│ │ │ - error_code const error;
│ │ │ -};
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- index error
│ │ │ -- refers to the index of the file that was supposed to be renamed,
│ │ │ -error is the error code returned from the filesystem.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
state_changed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
Generated whenever a torrent changes its state.
│ │ │ -
│ │ │ -struct state_changed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - torrent_status::state_t const state;
│ │ │ - torrent_status::state_t const prev_state;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- state
│ │ │ -- the new state of the torrent.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- prev_state
│ │ │ -- the previous state.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
tracker_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated on tracker time outs, premature disconnects,
│ │ │ -invalid response or a HTTP response other than "200 OK". From the alert
│ │ │ -you can get the handle to the torrent the tracker belongs to.
│ │ │ -
│ │ │ -struct tracker_error_alert final : tracker_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* failure_reason () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::tracker | alert_category::error;
│ │ │ - int const times_in_row;
│ │ │ - error_code const error;
│ │ │ - operation_t op;
│ │ │ - protocol_version version;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
failure_reason()
│ │ │ -
│ │ │ -char const* failure_reason () const;
│ │ │ -
│ │ │ -
if the tracker sent a "failure reason" string, it will be returned
│ │ │ -here.
│ │ │ -
[report issue]
│ │ │ -- times_in_row
│ │ │ -- This member says how many times in a row this tracker has failed.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error code indicating why the tracker announce failed. If it is
│ │ │ -is lt::errors::tracker_failure the failure_reason() might contain
│ │ │ -a more detailed description of why the tracker rejected the request.
│ │ │ -HTTP status codes indicating errors are also set in this field.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- version
│ │ │ -- the bittorrent protocol version that was announced
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
tracker_warning_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is triggered if the tracker reply contains a warning field.
│ │ │ -Usually this means that the tracker announce was successful, but the
│ │ │ -tracker has a message to the client.
│ │ │ -
│ │ │ -struct tracker_warning_alert final : tracker_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* warning_message () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::tracker | alert_category::error;
│ │ │ - protocol_version version;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
warning_message()
│ │ │ -
│ │ │ -char const* warning_message () const;
│ │ │ -
│ │ │ -
the message associated with this warning
│ │ │ -
[report issue]
│ │ │ -- version
│ │ │ -- the bittorrent protocol version that was announced
│ │ │ -
│ │ │ -
[report issue]
│ │ │
│ │ │ -
│ │ │ -
scrape_reply_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a scrape request succeeds.
│ │ │ -
│ │ │ -struct scrape_reply_alert final : tracker_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::tracker;
│ │ │ - int const incomplete;
│ │ │ - int const complete;
│ │ │ - protocol_version version;
│ │ │ -};
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- incomplete complete
│ │ │ -- the data returned in the scrape response. These numbers
│ │ │ -may be -1 if the response was malformed.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- version
│ │ │ -- the bittorrent protocol version that was scraped
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
scrape_failed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
If a scrape request fails, this alert is generated. This might be due
│ │ │ -to the tracker timing out, refusing connection or returning an http response
│ │ │ -code indicating an error.
│ │ │ -
│ │ │ -struct scrape_failed_alert final : tracker_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* error_message () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::tracker | alert_category::error;
│ │ │ - error_code const error;
│ │ │ - protocol_version version;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
error_message()
│ │ │ -
│ │ │ -char const* error_message () const;
│ │ │ -
│ │ │ -
if the error indicates there is an associated message, this returns
│ │ │ -that message. Otherwise and empty string.
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error itself. This may indicate that the tracker sent an error
│ │ │ -message (error::tracker_failure), in which case it can be
│ │ │ -retrieved by calling error_message().
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- version
│ │ │ -- the bittorrent protocol version that was scraped
│ │ │ -
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
a word of caution
│ │ │ +
Writing your own plugin is a very easy way to introduce serious bugs such as
│ │ │ +dead locks and race conditions. Since a plugin has access to internal
│ │ │ +structures it is also quite easy to sabotage libtorrent's operation.
│ │ │ +
All the callbacks are always called from the libtorrent network thread. In
│ │ │ +case portions of your plugin are called from other threads, typically the main
│ │ │ +thread, you cannot use any of the member functions on the internal structures
│ │ │ +in libtorrent, since those require being called from the libtorrent network
│ │ │ +thread . Furthermore, you also need to synchronize your own shared data
│ │ │ +within the plugin, to make sure it is not accessed at the same time from the
│ │ │ +libtorrent thread (through a callback). If you need to send out a message
│ │ │ +from another thread, it is advised to use an internal queue, and do the
│ │ │ +actual sending in tick().
│ │ │ +
Since the plugin interface gives you easy access to internal structures, it
│ │ │ +is not supported as a stable API. Plugins should be considered specific to a
│ │ │ +specific version of libtorrent. Although, in practice the internals mostly
│ │ │ +don't change that dramatically.
│ │ │
│ │ │ -
│ │ │ -
tracker_reply_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is only for informational purpose. It is generated when a tracker announce
│ │ │ -succeeds. It is generated regardless what kind of tracker was used, be it UDP, HTTP or
│ │ │ -the DHT.
│ │ │ -
│ │ │ -struct tracker_reply_alert final : tracker_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::tracker;
│ │ │ - int const num_peers;
│ │ │ - protocol_version version;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- num_peers
│ │ │ -- tells how many peers the tracker returned in this response. This is
│ │ │ -not expected to be greater than the num_want settings. These are not necessarily
│ │ │ -all new peers, some of them may already be connected.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- version
│ │ │ -- the bittorrent protocol version that was announced
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_reply_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated each time the DHT receives peers from a node. num_peers
│ │ │ -is the number of peers we received in this packet. Typically these packets are
│ │ │ -received from multiple DHT nodes, and so the alerts are typically generated
│ │ │ -a few at a time.
│ │ │ -
│ │ │ -struct dht_reply_alert final : tracker_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht | alert_category::tracker;
│ │ │ - int const num_peers;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
tracker_announce_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated each time a tracker announce is sent (or attempted to be sent).
│ │ │ -There are no extra data members in this alert. The url can be found in the base class
│ │ │ -however.
│ │ │ -
│ │ │ -struct tracker_announce_alert final : tracker_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::tracker;
│ │ │ - event_t const event;
│ │ │ - protocol_version version;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- event
│ │ │ -- specifies what event was sent to the tracker. See event_t.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- version
│ │ │ -- the bittorrent protocol version that is announced
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
hash_failed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a finished piece fails its hash check. You can get the handle
│ │ │ -to the torrent which got the failed piece and the index of the piece itself from the alert.
│ │ │ -
│ │ │ -struct hash_failed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - piece_index_t const piece_index;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
peer_ban_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a peer is banned because it has sent too many corrupt pieces
│ │ │ -to us. ip is the endpoint to the peer that was banned.
│ │ │ -
│ │ │ -struct peer_ban_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
peer_unsnubbed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a peer is un-snubbed. Essentially when it was snubbed for stalling
│ │ │ -sending data, and now it started sending data again.
│ │ │ -
│ │ │ -struct peer_unsnubbed_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
peer_snubbed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a peer is snubbed, when it stops sending data when we request
│ │ │ -it.
│ │ │ -
│ │ │ -struct peer_snubbed_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
peer_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a peer sends invalid data over the peer-peer protocol. The peer
│ │ │ -will be disconnected, but you get its ip address from the alert, to identify it.
│ │ │ -
│ │ │ -struct peer_error_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ - operation_t op;
│ │ │ - error_code const error;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- op
│ │ │ -- a 0-terminated string of the low-level operation that failed, or nullptr if
│ │ │ -there was no low level disk operation.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- tells you what error caused this alert.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
peer_connect_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted every time an incoming peer connection both
│ │ │ -successfully passes the protocol handshake and is associated with a
│ │ │ -torrent, or an outgoing peer connection attempt succeeds. For arbitrary
│ │ │ -incoming connections, see incoming_connection_alert.
│ │ │ -
│ │ │ -struct peer_connect_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - enum direction_t
│ │ │ - {
│ │ │ - in,
│ │ │ - out,
│ │ │ - };
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::connect;
│ │ │ - direction_t direction;
│ │ │ - socket_type_t socket_type;
│ │ │ -};
│ │ │ +
│ │ │ +
plugin-interface
│ │ │ +
The plugin interface consists of three base classes that the plugin may
│ │ │ +implement. These are called plugin, torrent_plugin and peer_plugin.
│ │ │ +They are found in the <libtorrent/extensions.hpp> header.
│ │ │ +
These plugins are instantiated for each session, torrent and possibly each peer,
│ │ │ +respectively.
│ │ │ +
For plugins that only need per torrent state, it is enough to only implement
│ │ │ +torrent_plugin and pass a constructor function or function object to
│ │ │ +session::add_extension() or torrent_handle::add_extension() (if the
│ │ │ +torrent has already been started and you want to hook in the extension at
│ │ │ +run-time).
│ │ │ +
The signature of the function is:
│ │ │ +
│ │ │ +std::shared_ptr<torrent_plugin> (*)(torrent_handle const&, client_data_t);
│ │ │
│ │ │ -
[report issue]
│ │ │ -
enum direction_t
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| name |
│ │ │ -value |
│ │ │ -description |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| in |
│ │ │ -0 |
│ │ │ - |
│ │ │ -
│ │ │ -| out |
│ │ │ -1 |
│ │ │ - |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- direction
│ │ │ -- Tells you if the peer was incoming or outgoing
│ │ │ -
│ │ │ -
[report issue]
│ │ │ +
The second argument is the userdata passed to session::add_torrent() or
│ │ │ +torrent_handle::add_extension().
│ │ │ +
The function should return a std::shared_ptr<torrent_plugin> which
│ │ │ +may or may not be 0. If it is a nullptr, the extension is simply ignored
│ │ │ +for this torrent. If it is a valid pointer (to a class inheriting
│ │ │ +torrent_plugin), it will be associated with this torrent and callbacks
│ │ │ +will be made on torrent events.
│ │ │ +
For more elaborate plugins which require session wide state, you would
│ │ │ +implement plugin, construct an object (in a std::shared_ptr) and pass
│ │ │ +it in to session::add_extension().
│ │ │
│ │ │ -
│ │ │ -
peer_disconnected_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a peer is disconnected for any reason (other than the ones
│ │ │ -covered by peer_error_alert ).
│ │ │ +
│ │ │ +
custom alerts
│ │ │ +
Since plugins are running within internal libtorrent threads, one convenient
│ │ │ +way to communicate with the client is to post custom alerts.
│ │ │ +
The expected interface of any alert, apart from deriving from the alert
│ │ │ +base class, looks like this:
│ │ │
│ │ │ -struct peer_disconnected_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ +static const int alert_type = <unique alert ID>;
│ │ │ +virtual int type() const { return alert_type; }
│ │ │
│ │ │ - static constexpr alert_category_t static_category = alert_category::connect;
│ │ │ - socket_type_t const socket_type;
│ │ │ - operation_t const op;
│ │ │ - error_code const error;
│ │ │ - close_reason_t const reason;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- socket_type
│ │ │ -- the kind of socket this peer was connected over
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- op
│ │ │ -- the operation or level where the error occurred. Specified as an
│ │ │ -value from the operation_t enum. Defined in operations.hpp.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- tells you what error caused peer to disconnect.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- reason
│ │ │ -- the reason the peer disconnected (if specified)
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
invalid_request_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is a debug alert that is generated by an incoming invalid piece request.
│ │ │ -ip is the address of the peer and the request is the actual incoming
│ │ │ -request from the peer. See peer_request for more info.
│ │ │ -
│ │ │ -struct invalid_request_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ +virtual std::string message() const;
│ │ │
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ - peer_request const request;
│ │ │ - bool const we_have;
│ │ │ - bool const peer_interested;
│ │ │ - bool const withheld;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- request
│ │ │ -- the request we received from the peer
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- we_have
│ │ │ -- true if we have this piece
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- peer_interested
│ │ │ -- true if the peer indicated that it was interested to download before
│ │ │ -sending the request
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- withheld
│ │ │ -- if this is true, the peer is not allowed to download this piece because
│ │ │ -of super-seeding rules.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
torrent_finished_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a torrent switches from being a downloader to a seed.
│ │ │ -It will only be generated once per torrent. It contains a torrent_handle to the
│ │ │ -torrent in question.
│ │ │ -
│ │ │ -struct torrent_finished_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ +static const alert_category_t static_category = <bitmask of alert::category_t flags>;
│ │ │ +virtual alert_category_t category() const { return static_category; }
│ │ │
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ -};
│ │ │ +virtual char const* what() const { return <string literal of the name of this alert>; }
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
piece_finished_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert is posted every time a piece completes downloading
│ │ │ -and passes the hash check. This alert derives from torrent_alert
│ │ │ -which contains the torrent_handle to the torrent the piece belongs to.
│ │ │ -Note that being downloaded and passing the hash check may happen before
│ │ │ -the piece is also fully flushed to disk. So torrent_handle::have_piece()
│ │ │ -may still return false
│ │ │ +
The alert_type is used for the type-checking in alert_cast. It must
│ │ │ +not collide with any other alert. The built-in alerts in libtorrent will
│ │ │ +not use alert type IDs greater than user_alert_id. When defining your
│ │ │ +own alert, make sure it's greater than this constant.
│ │ │ +
type() is the run-time equivalence of the alert_type.
│ │ │ +
The message() virtual function is expected to construct a useful
│ │ │ +string representation of the alert and the event or data it represents.
│ │ │ +Something convenient to put in a log file for instance.
│ │ │ +
clone() is used internally to copy alerts. The suggested implementation
│ │ │ +of simply allocating a new instance as a copy of *this is all that's
│ │ │ +expected.
│ │ │ +
The static category is required for checking whether or not the category
│ │ │ +for a specific alert is enabled or not, without instantiating the alert.
│ │ │ +The category virtual function is the run-time equivalence.
│ │ │ +
The what() virtual function may simply be a string literal of the class
│ │ │ +name of your alert.
│ │ │ +
For more information, see the alert section.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
peer_connection_handle
│ │ │ +
Declared in "libtorrent/peer_connection_handle.hpp"
│ │ │ +
the peer_connection_handle class provides a handle to the internal peer
│ │ │ +connection object, to be used by plugins. This is a low level interface that
│ │ │ +may not be stable across libtorrent versions
│ │ │
│ │ │ -struct piece_finished_alert final : torrent_alert
│ │ │ +struct peer_connection_handle
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - piece_index_t const piece_index;
│ │ │ + explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);
│ │ │ + connection_type type () const;
│ │ │ + peer_plugin const* find_plugin (string_view type) const;
│ │ │ + void add_extension (std::shared_ptr<peer_plugin>);
│ │ │ + bool is_seed () const;
│ │ │ + bool upload_only () const;
│ │ │ + bool has_piece (piece_index_t i) const;
│ │ │ + peer_id const& pid () const;
│ │ │ + bool is_choked () const;
│ │ │ + bool is_interesting () const;
│ │ │ + bool is_peer_interested () const;
│ │ │ + bool has_peer_choked () const;
│ │ │ + void choke_this_peer ();
│ │ │ + void maybe_unchoke_this_peer ();
│ │ │ + void get_peer_info (peer_info& p) const;
│ │ │ + torrent_handle associated_torrent () const;
│ │ │ + tcp::endpoint local_endpoint () const;
│ │ │ + tcp::endpoint const& remote () const;
│ │ │ + bool is_outgoing () const;
│ │ │ + bool is_connecting () const;
│ │ │ + void disconnect (error_code const& ec, operation_t op
│ │ │ + , disconnect_severity_t = peer_connection_interface::normal);
│ │ │ + 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 can_disconnect (error_code const& ec) const;
│ │ │ + bool has_metadata () const;
│ │ │ + bool in_handshake () const;
│ │ │ + void send_buffer (char const* begin, int size);
│ │ │ + std::time_t last_seen_complete () const;
│ │ │ + time_point time_of_last_unchoke () const;
│ │ │ + bool operator!= (peer_connection_handle const& o) const;
│ │ │ + bool operator< (peer_connection_handle const& o) const;
│ │ │ + bool operator== (peer_connection_handle const& o) const;
│ │ │ + std::shared_ptr<peer_connection> native_handle () const;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -- piece_index
│ │ │ -- the index of the piece that finished
│ │ │ -
│ │ │ -
[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 request_dropped_alert final : peer_alert
│ │ │ +struct bt_peer_connection_handle : peer_connection_handle
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - int const block_index;
│ │ │ - piece_index_t const piece_index;
│ │ │ + explicit bt_peer_connection_handle (peer_connection_handle pc);
│ │ │ + bool packet_finished () const;
│ │ │ + bool support_extensions () const;
│ │ │ + bool supports_encryption () const;
│ │ │ + void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ + void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);
│ │ │ + std::shared_ptr<bt_peer_connection> native_handle () const;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
plugin
│ │ │ +
Declared in "libtorrent/extensions.hpp"
│ │ │ +
this is the base class for a session plugin. One primary feature
│ │ │ +is that it is notified of all torrents that are added to the session,
│ │ │ +and can add its own torrent_plugins.
│ │ │
│ │ │ -struct block_timeout_alert final : peer_alert
│ │ │ +struct plugin
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ + virtual feature_flags_t implemented_features ();
│ │ │ + virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);
│ │ │ + virtual void added (session_handle const&);
│ │ │ + virtual void abort ();
│ │ │ + virtual bool on_dht_request (string_view /* query */
│ │ │ + , udp::endpoint const& /* source */, bdecode_node const& /* message */
│ │ │ + , entry& /* response */);
│ │ │ + virtual void on_alert (alert const*);
│ │ │ + virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */
│ │ │ + , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);
│ │ │ + virtual void on_tick ();
│ │ │ + virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);
│ │ │ + virtual std::map<std::string, std::string> save_state () const;
│ │ │ + virtual void load_state (std::map<std::string, std::string> const&);
│ │ │
│ │ │ - int const block_index;
│ │ │ - piece_index_t const piece_index;
│ │ │ + static constexpr feature_flags_t optimistic_unchoke_feature = 1_bit;
│ │ │ + static constexpr feature_flags_t tick_feature = 2_bit;
│ │ │ + static constexpr feature_flags_t dht_request_feature = 3_bit;
│ │ │ + static constexpr feature_flags_t alert_feature = 4_bit;
│ │ │ + static constexpr feature_flags_t unknown_torrent_feature = 5_bit;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
block_finished_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a block request receives a response.
│ │ │ +
[report issue]
│ │ │ +
implemented_features()
│ │ │
│ │ │ -struct block_finished_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - int const block_index;
│ │ │ - piece_index_t const piece_index;
│ │ │ -};
│ │ │ +virtual feature_flags_t implemented_features ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
block_downloading_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a block request is sent to a peer.
│ │ │ +
This function is expected to return a bitmask indicating which features
│ │ │ +this plugin implements. Some callbacks on this object may not be called
│ │ │ +unless the corresponding feature flag is returned here. Note that
│ │ │ +callbacks may still be called even if the corresponding feature is not
│ │ │ +specified in the return value here. See feature_flags_t for possible
│ │ │ +flags to return.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
new_torrent()
│ │ │
│ │ │ -struct block_downloading_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - int const block_index;
│ │ │ - piece_index_t const piece_index;
│ │ │ -};
│ │ │ +virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
unwanted_block_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a block is received that was not requested or
│ │ │ -whose request timed out.
│ │ │ +
this is called by the session every time a new torrent is added.
│ │ │ +The torrent* points to the internal torrent object created
│ │ │ +for the new torrent. The client_data_t is the userdata pointer as
│ │ │ +passed in via add_torrent_params.
│ │ │ +
If the plugin returns a torrent_plugin instance, it will be added
│ │ │ +to the new torrent. Otherwise, return an empty shared_ptr to a
│ │ │ +torrent_plugin (the default).
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
added()
│ │ │
│ │ │ -struct unwanted_block_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ - int const block_index;
│ │ │ - piece_index_t const piece_index;
│ │ │ -};
│ │ │ +virtual void added (session_handle const&);
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
storage_moved_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
The storage_moved_alert is generated when all the disk IO has
│ │ │ -completed and the files have been moved, as an effect of a call to
│ │ │ -torrent_handle::move_storage. This is useful to synchronize with the
│ │ │ -actual disk. The storage_path() member return the new path of the
│ │ │ -storage.
│ │ │ +
called when plugin is added to a session
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
abort()
│ │ │
│ │ │ -struct storage_moved_alert final : torrent_alert
│ │ │ -{
│ │ │ - 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;
│ │ │ -};
│ │ │ +virtual void abort ();
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
storage_path() old_path()
│ │ │ +
called when the session is aborted
│ │ │ +the plugin should perform any cleanup necessary to allow the session's
│ │ │ +destruction (e.g. cancel outstanding async operations)
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_dht_request()
│ │ │
│ │ │ -char const* old_path () const;
│ │ │ -char const* storage_path () const;
│ │ │ +virtual bool on_dht_request (string_view /* query */
│ │ │ + , udp::endpoint const& /* source */, bdecode_node const& /* message */
│ │ │ + , entry& /* response */);
│ │ │
│ │ │ -
the path the torrent was moved to and from, respectively.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
on_alert()
│ │ │
│ │ │ -struct storage_moved_failed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* file_path () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ - error_code const error;
│ │ │ - operation_t op;
│ │ │ -};
│ │ │ +virtual void on_alert (alert const*);
│ │ │
│ │ │ -
[report issue]
│ │ │ -
file_path()
│ │ │ +
called when an alert is posted alerts that are filtered are not posted.
│ │ │ +If your plugin expects this to be called, make sure to include the flag
│ │ │ +alert_feature in the return value from implemented_features().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_unknown_torrent()
│ │ │
│ │ │ -char const* file_path () const;
│ │ │ +virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */
│ │ │ + , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);
│ │ │
│ │ │ -
If the error happened for a specific file, this returns its path.
│ │ │ -
[report issue]
│ │ │ -- op
│ │ │ -- this indicates what underlying operation caused the error
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
torrent_deleted_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a request to delete the files of a torrent complete.
│ │ │ -
This alert is posted in the alert_category::storage category, and that bit
│ │ │ -needs to be set in the alert_mask.
│ │ │ +
return true if the add_torrent_params should be added
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_tick()
│ │ │
│ │ │ -struct torrent_deleted_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ - info_hash_t info_hashes;
│ │ │ -};
│ │ │ +virtual void on_tick ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -- info_hashes
│ │ │ -- The info-hash of the torrent that was just deleted. Most of
│ │ │ -the time the torrent_handle in the torrent_alert will be invalid by the time
│ │ │ -this alert arrives, since the torrent is being deleted. The info_hashes member
│ │ │ -is hence the main way of identifying which torrent just completed the delete.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
torrent_delete_failed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a request to delete the files of a torrent fails.
│ │ │ -Just removing a torrent from the session cannot fail
│ │ │ +
called once per second.
│ │ │ +If your plugin expects this to be called, make sure to include the flag
│ │ │ +tick_feature in the return value from implemented_features().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
get_unchoke_priority()
│ │ │
│ │ │ -struct torrent_delete_failed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage
│ │ │ - | alert_category::error;
│ │ │ - error_code const error;
│ │ │ - info_hash_t info_hashes;
│ │ │ -};
│ │ │ +virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- tells you why it failed.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- info_hashes
│ │ │ -- the info hash of the torrent whose files failed to be deleted
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
save_resume_data_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated as a response to a torrent_handle::save_resume_data request.
│ │ │ -It is generated once the disk IO thread is done writing the state for this torrent.
│ │ │ +
called when choosing peers to optimistically unchoke. The return value
│ │ │ +indicates the peer's priority for unchoking. Lower return values
│ │ │ +correspond to higher priority. Priorities above 2^63-1 are reserved.
│ │ │ +If your plugin has no priority to assign a peer it should return 2^64-1.
│ │ │ +If your plugin expects this to be called, make sure to include the flag
│ │ │ +optimistic_unchoke_feature in the return value from implemented_features().
│ │ │ +If multiple plugins implement this function the lowest return value
│ │ │ +(i.e. the highest priority) is used.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
load_state()
│ │ │
│ │ │ -struct save_resume_data_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ - add_torrent_params params;
│ │ │ -};
│ │ │ +virtual void load_state (std::map<std::string, std::string> const&);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- params
│ │ │ -the params object is populated with the torrent file whose resume
│ │ │ -data was saved. It is suitable to be:
│ │ │ -
│ │ │ -
│ │ │ +called on startup while loading settings state from the session_params
│ │ │ +[report issue]
│ │ │ +- optimistic_unchoke_feature
│ │ │ +- include this bit if your plugin needs to alter the order of the
│ │ │ +optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()
│ │ │ +callback be called.
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
save_resume_data_failed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated instead of save_resume_data_alert if there was an error
│ │ │ -generating the resume data. error describes what went wrong.
│ │ │ -
│ │ │ -struct save_resume_data_failed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage
│ │ │ - | alert_category::error;
│ │ │ - error_code const error;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error code from the resume_data failure
│ │ │ +[report issue]
│ │ │ +- tick_feature
│ │ │ +- include this bit if your plugin needs to have on_tick() called
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
torrent_paused_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated as a response to a torrent_handle::pause request. It is
│ │ │ -generated once all disk IO is complete and the files in the torrent have been closed.
│ │ │ -This is useful for synchronizing with the disk.
│ │ │ -
│ │ │ -struct torrent_paused_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
torrent_resumed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated as a response to a torrent_handle::resume() request. It is
│ │ │ -generated when a torrent goes from a paused state to an active state.
│ │ │ -
│ │ │ -struct torrent_resumed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
torrent_checked_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted when a torrent completes checking. i.e. when it transitions
│ │ │ -out of the checking files state into a state where it is ready to start downloading
│ │ │ -
│ │ │ -struct torrent_checked_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
url_seed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a HTTP seed name lookup fails.
│ │ │ -
│ │ │ -struct url_seed_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* server_url () const;
│ │ │ - char const* error_message () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer | alert_category::error;
│ │ │ - error_code const error;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
server_url()
│ │ │ -
│ │ │ -char const* server_url () const;
│ │ │ -
│ │ │ -
the URL the error is associated with
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
error_message()
│ │ │ -
│ │ │ -char const* error_message () const;
│ │ │ -
│ │ │ -
in case the web server sent an error message, this function returns
│ │ │ -it.
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error the web seed encountered. If this is not set, the server
│ │ │ -sent an error message, call error_message().
│ │ │ +[report issue]
│ │ │ +- dht_request_feature
│ │ │ +- include this bit if your plugin needs to have on_dht_request()
│ │ │ +called
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
file_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
If the storage fails to read or write files that it needs access to, this alert is
│ │ │ -generated and the torrent is paused.
│ │ │ -
│ │ │ -struct file_error_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* filename () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status
│ │ │ - | alert_category::storage;
│ │ │ - error_code const error;
│ │ │ - operation_t op;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
filename()
│ │ │ -
│ │ │ -char const* filename () const;
│ │ │ -
│ │ │ -
the file that experienced the error
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error code describing the error.
│ │ │ +[report issue]
│ │ │ +- alert_feature
│ │ │ +- include this bit if your plugin needs to have on_alert()
│ │ │ +called
│ │ │
│ │ │ -[report issue]
│ │ │ -- op
│ │ │ -- indicates which underlying operation caused the error
│ │ │ +[report issue]
│ │ │ +- unknown_torrent_feature
│ │ │ +- include this bit if your plugin needs to have on_unknown_torrent()
│ │ │ +called even if there is no active torrent in the session
│ │ │
│ │ │ -[report issue]
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
udp_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted when there is an error on a UDP socket. The
│ │ │ -UDP sockets are used for all uTP, DHT and UDP tracker traffic. They are
│ │ │ -global to the session.
│ │ │ -
│ │ │ -struct udp_error_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error;
│ │ │ - aux::noexcept_movable<udp::endpoint> endpoint;
│ │ │ - operation_t operation;
│ │ │ - error_code const error;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- endpoint
│ │ │ -- the source address associated with the error (if any)
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- operation
│ │ │ -- the operation that failed
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error code describing the error
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
external_ip_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
Whenever libtorrent learns about the machines external IP, this alert is
│ │ │ -generated. The external IP address can be acquired from the tracker (if it
│ │ │ -supports that) or from peers that supports the extension protocol.
│ │ │ -The address can be accessed through the external_address member.
│ │ │ -
│ │ │ -struct external_ip_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - aux::noexcept_movable<address> external_address;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- external_address
│ │ │ -- the IP address that is believed to be our external IP
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
listen_failed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when none of the ports, given in the port range, to
│ │ │ -session can be opened for listening. The listen_interface member is the
│ │ │ -interface that failed, error is the error code describing the failure.
│ │ │ -
In the case an endpoint was created before generating the alert, it is
│ │ │ -represented by address and port. The combinations of socket type
│ │ │ -and operation in which such address and port are not valid are:
│ │ │ -accept - i2p
│ │ │ -accept - socks5
│ │ │ -enum_if - tcp
│ │ │ -
libtorrent may sometimes try to listen on port 0, if all other ports failed.
│ │ │ -Port 0 asks the operating system to pick a port that's free). If that fails
│ │ │ -you may see a listen_failed_alert with port 0 even if you didn't ask to
│ │ │ -listen on it.
│ │ │ +
│ │ │ +
torrent_plugin
│ │ │ +
Declared in "libtorrent/extensions.hpp"
│ │ │ +
Torrent plugins are associated with a single torrent and have a number
│ │ │ +of functions called at certain events. Many of its functions have the
│ │ │ +ability to change or override the default libtorrent behavior.
│ │ │
│ │ │ -struct listen_failed_alert final : alert
│ │ │ +struct torrent_plugin
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ - char const* listen_interface () const;
│ │ │ + virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);
│ │ │ + virtual void on_piece_failed (piece_index_t);
│ │ │ + virtual void on_piece_pass (piece_index_t);
│ │ │ + virtual void tick ();
│ │ │ + virtual bool on_resume ();
│ │ │ + virtual bool on_pause ();
│ │ │ + 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 alert_category_t static_category = alert_category::status | alert_category::error;
│ │ │ - error_code const error;
│ │ │ - operation_t op;
│ │ │ - lt::socket_type_t const socket_type;
│ │ │ - aux::noexcept_movable<lt::address> address;
│ │ │ - int const port;
│ │ │ + static constexpr add_peer_flags_t first_time = 1_bit;
│ │ │ + static constexpr add_peer_flags_t filtered = 2_bit;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
listen_interface()
│ │ │ -
│ │ │ -char const* listen_interface () const;
│ │ │ -
│ │ │ -
the network device libtorrent attempted to listen on, or the IP address
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error the system returned
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- op
│ │ │ -- the underlying operation that failed
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- socket_type
│ │ │ -- the type of listen socket this alert refers to.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- address
│ │ │ -- the address libtorrent attempted to listen on
│ │ │ -see alert documentation for validity of this value
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- port
│ │ │ -- the port libtorrent attempted to listen on
│ │ │ -see alert documentation for validity of this value
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
listen_succeeded_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted when the listen port succeeds to be opened on a
│ │ │ -particular interface. address and port is the endpoint that
│ │ │ -successfully was opened for listening.
│ │ │ +
[report issue]
│ │ │ +
new_connection()
│ │ │
│ │ │ -struct listen_succeeded_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - aux::noexcept_movable<lt::address> address;
│ │ │ - int const port;
│ │ │ - lt::socket_type_t const socket_type;
│ │ │ -};
│ │ │ +virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- address
│ │ │ -- the address libtorrent ended up listening on. This address
│ │ │ -refers to the local interface.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- port
│ │ │ -- the port libtorrent ended up listening on.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- socket_type
│ │ │ -- the type of listen socket this alert refers to.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
portmap_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a NAT router was successfully found but some
│ │ │ -part of the port mapping request failed. It contains a text message that
│ │ │ -may help the user figure out what is wrong. This alert is not generated in
│ │ │ -case it appears the client is not running on a NAT:ed network or if it
│ │ │ -appears there is no NAT router that can be remote controlled to add port
│ │ │ -mappings.
│ │ │ +
This function is called each time a new peer is connected to the torrent. You
│ │ │ +may choose to ignore this by just returning a default constructed
│ │ │ +shared_ptr (in which case you don't need to override this member
│ │ │ +function).
│ │ │ +
If you need an extension to the peer connection (which most plugins do) you
│ │ │ +are supposed to return an instance of your peer_plugin class. Which in
│ │ │ +turn will have its hook functions called on event specific to that peer.
│ │ │ +
The peer_connection_handle will be valid as long as the shared_ptr
│ │ │ +is being held by the torrent object. So, it is generally a good idea to not
│ │ │ +keep a shared_ptr to your own peer_plugin. If you want to keep references
│ │ │ +to it, use weak_ptr.
│ │ │ +
If this function throws an exception, the connection will be closed.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_piece_failed() on_piece_pass()
│ │ │
│ │ │ -struct portmap_error_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::port_mapping
│ │ │ - | alert_category::error;
│ │ │ - port_mapping_t const mapping;
│ │ │ - portmap_transport map_transport;
│ │ │ - aux::noexcept_movable<address> local_address;
│ │ │ - error_code const error;
│ │ │ -};
│ │ │ +virtual void on_piece_failed (piece_index_t);
│ │ │ +virtual void on_piece_pass (piece_index_t);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- mapping
│ │ │ -- refers to the mapping index of the port map that failed, i.e.
│ │ │ -the index returned from add_mapping().
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- map_transport
│ │ │ -- UPnP or NAT-PMP
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- local_address
│ │ │ -- the local network the port mapper is running on
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- tells you what failed.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
portmap_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a NAT router was successfully found and
│ │ │ -a port was successfully mapped on it. On a NAT:ed network with a NAT-PMP
│ │ │ -capable router, this is typically generated once when mapping the TCP
│ │ │ -port and, if DHT is enabled, when the UDP port is mapped.
│ │ │ +
These hooks are called when a piece passes the hash check or fails the hash
│ │ │ +check, respectively. The index is the piece index that was downloaded.
│ │ │ +It is possible to access the list of peers that participated in sending the
│ │ │ +piece through the torrent and the piece_picker.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
tick()
│ │ │
│ │ │ -struct portmap_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::port_mapping;
│ │ │ - port_mapping_t const mapping;
│ │ │ - int const external_port;
│ │ │ - portmap_protocol const map_protocol;
│ │ │ - portmap_transport const map_transport;
│ │ │ - aux::noexcept_movable<address> local_address;
│ │ │ -};
│ │ │ +virtual void tick ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -- mapping
│ │ │ -- refers to the mapping index of the port map that failed, i.e.
│ │ │ -the index returned from add_mapping().
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- external_port
│ │ │ -- the external port allocated for the mapping.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- local_address
│ │ │ -- the local network the port mapper is running on
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
portmap_log_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated to log informational events related to either
│ │ │ -UPnP or NAT-PMP. They contain a log line and the type (0 = NAT-PMP
│ │ │ -and 1 = UPnP). Displaying these messages to an end user is only useful
│ │ │ -for debugging the UPnP or NAT-PMP implementation. This alert is only
│ │ │ -posted if the alert_category::port_mapping_log flag is enabled in
│ │ │ -the alert mask.
│ │ │ +
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()
│ │ │
│ │ │ -struct portmap_log_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* log_message () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::port_mapping_log;
│ │ │ - portmap_transport const map_transport;
│ │ │ - aux::noexcept_movable<address> local_address;
│ │ │ -};
│ │ │ +virtual bool on_resume ();
│ │ │ +virtual bool on_pause ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -
log_message()
│ │ │ +
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 will recurse back into your handler, so in order to invoke the
│ │ │ +standard handler, you have to keep your own state on whether you want standard
│ │ │ +behavior or overridden behavior.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_files_checked()
│ │ │
│ │ │ -char const* log_message () const;
│ │ │ +virtual void on_files_checked ();
│ │ │
│ │ │ -
the message associated with this log line
│ │ │ -
[report issue]
│ │ │ -- local_address
│ │ │ -- the local network the port mapper is running on
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
fastresume_rejected_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a fast resume file has been passed to
│ │ │ -add_torrent() but the files on disk did not match the fast resume file.
│ │ │ -The error_code explains the reason why the resume file was rejected.
│ │ │ +
This function is called when the initial files of the torrent have been
│ │ │ +checked. If there are no files to check, this function is called immediately.
│ │ │ +
i.e. This function is always called when the torrent is in a state where it
│ │ │ +can start downloading.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_state()
│ │ │
│ │ │ -struct fastresume_rejected_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* file_path () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status
│ │ │ - | alert_category::error;
│ │ │ - error_code error;
│ │ │ - operation_t op;
│ │ │ -};
│ │ │ +virtual void on_state (torrent_status::state_t);
│ │ │
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
on_add_peer()
│ │ │
│ │ │ -char const* file_path () const;
│ │ │ +virtual void on_add_peer (tcp::endpoint const&,
│ │ │ + peer_source_flags_t, add_peer_flags_t);
│ │ │
│ │ │ -
If the error happened to a specific file, this returns the path to it.
│ │ │ -
[report issue]
│ │ │ -- op
│ │ │ -- the underlying operation that failed
│ │ │ +called every time a new peer is added to the peer list.
│ │ │ +This is before the peer is connected to. For flags, see
│ │ │ +torrent_plugin::flags_t. The source argument refers to
│ │ │ +the source where we learned about this peer from. It's a
│ │ │ +bitmask, because many sources may have told us about the same
│ │ │ +peer. For peer source flags, see peer_info::peer_source_flags.
│ │ │ +[report issue]
│ │ │ +- first_time
│ │ │ +- this is the first time we see this peer
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
peer_blocked_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted when an incoming peer connection, or a peer that's about to be added
│ │ │ -to our peer list, is blocked for some reason. This could be any of:
│ │ │ -
│ │ │ -- the IP filter
│ │ │ -- i2p mixed mode restrictions (a normal peer is not allowed on an i2p swarm)
│ │ │ -- the port filter
│ │ │ -- the peer has a low port and no_connect_privileged_ports is enabled
│ │ │ -- the protocol of the peer is blocked (uTP/TCP blocking)
│ │ │ -
│ │ │ -
│ │ │ -struct peer_blocked_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - enum reason_t
│ │ │ - {
│ │ │ - ip_filter,
│ │ │ - port_filter,
│ │ │ - i2p_mixed,
│ │ │ - privileged_ports,
│ │ │ - utp_disabled,
│ │ │ - tcp_disabled,
│ │ │ - invalid_local_interface,
│ │ │ - ssrf_mitigation,
│ │ │ - };
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::ip_block;
│ │ │ - int const reason;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
enum reason_t
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| name |
│ │ │ -value |
│ │ │ -description |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| ip_filter |
│ │ │ -0 |
│ │ │ - |
│ │ │ -
│ │ │ -| port_filter |
│ │ │ -1 |
│ │ │ - |
│ │ │ -
│ │ │ -| i2p_mixed |
│ │ │ -2 |
│ │ │ - |
│ │ │ -
│ │ │ -| privileged_ports |
│ │ │ -3 |
│ │ │ - |
│ │ │ -
│ │ │ -| utp_disabled |
│ │ │ -4 |
│ │ │ - |
│ │ │ -
│ │ │ -| tcp_disabled |
│ │ │ -5 |
│ │ │ - |
│ │ │ -
│ │ │ -| invalid_local_interface |
│ │ │ -6 |
│ │ │ - |
│ │ │ -
│ │ │ -| ssrf_mitigation |
│ │ │ -7 |
│ │ │ - |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- reason
│ │ │ -- the reason for the peer being blocked. Is one of the values from the
│ │ │ -reason_t enum.
│ │ │ +[report issue]
│ │ │ +- filtered
│ │ │ +- this peer was not added because it was
│ │ │ +filtered by the IP filter
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
dht_announce_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a DHT node announces to an info-hash on our
│ │ │ -DHT node. It belongs to the alert_category::dht category.
│ │ │ -
│ │ │ -struct dht_announce_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ - aux::noexcept_movable<address> ip;
│ │ │ - int port;
│ │ │ - sha1_hash info_hash;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_get_peers_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when a DHT node sends a get_peers message to
│ │ │ -our DHT node. It belongs to the alert_category::dht category.
│ │ │ -
│ │ │ -struct dht_get_peers_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ - sha1_hash info_hash;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
cache_flushed_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted when the disk cache has been flushed for a specific
│ │ │ -torrent as a result of a call to torrent_handle::flush_cache(). This
│ │ │ -alert belongs to the alert_category::storage category, which must be
│ │ │ -enabled to let this alert through. The alert is also posted when removing
│ │ │ -a torrent from the session, once the outstanding cache flush is complete
│ │ │ -and the torrent does no longer have any files open.
│ │ │ -
│ │ │ -struct cache_flushed_alert final : torrent_alert
│ │ │ -{
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
lsd_peer_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when we receive a local service discovery message
│ │ │ -from a peer for a torrent we're currently participating in.
│ │ │ -
│ │ │ -struct lsd_peer_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
trackerid_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted whenever a tracker responds with a trackerid.
│ │ │ -The tracker ID is like a cookie. libtorrent will store the tracker ID
│ │ │ -for this tracker and repeat it in subsequent announces.
│ │ │ -
│ │ │ -struct trackerid_alert final : tracker_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* tracker_id () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
tracker_id()
│ │ │ -
│ │ │ -char const* tracker_id () const;
│ │ │ -
│ │ │ -
The tracker ID returned by the tracker
│ │ │ -
[report issue]
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
dht_bootstrap_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted when the initial DHT bootstrap is done.
│ │ │ +
│ │ │ +
peer_plugin
│ │ │ +
Declared in "libtorrent/extensions.hpp"
│ │ │ +
peer plugins are associated with a specific peer. A peer could be
│ │ │ +both a regular bittorrent peer (bt_peer_connection) or one of the
│ │ │ +web seed connections (web_peer_connection or http_seed_connection).
│ │ │ +In order to only attach to certain peers, make your
│ │ │ +torrent_plugin::new_connection only return a plugin for certain peer
│ │ │ +connection types
│ │ │
│ │ │ -struct dht_bootstrap_alert final : alert
│ │ │ +struct peer_plugin
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ + 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_dont_have (piece_index_t);
│ │ │ + virtual bool on_have_none ();
│ │ │ + virtual bool on_have (piece_index_t);
│ │ │ + virtual bool on_choke ();
│ │ │ + virtual bool on_allowed_fast (piece_index_t);
│ │ │ + virtual bool on_request (peer_request const&);
│ │ │ + virtual bool on_interested ();
│ │ │ + virtual bool on_unchoke ();
│ │ │ + virtual bool on_bitfield (bitfield const& /*bitfield*/);
│ │ │ + virtual bool on_have_all ();
│ │ │ + virtual bool on_not_interested ();
│ │ │ + virtual bool on_piece (peer_request const& /*piece*/
│ │ │ + , span<char const> /*buf*/);
│ │ │ + virtual bool on_reject (peer_request const&);
│ │ │ + virtual bool on_suggest (piece_index_t);
│ │ │ + virtual bool on_cancel (peer_request const&);
│ │ │ + virtual void sent_cancel (peer_request const&);
│ │ │ + virtual void sent_request (peer_request const&);
│ │ │ + virtual void sent_choke ();
│ │ │ + virtual void sent_reject_request (peer_request const&);
│ │ │ + virtual void sent_suggest (piece_index_t);
│ │ │ + virtual void sent_allow_fast (piece_index_t);
│ │ │ + virtual void sent_have_all ();
│ │ │ + virtual void sent_have_none ();
│ │ │ + virtual void sent_interested ();
│ │ │ + virtual void sent_not_interested ();
│ │ │ + virtual void sent_unchoke ();
│ │ │ + virtual void sent_piece (peer_request const&);
│ │ │ + virtual void sent_have (piece_index_t);
│ │ │ + 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_failed (piece_index_t);
│ │ │ + virtual void on_piece_pass (piece_index_t);
│ │ │ + virtual void tick ();
│ │ │ + virtual bool write_request (peer_request const&);
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
torrent_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is posted whenever a torrent is transitioned into the error state.
│ │ │ -If the error code is duplicate_torrent (error_code_enum) error, it suggests two magnet
│ │ │ -links ended up resolving to the same hybrid torrent. For more details,
│ │ │ -see BitTorrent v2 torrents.
│ │ │ +
[report issue]
│ │ │ +
type()
│ │ │
│ │ │ -struct torrent_error_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* filename () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error | alert_category::status;
│ │ │ - error_code const error;
│ │ │ -};
│ │ │ +virtual string_view type () const;
│ │ │
│ │ │ -
[report issue]
│ │ │ -
filename()
│ │ │ +
This function is expected to return the name of
│ │ │ +the plugin.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
add_handshake()
│ │ │
│ │ │ -char const* filename () const;
│ │ │ +virtual void add_handshake (entry&);
│ │ │
│ │ │ -
the filename (or object) the error occurred on.
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- specifies which error the torrent encountered.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
torrent_need_cert_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is always posted for SSL torrents. This is a reminder to the client that
│ │ │ -the torrent won't work unless torrent_handle::set_ssl_certificate() is called with
│ │ │ -a valid certificate. Valid certificates MUST be signed by the SSL certificate
│ │ │ -in the .torrent file.
│ │ │ +
can add entries to the extension handshake
│ │ │ +this is not called for web seeds
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_disconnect()
│ │ │
│ │ │ -struct torrent_need_cert_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ -};
│ │ │ +virtual void on_disconnect (error_code const&);
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
incoming_connection_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
The incoming connection alert is posted every time we successfully accept
│ │ │ -an incoming connection, through any mean. The most straight-forward ways
│ │ │ -of accepting incoming connections are through the TCP listen socket and
│ │ │ -the UDP listen socket for uTP sockets. However, connections may also be
│ │ │ -accepted through a Socks5 or i2p listen socket, or via an SSL listen
│ │ │ -socket.
│ │ │ +
called when the peer is being disconnected.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_connected()
│ │ │
│ │ │ -struct incoming_connection_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer;
│ │ │ - socket_type_t socket_type;
│ │ │ - aux::noexcept_movable<tcp::endpoint> endpoint;
│ │ │ -};
│ │ │ +virtual void on_connected ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -- socket_type
│ │ │ -- tells you what kind of socket the connection was accepted
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- endpoint
│ │ │ -- is the IP address and port the connection came from.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
add_torrent_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is always posted when a torrent was attempted to be added
│ │ │ -and contains the return status of the add operation. The torrent handle of the new
│ │ │ -torrent can be found as the handle member in the base class. If adding
│ │ │ -the torrent failed, error contains the error code.
│ │ │ +
called when the peer is successfully connected. Note that
│ │ │ +incoming connections will have been connected by the time
│ │ │ +the peer plugin is attached to it, and won't have this hook
│ │ │ +called.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_handshake()
│ │ │
│ │ │ -struct add_torrent_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - add_torrent_params params;
│ │ │ - error_code error;
│ │ │ -};
│ │ │ +virtual bool on_handshake (span<char const>);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- params
│ │ │ -This contains copies of the most important fields from the original
│ │ │ -add_torrent_params object, passed to add_torrent() or
│ │ │ -async_add_torrent(). Specifically, these fields are copied:
│ │ │ -
│ │ │ -- version
│ │ │ -- ti
│ │ │ -- name
│ │ │ -- save_path
│ │ │ -- userdata
│ │ │ -- tracker_id
│ │ │ -- flags
│ │ │ -- info_hash
│ │ │ -
│ │ │ -the info_hash field will be updated with the info-hash of the torrent
│ │ │ -specified by ti.
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- set to the error, if one occurred while adding the torrent.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
state_update_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is only posted when requested by the user, by calling
│ │ │ -session::post_torrent_updates() on the session. It contains the torrent
│ │ │ -status of all torrents that changed since last time this message was
│ │ │ -posted. Its category is alert_category::status, but it's not subject to
│ │ │ -filtering, since it's only manually posted anyway.
│ │ │ +
this is called when the initial bittorrent handshake is received.
│ │ │ +Returning false means that the other end doesn't support this extension
│ │ │ +and will remove it from the list of plugins. this is not called for web
│ │ │ +seeds
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_extension_handshake()
│ │ │
│ │ │ -struct state_update_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - std::vector<torrent_status> status;
│ │ │ -};
│ │ │ +virtual bool on_extension_handshake (bdecode_node const&);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- status
│ │ │ -- contains the torrent status of all torrents that changed since last
│ │ │ -time this message was posted. Note that you can map a torrent status
│ │ │ -to a specific torrent via its handle member. The receiving end is
│ │ │ -suggested to have all torrents sorted by the torrent_handle or hashed
│ │ │ -by it, for efficient updates.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
session_stats_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
The session_stats_alert is posted when the user requests session statistics by
│ │ │ -calling post_session_stats() on the session object. This alert does not
│ │ │ -have a category, since it's only posted in response to an API call. It
│ │ │ -is not subject to the alert_mask filter.
│ │ │ -
the message() member function returns a string representation of the values that
│ │ │ -properly match the line returned in session_stats_header_alert::message().
│ │ │ -
this specific output is parsed by tools/parse_session_stats.py
│ │ │ -if this is changed, that parser should also be changed
│ │ │ +
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_choke() on_dont_have() on_have_all() on_not_interested() on_unchoke() on_allowed_fast() on_have() on_have_none() on_request() on_bitfield() on_interested()
│ │ │
│ │ │ -struct session_stats_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - span<std::int64_t const> counters () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = {};
│ │ │ -};
│ │ │ +virtual bool on_dont_have (piece_index_t);
│ │ │ +virtual bool on_have_none ();
│ │ │ +virtual bool on_have (piece_index_t);
│ │ │ +virtual bool on_choke ();
│ │ │ +virtual bool on_allowed_fast (piece_index_t);
│ │ │ +virtual bool on_request (peer_request const&);
│ │ │ +virtual bool on_interested ();
│ │ │ +virtual bool on_unchoke ();
│ │ │ +virtual bool on_bitfield (bitfield const& /*bitfield*/);
│ │ │ +virtual bool on_have_all ();
│ │ │ +virtual bool on_not_interested ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -
counters()
│ │ │ +
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()
│ │ │
│ │ │ -span<std::int64_t const> counters () const;
│ │ │ +virtual bool on_piece (peer_request const& /*piece*/
│ │ │ + , span<char const> /*buf*/);
│ │ │
│ │ │ -
An array are a mix of counters and gauges, which meanings can be
│ │ │ -queries via the session_stats_metrics() function on the session. The
│ │ │ -mapping from a specific metric to an index into this array is constant
│ │ │ -for a specific version of libtorrent, but may differ for other
│ │ │ -versions. The intended usage is to request the mapping, i.e. call
│ │ │ -session_stats_metrics(), once on startup, and then use that mapping to
│ │ │ -interpret these values throughout the process' runtime.
│ │ │ -
For more information, see the session statistics section.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
dht_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
posted when something fails in the DHT. This is not necessarily a fatal
│ │ │ -error, but it could prevent proper operation
│ │ │ +
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_not_interested() sent_have() sent_interested() sent_piece() sent_unchoke()
│ │ │
│ │ │ -struct dht_error_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error | alert_category::dht;
│ │ │ - error_code error;
│ │ │ - operation_t op;
│ │ │ -};
│ │ │ +virtual void sent_interested ();
│ │ │ +virtual void sent_not_interested ();
│ │ │ +virtual void sent_unchoke ();
│ │ │ +virtual void sent_piece (peer_request const&);
│ │ │ +virtual void sent_have (piece_index_t);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error code
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- op
│ │ │ -- the operation that failed
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_immutable_item_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert is posted as a response to a call to session::get_item(),
│ │ │ -specifically the overload for looking up immutable items in the DHT.
│ │ │ +
called after a choke message has been sent to the peer
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
sent_payload()
│ │ │
│ │ │ -struct dht_immutable_item_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ - sha1_hash target;
│ │ │ - entry item;
│ │ │ -};
│ │ │ +virtual void sent_payload (int /* bytes */);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- target
│ │ │ -- the target hash of the immutable item. This must
│ │ │ -match the SHA-1 hash of the bencoded form of item.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- item
│ │ │ -- the data for this item
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_mutable_item_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert is posted as a response to a call to session::get_item(),
│ │ │ -specifically the overload for looking up mutable items in the DHT.
│ │ │ +
called after piece data has been sent to the peer
│ │ │ +this can be used for stats book keeping
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
can_disconnect()
│ │ │
│ │ │ -struct dht_mutable_item_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ - std::array<char, 32> key;
│ │ │ - std::array<char, 64> signature;
│ │ │ - std::int64_t seq;
│ │ │ - std::string salt;
│ │ │ - entry item;
│ │ │ - bool authoritative;
│ │ │ -};
│ │ │ +virtual bool can_disconnect (error_code const& /*ec*/);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- key
│ │ │ -- the public key that was looked up
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- signature
│ │ │ -- the signature of the data. This is not the signature of the
│ │ │ -plain encoded form of the item, but it includes the sequence number
│ │ │ -and possibly the hash as well. See the dht_store document for more
│ │ │ -information. This is primarily useful for echoing back in a store
│ │ │ -request.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- seq
│ │ │ -- the sequence number of this item
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- salt
│ │ │ -- the salt, if any, used to lookup and store this item. If no
│ │ │ -salt was used, this is an empty string
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- item
│ │ │ -- the data for this item
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- authoritative
│ │ │ -- the last response for mutable data is authoritative.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_put_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this is posted when a DHT put operation completes. This is useful if the
│ │ │ -client is waiting for a put to complete before shutting down for instance.
│ │ │ +
called when libtorrent think this peer should be disconnected.
│ │ │ +if the plugin returns false, the peer will not be disconnected.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_extended()
│ │ │
│ │ │ -struct dht_put_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ - sha1_hash target;
│ │ │ - std::array<char, 32> public_key;
│ │ │ - std::array<char, 64> signature;
│ │ │ - std::string salt;
│ │ │ - std::int64_t seq;
│ │ │ - int num_success;
│ │ │ -};
│ │ │ +virtual bool on_extended (int /*length*/, int /*msg*/,
│ │ │ + span<char const> /*body*/);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- target
│ │ │ -- the target hash the item was stored under if this was an immutable
│ │ │ -item.
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- public_key signature salt seq
│ │ │ -- if a mutable item was stored, these are the public key, signature,
│ │ │ -salt and sequence number the item was stored under.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- num_success
│ │ │ -- DHT put operation usually writes item to k nodes, maybe the node
│ │ │ -is stale so no response, or the node doesn't support 'put', or the
│ │ │ -token for write is out of date, etc. num_success is the number of
│ │ │ -successful responses we got from the puts.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
i2p_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert is used to report errors in the i2p SAM connection
│ │ │ +
called when an extended message is received. If returning true,
│ │ │ +the message is not processed by any other plugin and if false
│ │ │ +is returned the next plugin in the chain will receive it to
│ │ │ +be able to handle it. This is not called for web seeds.
│ │ │ +thus function may be called more than once per incoming message, but
│ │ │ +only the last of the calls will the body size equal the length.
│ │ │ +i.e. Every time another fragment of the message is received, this
│ │ │ +function will be called, until finally the whole message has been
│ │ │ +received. The purpose of this is to allow early disconnects for invalid
│ │ │ +messages and for reporting progress of receiving large messages.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_unknown_message()
│ │ │
│ │ │ -struct i2p_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error;
│ │ │ - error_code error;
│ │ │ -};
│ │ │ +virtual bool on_unknown_message (int /*length*/, int /*msg*/,
│ │ │ + span<char const> /*body*/);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error that occurred in the i2p SAM connection
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_outgoing_get_peers_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is generated when we send a get_peers request
│ │ │ -It belongs to the alert_category::dht category.
│ │ │ +
this is not called for web seeds
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
on_piece_failed() on_piece_pass()
│ │ │
│ │ │ -struct dht_outgoing_get_peers_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ - sha1_hash info_hash;
│ │ │ - sha1_hash obfuscated_info_hash;
│ │ │ - aux::noexcept_movable<udp::endpoint> endpoint;
│ │ │ -};
│ │ │ +virtual void on_piece_failed (piece_index_t);
│ │ │ +virtual void on_piece_pass (piece_index_t);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- info_hash
│ │ │ -- the info_hash of the torrent we're looking for peers for.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- obfuscated_info_hash
│ │ │ -- if this was an obfuscated lookup, this is the info-hash target
│ │ │ -actually sent to the node.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- endpoint
│ │ │ -- the endpoint we're sending this query to
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
log_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted by some session wide event. Its main purpose is
│ │ │ -trouble shooting and debugging. It's not enabled by the default alert
│ │ │ -mask and is enabled by the alert_category::session_log bit.
│ │ │ -Furthermore, it's by default disabled as a build configuration.
│ │ │ +
called when a piece that this peer participated in either
│ │ │ +fails or passes the hash_check
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
tick()
│ │ │
│ │ │ -struct log_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* log_message () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::session_log;
│ │ │ -};
│ │ │ +virtual void tick ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -
log_message()
│ │ │ +
called approximately once every second
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
write_request()
│ │ │
│ │ │ -char const* log_message () const;
│ │ │ +virtual bool write_request (peer_request const&);
│ │ │
│ │ │ -
returns the log message
│ │ │ -
[report issue]
│ │ │ +
called each time a request message is to be sent. If true
│ │ │ +is returned, the original request message won't be sent and
│ │ │ +no other plugin will have this function called.
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
torrent_log_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted by torrent wide events. It's meant to be used for
│ │ │ -trouble shooting and debugging. It's not enabled by the default alert
│ │ │ -mask and is enabled by the alert_category::torrent_log bit. By
│ │ │ -default it is disabled as a build configuration.
│ │ │ +
│ │ │ +
crypto_plugin
│ │ │ +
Declared in "libtorrent/extensions.hpp"
│ │ │
│ │ │ -struct torrent_log_alert final : torrent_alert
│ │ │ +struct crypto_plugin
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ - char const* log_message () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::torrent_log;
│ │ │ + 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]
│ │ │ -
log_message()
│ │ │ +
[report issue]
│ │ │ +
encrypt()
│ │ │
│ │ │ -char const* log_message () const;
│ │ │ +encrypt (span<span<char>> /*send_vec*/) = 0;
│ │ │
│ │ │ -
returns the log message
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
peer_log_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted by events specific to a peer. It's meant to be used
│ │ │ -for trouble shooting and debugging. It's not enabled by the default alert
│ │ │ -mask and is enabled by the alert_category::peer_log bit. By
│ │ │ -default it is disabled as a build configuration.
│ │ │ +
encrypted the provided buffers and returns the number of bytes which
│ │ │ +are now ready to be sent to the lower layer. This must be at least
│ │ │ +as large as the number of bytes passed in and may be larger if there
│ │ │ +is additional data to be inserted at the head of the send buffer.
│ │ │ +The additional data is returned as the second tuple value. Any
│ │ │ +returned buffer as well as the iovec itself, to be prepended to the
│ │ │ +send buffer, must be owned by the crypto plugin and guaranteed to stay
│ │ │ +alive until the crypto_plugin is destructed or this function is called
│ │ │ +again.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
decrypt()
│ │ │
│ │ │ -struct peer_log_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* log_message () const;
│ │ │ -
│ │ │ - enum direction_t
│ │ │ - {
│ │ │ - incoming_message,
│ │ │ - outgoing_message,
│ │ │ - incoming,
│ │ │ - outgoing,
│ │ │ - info,
│ │ │ - };
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::peer_log;
│ │ │ - char const* event_type;
│ │ │ - direction_t direction;
│ │ │ -};
│ │ │ +virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;
│ │ │
│ │ │ -
[report issue]
│ │ │ -
log_message()
│ │ │ +
decrypt the provided buffers.
│ │ │ +returns is a tuple representing the values
│ │ │ +(consume, produce, packet_size)
│ │ │ +
consume is set to the number of bytes which should be trimmed from the
│ │ │ +head of the buffers, default is 0
│ │ │ +
produce is set to the number of bytes of payload which are now ready to
│ │ │ +be sent to the upper layer. default is the number of bytes passed in receive_vec
│ │ │ +
packet_size is set to the minimum number of bytes which must be read to
│ │ │ +advance the next step of decryption. default is 0
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
create_ut_pex_plugin()
│ │ │ +
Declared in "libtorrent/extensions/ut_pex.hpp"
│ │ │
│ │ │ -char const* log_message () const;
│ │ │ +std::shared_ptr<torrent_plugin> create_ut_pex_plugin (torrent_handle const&, client_data_t);
│ │ │
│ │ │ -
returns the log message
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum direction_t
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| name |
│ │ │ -value |
│ │ │ -description |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -| incoming_message |
│ │ │ -0 |
│ │ │ - |
│ │ │ -
│ │ │ -| outgoing_message |
│ │ │ -1 |
│ │ │ - |
│ │ │ -
│ │ │ -| incoming |
│ │ │ -2 |
│ │ │ - |
│ │ │ -
│ │ │ -| outgoing |
│ │ │ -3 |
│ │ │ - |
│ │ │ -
│ │ │ -| info |
│ │ │ -4 |
│ │ │ - |
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- event_type
│ │ │ -- string literal indicating the kind of event. For messages, this is the
│ │ │ -message name.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
lsd_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
posted if the local service discovery socket fails to start properly.
│ │ │ -it's categorized as alert_category::error.
│ │ │ +
constructor function for the ut_pex extension. The ut_pex
│ │ │ +extension allows peers to gossip about their connections, allowing
│ │ │ +the swarm stay well connected and peers aware of more peers in the
│ │ │ +swarm. This extension is enabled by default unless explicitly disabled in
│ │ │ +the session constructor.
│ │ │ +
This can either be passed in the add_torrent_params::extensions field, or
│ │ │ +via torrent_handle::add_extension().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
create_smart_ban_plugin()
│ │ │ +
Declared in "libtorrent/extensions/smart_ban.hpp"
│ │ │
│ │ │ -struct lsd_error_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error;
│ │ │ - aux::noexcept_movable<address> local_address;
│ │ │ - error_code error;
│ │ │ -};
│ │ │ +std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- local_address
│ │ │ -- the local network the corresponding local service discovery is running
│ │ │ -on
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- The error code
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_lookup
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
holds statistics about a current dht_lookup operation.
│ │ │ -a DHT lookup is the traversal of nodes, looking up a
│ │ │ -set of target nodes in the DHT for retrieving and possibly
│ │ │ -storing information in the DHT
│ │ │ +
constructor function for the smart ban extension. The extension keeps
│ │ │ +track of the data peers have sent us for failing pieces and once the
│ │ │ +piece completes and passes the hash check bans the peers that turned
│ │ │ +out to have sent corrupt data.
│ │ │ +This function can either be passed in the add_torrent_params::extensions
│ │ │ +field, or via torrent_handle::add_extension().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ -
│ │ │ -
dht_stats_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
contains current DHT state. Posted in response to session::post_dht_stats().
│ │ │ +
constructor function for the ut_metadata extension. The ut_metadata
│ │ │ +extension allows peers to request the .torrent file (or more
│ │ │ +specifically the info-dictionary of the .torrent file) from each
│ │ │ +other. This is the main building block in making magnet links work.
│ │ │ +This extension is enabled by default unless explicitly disabled in
│ │ │ +the session constructor.
│ │ │ +
This can either be passed in the add_torrent_params::extensions field, or
│ │ │ +via torrent_handle::add_extension().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
ip_filter
│ │ │ +
Declared in "libtorrent/ip_filter.hpp"
│ │ │ +
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 dht_stats_alert final : alert
│ │ │ +struct ip_filter
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ + ip_filter (ip_filter&&);
│ │ │ + ip_filter& operator= (ip_filter&&);
│ │ │ + ip_filter ();
│ │ │ + ~ip_filter ();
│ │ │ + ip_filter& operator= (ip_filter const&);
│ │ │ + ip_filter (ip_filter const&);
│ │ │ + 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;
│ │ │
│ │ │ - static constexpr alert_category_t static_category = {};
│ │ │ - std::vector<dht_lookup> active_requests;
│ │ │ - std::vector<dht_routing_bucket> routing_table;
│ │ │ - sha1_hash nid;
│ │ │ - aux::noexcept_movable<udp::endpoint> local_endpoint;
│ │ │ + enum access_flags
│ │ │ + {
│ │ │ + blocked,
│ │ │ + };
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -- active_requests
│ │ │ -- a vector of the currently running DHT lookups.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- routing_table
│ │ │ -- contains information about every bucket in the DHT routing
│ │ │ -table.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- nid
│ │ │ -- the node ID of the DHT node instance
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- local_endpoint
│ │ │ -- the local socket this DHT node is running on
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
incoming_request_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
posted every time an incoming request from a peer is accepted and queued
│ │ │ -up for being serviced. This alert is only posted if
│ │ │ -the alert_category::incoming_request flag is enabled in the alert
│ │ │ -mask.
│ │ │ +
[report issue]
│ │ │ +
empty()
│ │ │
│ │ │ -struct incoming_request_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::incoming_request;
│ │ │ - peer_request req;
│ │ │ -};
│ │ │ +bool empty () const;
│ │ │
│ │ │ -
[report issue]
│ │ │ -- req
│ │ │ -- the request this peer sent to us
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_log_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
debug logging of the DHT when alert_category::dht_log is set in the alert
│ │ │ -mask.
│ │ │ +
returns true if the filter does not contain any rules
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
add_rule()
│ │ │
│ │ │ -struct dht_log_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - char const* log_message () const;
│ │ │ -
│ │ │ - enum dht_module_t
│ │ │ - {
│ │ │ - tracker,
│ │ │ - node,
│ │ │ - routing_table,
│ │ │ - rpc_manager,
│ │ │ - traversal,
│ │ │ - };
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht_log;
│ │ │ - dht_module_t module;
│ │ │ -};
│ │ │ +void add_rule (address const& first, address const& last, std::uint32_t flags);
│ │ │
│ │ │ -
[report issue]
│ │ │ -
log_message()
│ │ │ +
Adds a rule to the filter. first and last defines a range of
│ │ │ +ip addresses that will be marked with the given flags. The flags
│ │ │ +can currently be 0, which means allowed, or ip_filter::blocked, which
│ │ │ +means disallowed.
│ │ │ +
precondition:
│ │ │ +first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()
│ │ │ +
postcondition:
│ │ │ +access(x) == flags for every x in the range [first, last]
│ │ │ +
This means that in a case of overlapping ranges, the last one applied takes
│ │ │ +precedence.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
access()
│ │ │
│ │ │ -char const* log_message () const;
│ │ │ +std::uint32_t access (address const& addr) const;
│ │ │
│ │ │ -
the log message
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum dht_module_t
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
Returns the access permissions for the given address (addr). The permission
│ │ │ +can currently be 0 or ip_filter::blocked. The complexity of this operation
│ │ │ +is O(log n), where n is the minimum number of non-overlapping ranges to describe
│ │ │ +the current filter.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
export_filter()
│ │ │ +
│ │ │ +filter_tuple_t export_filter () const;
│ │ │ +
│ │ │ +
This function will return the current state of the filter in the minimum number of
│ │ │ +ranges possible. They are sorted from ranges in low addresses to high addresses. Each
│ │ │ +entry in the returned vector is a range with the access control specified in its
│ │ │ +flags field.
│ │ │ +
The return value is a tuple containing two range-lists. One for IPv4 addresses
│ │ │ +and one for IPv6 addresses.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum access_flags
│ │ │ +
Declared in "libtorrent/ip_filter.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| tracker |
│ │ │ -0 |
│ │ │ - |
│ │ │ -
│ │ │ -| node |
│ │ │ +
| blocked |
│ │ │ 1 |
│ │ │ - |
│ │ │ -
│ │ │ -| routing_table |
│ │ │ -2 |
│ │ │ - |
│ │ │ -
│ │ │ -| rpc_manager |
│ │ │ -3 |
│ │ │ - |
│ │ │ -
│ │ │ -| traversal |
│ │ │ -4 |
│ │ │ - |
│ │ │ +indicates that IPs in this range should not be connected
│ │ │ +to nor accepted as incoming connections |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -- module
│ │ │ -- the module, or part, of the DHT that produced this log message.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
dht_pkt_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted every time a DHT message is sent or received. It is
│ │ │ -only posted if the alert_category::dht_log alert category is
│ │ │ -enabled. It contains a verbatim copy of the message.
│ │ │ +
│ │ │ +
port_filter
│ │ │ +
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.
│ │ │
│ │ │ -struct dht_pkt_alert final : alert
│ │ │ +class port_filter
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ - span<char const> pkt_buf () const;
│ │ │ + port_filter& operator= (port_filter&&);
│ │ │ + port_filter ();
│ │ │ + port_filter& operator= (port_filter const&);
│ │ │ + port_filter (port_filter&&);
│ │ │ + port_filter (port_filter const&);
│ │ │ + ~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 direction_t
│ │ │ + enum access_flags
│ │ │ {
│ │ │ - incoming,
│ │ │ - outgoing,
│ │ │ + blocked,
│ │ │ };
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht_log;
│ │ │ - direction_t direction;
│ │ │ - aux::noexcept_movable<udp::endpoint> node;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
pkt_buf()
│ │ │ +
[report issue]
│ │ │ +
add_rule()
│ │ │
│ │ │ -span<char const> pkt_buf () const;
│ │ │ +void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);
│ │ │
│ │ │ -
returns a pointer to the packet buffer and size of the packet,
│ │ │ -respectively. This buffer is only valid for as long as the alert itself
│ │ │ -is valid, which is owned by libtorrent and reclaimed whenever
│ │ │ -pop_alerts() is called on the session.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
enum direction_t
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ +
set the flags for the specified port range (first, last) to
│ │ │ +flags overwriting any existing rule for those ports. The range
│ │ │ +is inclusive, i.e. the port last also has the flag set on it.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
access()
│ │ │ +
│ │ │ +std::uint32_t access (std::uint16_t port) const;
│ │ │ +
│ │ │ +
test the specified port (port) for whether it is blocked
│ │ │ +or not. The returned value is the flags set for this port.
│ │ │ +see access_flags.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum access_flags
│ │ │ +
Declared in "libtorrent/ip_filter.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| incoming |
│ │ │ -0 |
│ │ │ - |
│ │ │ -
│ │ │ -| outgoing |
│ │ │ +
| blocked |
│ │ │ 1 |
│ │ │ - |
│ │ │ +this flag indicates that destination ports in the
│ │ │ +range should not be connected to |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -- direction
│ │ │ -- whether this is an incoming or outgoing packet.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- node
│ │ │ -- the DHT node we received this packet from, or sent this packet to
│ │ │ -(depending on direction).
│ │ │ -
│ │ │ -
[report issue]
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
dht_get_peers_reply_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
Posted when we receive a response to a DHT get_peers request.
│ │ │ +
│ │ │ +
bdecode_node
│ │ │ +
Declared in "libtorrent/bdecode.hpp"
│ │ │ +
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 dht_get_peers_reply_alert final : alert
│ │ │ +struct bdecode_node
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ - int num_peers () const;
│ │ │ - std::vector<tcp::endpoint> peers () const;
│ │ │ + bdecode_node () = default;
│ │ │ + bdecode_node (bdecode_node&&) noexcept;
│ │ │ + bdecode_node& operator= (bdecode_node&&) & = default;
│ │ │ + bdecode_node (bdecode_node const&);
│ │ │ + bdecode_node& operator= (bdecode_node const&) &;
│ │ │ + type_t type () const noexcept;
│ │ │ + explicit operator bool () const noexcept;
│ │ │ + bdecode_node non_owning () const;
│ │ │ + 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;
│ │ │ + 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;
│ │ │ + bdecode_node dict_find_string (string_view key) const;
│ │ │ + bdecode_node dict_find_int (string_view key) const;
│ │ │ + std::int64_t dict_find_int_value (string_view key
│ │ │ + , std::int64_t default_val = 0) const;
│ │ │ + int dict_size () const;
│ │ │ + bdecode_node dict_find (string_view key) const;
│ │ │ + std::pair<string_view, bdecode_node> dict_at (int i) const;
│ │ │ + bdecode_node dict_find_list (string_view key) const;
│ │ │ + bdecode_node dict_find_dict (string_view key) const;
│ │ │ + string_view dict_find_string_value (string_view key
│ │ │ + , string_view default_value = string_view()) const;
│ │ │ + std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;
│ │ │ + std::int64_t int_value () const;
│ │ │ + char const* string_ptr () const;
│ │ │ + string_view string_value () const;
│ │ │ + std::ptrdiff_t string_offset () const;
│ │ │ + int string_length () 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;
│ │ │
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht_operation;
│ │ │ - sha1_hash info_hash;
│ │ │ + enum type_t
│ │ │ + {
│ │ │ + none_t,
│ │ │ + dict_t,
│ │ │ + list_t,
│ │ │ + string_t,
│ │ │ + int_t,
│ │ │ + };
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_direct_response_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This is posted exactly once for every call to session_handle::dht_direct_request.
│ │ │ -If the request failed, response() will return a default constructed bdecode_node.
│ │ │ +
[report issue]
│ │ │ +
bdecode_node()
│ │ │
│ │ │ -struct dht_direct_response_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - bdecode_node response () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ - client_data_t userdata;
│ │ │ - aux::noexcept_movable<udp::endpoint> endpoint;
│ │ │ -};
│ │ │ +bdecode_node () = default;
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
picker_log_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this is posted when one or more blocks are picked by the piece picker,
│ │ │ -assuming the verbose piece picker logging is enabled (see
│ │ │ -alert_category::picker_log).
│ │ │ +
creates a default constructed node, it will have the type none_t.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
operator=() bdecode_node()
│ │ │
│ │ │ -struct picker_log_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - std::vector<piece_block> blocks () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::picker_log;
│ │ │ - static constexpr picker_flags_t partial_ratio = 0_bit;
│ │ │ - static constexpr picker_flags_t prioritize_partials = 1_bit;
│ │ │ - static constexpr picker_flags_t rarest_first_partials = 2_bit;
│ │ │ - static constexpr picker_flags_t rarest_first = 3_bit;
│ │ │ - static constexpr picker_flags_t reverse_rarest_first = 4_bit;
│ │ │ - static constexpr picker_flags_t suggested_pieces = 5_bit;
│ │ │ - static constexpr picker_flags_t prio_sequential_pieces = 6_bit;
│ │ │ - static constexpr picker_flags_t sequential_pieces = 7_bit;
│ │ │ - static constexpr picker_flags_t reverse_pieces = 8_bit;
│ │ │ - static constexpr picker_flags_t time_critical = 9_bit;
│ │ │ - static constexpr picker_flags_t random_pieces = 10_bit;
│ │ │ - static constexpr picker_flags_t prefer_contiguous = 11_bit;
│ │ │ - static constexpr picker_flags_t reverse_sequential = 12_bit;
│ │ │ - static constexpr picker_flags_t backup1 = 13_bit;
│ │ │ - static constexpr picker_flags_t backup2 = 14_bit;
│ │ │ - static constexpr picker_flags_t end_game = 15_bit;
│ │ │ - static constexpr picker_flags_t extent_affinity = 16_bit;
│ │ │ - picker_flags_t const picker_flags;
│ │ │ -};
│ │ │ +bdecode_node (bdecode_node&&) noexcept;
│ │ │ +bdecode_node& operator= (bdecode_node&&) & = default;
│ │ │ +bdecode_node (bdecode_node const&);
│ │ │ +bdecode_node& operator= (bdecode_node const&) &;
│ │ │
│ │ │ -
[report issue]
│ │ │ -- picker_flags
│ │ │ -- this is a bitmask of which features were enabled for this particular
│ │ │ -pick. The bits are defined in the picker_flags_t enum.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
session_error_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert is posted when the session encounters a serious error,
│ │ │ -potentially fatal
│ │ │ +
For owning nodes, the copy will create a copy of the tree, but the
│ │ │ +underlying buffer remains the same.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
type()
│ │ │
│ │ │ -struct session_error_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error;
│ │ │ - error_code const error;
│ │ │ -};
│ │ │ +type_t type () const noexcept;
│ │ │
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- The error code, if one is associated with this error
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_live_nodes_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
posted in response to a call to session::dht_live_nodes(). It contains the
│ │ │ -live nodes from the DHT routing table of one of the DHT nodes running
│ │ │ -locally.
│ │ │ +
the type of this node. See type_t.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
bool()
│ │ │
│ │ │ -struct dht_live_nodes_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - int num_nodes () const;
│ │ │ - std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::dht;
│ │ │ - sha1_hash node_id;
│ │ │ -};
│ │ │ +explicit operator bool () const noexcept;
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
non_owning()
│ │ │
│ │ │ -int num_nodes () const;
│ │ │ -std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;
│ │ │ +bdecode_node non_owning () 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]
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ +
data_section() data_offset()
│ │ │
│ │ │ -struct session_stats_header_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = {};
│ │ │ -};
│ │ │ +std::ptrdiff_t data_offset () const noexcept;
│ │ │ +span<char const> data_section () const noexcept;
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
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.
│ │ │ +
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_string_value_at() list_int_value_at() list_at() list_size()
│ │ │
│ │ │ -struct dht_sample_infohashes_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - std::vector<sha1_hash> samples () const;
│ │ │ - int num_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;
│ │ │ -};
│ │ │ +std::int64_t list_int_value_at (int i
│ │ │ + , std::int64_t default_val = 0) 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;
│ │ │
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
num_samples() samples()
│ │ │ +
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_string_value() dict_find_string() dict_find_int_value() dict_at_node() dict_size() dict_find_list() dict_find() dict_find_int() dict_at() dict_find_dict()
│ │ │
│ │ │ -std::vector<sha1_hash> samples () const;
│ │ │ -int num_samples () const;
│ │ │ +bdecode_node dict_find_string (string_view key) const;
│ │ │ +bdecode_node dict_find_int (string_view key) const;
│ │ │ +std::int64_t dict_find_int_value (string_view key
│ │ │ + , std::int64_t default_val = 0) const;
│ │ │ +int dict_size () const;
│ │ │ +bdecode_node dict_find (string_view key) const;
│ │ │ +std::pair<string_view, bdecode_node> dict_at (int i) const;
│ │ │ +bdecode_node dict_find_list (string_view key) const;
│ │ │ +bdecode_node dict_find_dict (string_view key) const;
│ │ │ +string_view dict_find_string_value (string_view key
│ │ │ + , string_view default_value = string_view()) const;
│ │ │ +std::pair<bdecode_node, bdecode_node> dict_at_node (int i) 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()
│ │ │ +
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 than the nodes. In case the node is not found, or it has
│ │ │ +a different type, a default value is returned (which can be specified).
│ │ │ +
dict_at() returns the (key, value)-pair at the specified index in a
│ │ │ +dictionary. Keys are only allowed to be strings. dict_at_node() also
│ │ │ +returns the (key, value)-pair, but the key is returned as a
│ │ │ +bdecode_node (and it will always be a string).
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
int_value()
│ │ │
│ │ │ -int num_nodes () const;
│ │ │ +std::int64_t int_value () const;
│ │ │
│ │ │ -
The total number of nodes returned by nodes().
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
nodes()
│ │ │ +
this function is only valid if type() == int_t. It returns the
│ │ │ +value of the integer.
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
string_ptr() string_offset() string_length() string_value()
│ │ │
│ │ │ -std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;
│ │ │ +char const* string_ptr () const;
│ │ │ +string_view string_value () const;
│ │ │ +std::ptrdiff_t string_offset () const;
│ │ │ +int string_length () const;
│ │ │
│ │ │ -
This is the set of more DHT nodes returned by the request.
│ │ │ -
The information is included so that indexing nodes can perform a key
│ │ │ -space traversal with a single RPC per node by adjusting the target
│ │ │ -value for each RPC.
│ │ │ -
[report issue]
│ │ │ -- node_id
│ │ │ -- id of the node the request was sent to (and this response was received from)
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- endpoint
│ │ │ -- the node the request was sent to (and this response was received from)
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- interval
│ │ │ -- the interval to wait before making another request to this node
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- num_infohashes
│ │ │ -- This field indicates how many info-hash keys are currently in the node's storage.
│ │ │ -If the value is larger than the number of returned samples it indicates that the
│ │ │ -indexer may obtain additional samples after waiting out the interval.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ -
block_uploaded_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
This alert is posted when a block intended to be sent to a peer is placed in the
│ │ │ -send buffer. Note that if the connection is closed before the send buffer is sent,
│ │ │ -the alert may be posted without the bytes having been sent to the peer.
│ │ │ -It belongs to the alert_category::upload category.
│ │ │ +
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()
│ │ │
│ │ │ -struct block_uploaded_alert final : peer_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - int const block_index;
│ │ │ - piece_index_t const piece_index;
│ │ │ -};
│ │ │ +void clear ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
alerts_dropped_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert is posted to indicate to the client that some alerts were
│ │ │ -dropped. Dropped meaning that the alert failed to be delivered to the
│ │ │ -client. The most common cause of such failure is that the internal alert
│ │ │ -queue grew too big (controlled by alert_queue_size).
│ │ │ +
resets the bdecoded_node to a default constructed state. If this is
│ │ │ +an owning node, the tree is freed and all child nodes are invalidated.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
swap()
│ │ │
│ │ │ -struct alerts_dropped_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ - static_assert (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error;
│ │ │ - std::bitset<abi_alert_count> dropped_alerts;
│ │ │ -};
│ │ │ +void swap (bdecode_node& n);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- dropped_alerts
│ │ │ -- a bitmask indicating which alerts were dropped. Each bit represents the
│ │ │ -alert type ID, where bit 0 represents whether any alert of type 0 has
│ │ │ -been dropped, and so on.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
socks5_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert is posted with SOCKS5 related errors, when a SOCKS5 proxy is
│ │ │ -configured. It's enabled with the alert_category::error alert category.
│ │ │ +
Swap contents.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
reserve()
│ │ │
│ │ │ -struct socks5_alert final : alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error;
│ │ │ - error_code error;
│ │ │ - operation_t op;
│ │ │ - aux::noexcept_movable<tcp::endpoint> ip;
│ │ │ -};
│ │ │ +void reserve (int tokens);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- op
│ │ │ -- the operation that failed
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- ip
│ │ │ -- the endpoint configured as the proxy
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
file_prio_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
posted when a prioritize_files() or file_priority() update of the file
│ │ │ -priorities complete, which requires a round-trip to the disk thread.
│ │ │ -
If the disk operation fails this alert won't be posted, but a
│ │ │ -file_error_alert is posted instead, and the torrent is stopped.
│ │ │ +
preallocate memory for the specified numbers of tokens. This is
│ │ │ +useful if you know approximately how many tokens are in the file
│ │ │ +you are about to parse. Doing so will save realloc operations
│ │ │ +while parsing. You should only call this on the root node, before
│ │ │ +passing it in to bdecode().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
switch_underlying_buffer()
│ │ │
│ │ │ -struct file_prio_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ - error_code error;
│ │ │ - operation_t op;
│ │ │ -};
│ │ │ +void switch_underlying_buffer (char const* buf) noexcept;
│ │ │
│ │ │ -
[report issue]
│ │ │ -- error
│ │ │ -- the error
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- op
│ │ │ -- the operation that failed
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
oversized_file_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert may be posted when the initial checking of resume data and files
│ │ │ -on disk (just existence, not piece hashes) completes. If a file belonging
│ │ │ -to the torrent is found on disk, but is larger than the file in the
│ │ │ -torrent, that's when this alert is posted.
│ │ │ -the client may want to call truncate_files() in that case, or perhaps
│ │ │ -interpret it as a sign that some other file is in the way, that shouldn't
│ │ │ -be overwritten.
│ │ │ +
this buffer MUST be identical to the one originally parsed. This
│ │ │ +operation is only defined on owning root nodes, i.e. the one passed in to
│ │ │ +decode().
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
has_soft_error()
│ │ │
│ │ │ -struct oversized_file_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::storage;
│ │ │ -};
│ │ │ +bool has_soft_error (span<char> error) const;
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
torrent_conflict_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
this alert is posted when two separate torrents (magnet links) resolve to
│ │ │ -the same torrent, thus causing the same torrent being added twice. In
│ │ │ -that case, both torrents enter an error state with duplicate_torrent
│ │ │ -as the error code. This alert is posted containing the metadata. For more
│ │ │ -information, see BitTorrent v2 torrents.
│ │ │ -The torrent this alert originated from was the one that downloaded the
│ │ │ -
metadata (i.e. the handle member from the torrent_alert base class).
│ │ │ +
returns true if there is a non-fatal error in the bencoding of this node
│ │ │ +or its children
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum type_t
│ │ │ +
Declared in "libtorrent/bdecode.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| none_t |
│ │ │ +0 |
│ │ │ +uninitialized or default constructed. This is also used
│ │ │ +to indicate that a node was not found in some cases. |
│ │ │ +
│ │ │ +| dict_t |
│ │ │ +1 |
│ │ │ +a dictionary node. The dict_find_ functions are valid. |
│ │ │ +
│ │ │ +| list_t |
│ │ │ +2 |
│ │ │ +a list node. The list_ functions are valid. |
│ │ │ +
│ │ │ +| string_t |
│ │ │ +3 |
│ │ │ +a string node, the string_ functions are valid. |
│ │ │ +
│ │ │ +| int_t |
│ │ │ +4 |
│ │ │ +an integer node. The int_ functions are valid. |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
print_entry()
│ │ │ +
Declared in "libtorrent/bdecode.hpp"
│ │ │
│ │ │ -struct torrent_conflict_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::error;
│ │ │ - torrent_handle conflicting_torrent;
│ │ │ - std::shared_ptr<torrent_info> metadata;
│ │ │ -};
│ │ │ +std::string print_entry (bdecode_node const& e
│ │ │ + , bool single_line = false, int indent = 0);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- conflicting_torrent
│ │ │ -- the handle to the torrent in conflict. The swarm associated with this
│ │ │ -torrent handle did not download the metadata, but the downloaded
│ │ │ -metadata collided with this swarm's info-hash.
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- 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]
│ │ │ -
│ │ │ +
│ │ │ +
bdecode()
│ │ │ +
Declared in "libtorrent/bdecode.hpp"
│ │ │
│ │ │ -struct peer_info_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - std::vector<lt::peer_info> peer_info;
│ │ │ -};
│ │ │ +bdecode_node bdecode (span<char const> buffer
│ │ │ + , error_code& ec, int* error_pos = nullptr, int depth_limit = 100
│ │ │ + , int token_limit = 2000000);
│ │ │ +bdecode_node bdecode (span<char const> buffer
│ │ │ + , int depth_limit = 100, int token_limit = 2000000);
│ │ │ +int bdecode (char const* start, char const* end, bdecode_node& ret
│ │ │ + , error_code& ec, int* error_pos = nullptr, int depth_limit = 100
│ │ │ + , int token_limit = 2000000);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- peer_info
│ │ │ -- the list of the currently connected peers
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
file_progress_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
posted when torrent_handle::post_file_progress() is called
│ │ │ +
This function decodes/parses bdecoded data (for example a .torrent file).
│ │ │ +The data structure is returned in the ret argument. the buffer to parse
│ │ │ +is specified by the start of the buffer as well as the end, i.e. one
│ │ │ +byte past the end. If the buffer fails to parse, the function returns a
│ │ │ +non-zero value and fills in ec with the error code. The optional
│ │ │ +argument error_pos, if set to non-nullptr, will be set to the byte offset
│ │ │ +into the buffer where the parse failure occurred.
│ │ │ +
depth_limit specifies the max number of nested lists or dictionaries are
│ │ │ +allowed in the data structure. (This affects the stack usage of the
│ │ │ +function, be careful not to set it too high).
│ │ │ +
token_limit is the max number of tokens allowed to be parsed from the
│ │ │ +buffer. This is simply a sanity check to not have unbounded memory usage.
│ │ │ +
The resulting bdecode_node is an owning node. That means it will
│ │ │ +be holding the whole parsed tree. When iterating lists and dictionaries,
│ │ │ +those bdecode_node objects will simply have references to the root or
│ │ │ +owning bdecode_node. If the root node is destructed, all other nodes
│ │ │ +that refer to anything in that tree become invalid.
│ │ │ +
However, the underlying buffer passed in to this function (start, end)
│ │ │ +must also remain valid while the bdecoded tree is used. The parsed tree
│ │ │ +produced by this function does not copy any data out of the buffer, but
│ │ │ +simply produces references back into it.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
storage_error
│ │ │ +
Declared in "libtorrent/error_code.hpp"
│ │ │ +
used by storage to return errors
│ │ │ +also includes which underlying file the
│ │ │ +error happened on
│ │ │
│ │ │ -struct file_progress_alert final : torrent_alert
│ │ │ +struct storage_error
│ │ │ {
│ │ │ - std::string message () const override;
│ │ │ + explicit operator bool () const;
│ │ │ + file_index_t file () const;
│ │ │ + void file (file_index_t f);
│ │ │
│ │ │ - static constexpr alert_category_t static_category = alert_category::file_progress;
│ │ │ - aux::vector<std::int64_t, file_index_t> files;
│ │ │ + error_code ec;
│ │ │ + operation_t operation;
│ │ │ };
│ │ │
│ │ │ -
[report issue]
│ │ │ -- files
│ │ │ -- the list of the files in the torrent
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
piece_info_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
posted when torrent_handle::post_download_queue() is called
│ │ │ +
[report issue]
│ │ │ +
bool()
│ │ │
│ │ │ -struct piece_info_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::piece_progress;
│ │ │ - std::vector<partial_piece_info> piece_info;
│ │ │ - std::vector<block_info> block_data;
│ │ │ -};
│ │ │ +explicit operator bool () const;
│ │ │
│ │ │ -
[report issue]
│ │ │ -- piece_info
│ │ │ -- info about pieces being downloaded for the torrent
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- block_data
│ │ │ -- storage for block_info pointers in partial_piece_info objects
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
file()
│ │ │
│ │ │ -struct piece_availability_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - std::vector<int> piece_availability;
│ │ │ -};
│ │ │ +file_index_t file () const;
│ │ │ +void file (file_index_t f);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- piece_availability
│ │ │ -- info about pieces being downloaded for the torrent
│ │ │ +set and query the index (in the torrent) of the file this error
│ │ │ +occurred on. This may also have special values defined in
│ │ │ +torrent_status.
│ │ │ +[report issue]
│ │ │ +- ec
│ │ │ +- the error that occurred
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
tracker_list_alert
│ │ │ -
Declared in "libtorrent/alert_types.hpp"
│ │ │ -
posted when torrent_handle::post_trackers() is called
│ │ │ -
│ │ │ -struct tracker_list_alert final : torrent_alert
│ │ │ -{
│ │ │ - std::string message () const override;
│ │ │ -
│ │ │ - static constexpr alert_category_t static_category = alert_category::status;
│ │ │ - std::vector<announce_entry> trackers;
│ │ │ -};
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- trackers
│ │ │ -- list of trackers and their status for the torrent
│ │ │ +[report issue]
│ │ │ +- operation
│ │ │ +- A code from operation_t enum, indicating what
│ │ │ +kind of operation failed.
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
alert
│ │ │ -
Declared in "libtorrent/alert.hpp"
│ │ │ -
The alert class is the base class that specific messages are derived from.
│ │ │ -alert types are not copyable, and cannot be constructed by the client. The
│ │ │ -pointers returned by libtorrent are short lived (the details are described
│ │ │ -under session_handle::pop_alerts())
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
pcp_category()
│ │ │ +
Declared in "libtorrent/natpmp.hpp"
│ │ │
│ │ │ -struct alert
│ │ │ -{
│ │ │ - time_point timestamp () const;
│ │ │ - virtual int type () const noexcept = 0;
│ │ │ - virtual char const* what () const noexcept = 0;
│ │ │ - virtual std::string message () const = 0;
│ │ │ - virtual alert_category_t category () const noexcept = 0;
│ │ │ -
│ │ │ - static constexpr alert_category_t error_notification = 0_bit;
│ │ │ - static constexpr alert_category_t peer_notification = 1_bit;
│ │ │ - static constexpr alert_category_t port_mapping_notification = 2_bit;
│ │ │ - static constexpr alert_category_t storage_notification = 3_bit;
│ │ │ - static constexpr alert_category_t tracker_notification = 4_bit;
│ │ │ - static constexpr alert_category_t connect_notification = 5_bit;
│ │ │ - static constexpr alert_category_t status_notification = 6_bit;
│ │ │ - static constexpr alert_category_t ip_block_notification = 8_bit;
│ │ │ - static constexpr alert_category_t performance_warning = 9_bit;
│ │ │ - static constexpr alert_category_t dht_notification = 10_bit;
│ │ │ - static constexpr alert_category_t session_log_notification = 13_bit;
│ │ │ - static constexpr alert_category_t torrent_log_notification = 14_bit;
│ │ │ - static constexpr alert_category_t peer_log_notification = 15_bit;
│ │ │ - static constexpr alert_category_t incoming_request_notification = 16_bit;
│ │ │ - static constexpr alert_category_t dht_log_notification = 17_bit;
│ │ │ - static constexpr alert_category_t dht_operation_notification = 18_bit;
│ │ │ - static constexpr alert_category_t port_mapping_log_notification = 19_bit;
│ │ │ - static constexpr alert_category_t picker_log_notification = 20_bit;
│ │ │ - static constexpr alert_category_t file_progress_notification = 21_bit;
│ │ │ - static constexpr alert_category_t piece_progress_notification = 22_bit;
│ │ │ - static constexpr alert_category_t upload_notification = 23_bit;
│ │ │ - static constexpr alert_category_t block_progress_notification = 24_bit;
│ │ │ - static constexpr alert_category_t all_categories = alert_category_t::all();
│ │ │ -};
│ │ │ +boost::system::error_category& pcp_category ();
│ │ │
│ │ │ -
[report issue]
│ │ │ +
│ │ │ +
upnp_category()
│ │ │ +
Declared in "libtorrent/upnp.hpp"
│ │ │
│ │ │ -time_point timestamp () const;
│ │ │ +boost::system::error_category& upnp_category ();
│ │ │
│ │ │ -
a timestamp is automatically created in the constructor
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
type()
│ │ │ +
the boost.system error category for UPnP errors
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
socks_category()
│ │ │ +
Declared in "libtorrent/socks5_stream.hpp"
│ │ │
│ │ │ -virtual int type () const noexcept = 0;
│ │ │ -
│ │ │ -
returns an integer that is unique to this alert type. It can be
│ │ │ -compared against a specific alert by querying a static constant called alert_type
│ │ │ -in the alert. It can be used to determine the run-time type of an alert* in
│ │ │ -order to cast to that alert type and access specific members.
│ │ │ -
e.g:
│ │ │ -
│ │ │ -std::vector<alert*> alerts;
│ │ │ -ses.pop_alerts(&alerts);
│ │ │ -for (alert* a : alerts) {
│ │ │ - switch (a->type()) {
│ │ │ -
│ │ │ - case read_piece_alert::alert_type:
│ │ │ - {
│ │ │ - auto* p = static_cast<read_piece_alert*>(a);
│ │ │ - if (p->ec) {
│ │ │ - break;
│ │ │ - }
│ │ │ - break;
│ │ │ - }
│ │ │ - case file_renamed_alert::alert_type:
│ │ │ - {
│ │ │ - }
│ │ │ - }
│ │ │ -}
│ │ │ +boost::system::error_category& socks_category ();
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
what()
│ │ │ +
returns the error_category for SOCKS5 errors
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
gzip_category()
│ │ │ +
Declared in "libtorrent/gzip.hpp"
│ │ │
│ │ │ -virtual char const* what () const noexcept = 0;
│ │ │ +boost::system::error_category& gzip_category ();
│ │ │
│ │ │ -
returns a string literal describing the type of the alert. It does
│ │ │ -not include any information that might be bundled with the alert.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
message()
│ │ │ +
get the error_category for zip errors
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
i2p_category()
│ │ │ +
Declared in "libtorrent/i2p_stream.hpp"
│ │ │
│ │ │ -virtual std::string message () const = 0;
│ │ │ +boost::system::error_category& i2p_category ();
│ │ │
│ │ │ -
generate a string describing the alert and the information bundled
│ │ │ -with it. This is mainly intended for debug and development use. It is not suitable
│ │ │ -to use this for applications that may be localized. Instead, handle each alert
│ │ │ -type individually and extract and render the information from the alert depending
│ │ │ -on the locale.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
category()
│ │ │ +
returns the error category for I2P errors
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
bdecode_category()
│ │ │ +
Declared in "libtorrent/bdecode.hpp"
│ │ │
│ │ │ -virtual alert_category_t category () const noexcept = 0;
│ │ │ +boost::system::error_category& bdecode_category ();
│ │ │
│ │ │ -
returns a bitmask specifying which categories this alert belong to.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
│ │ │ +
│ │ │ -
│ │ │ -
alert_cast()
│ │ │ -
Declared in "libtorrent/alert.hpp"
│ │ │ +
return the instance of the libtorrent_error_category which
│ │ │ +maps libtorrent error codes to human readable error messages.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
http_category()
│ │ │ +
Declared in "libtorrent/error_code.hpp"
│ │ │
│ │ │ -template <typename T> T const* alert_cast (alert const* a);
│ │ │ -template <typename T> T* alert_cast (alert* a);
│ │ │ +boost::system::error_category& http_category ();
│ │ │
│ │ │ -
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]
│ │ │ -
│ │ │ +
│ │ │ +
enum pcp_errors
│ │ │ +
Declared in "libtorrent/natpmp.hpp"
│ │ │
│ │ │
│ │ │ -
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| pcp_success |
│ │ │ +0 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_unsupp_version |
│ │ │ +1 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_not_authorized |
│ │ │ +2 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_malformed_request |
│ │ │ +3 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_unsupp_opcode |
│ │ │ +4 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_unsupp_option |
│ │ │ +5 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_malformed_option |
│ │ │ +6 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_network_failure |
│ │ │ +7 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_no_resources |
│ │ │ +8 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_unsupp_protocol |
│ │ │ +9 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_user_ex_quota |
│ │ │ +10 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_cannot_provide_external |
│ │ │ +11 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_address_mismatch |
│ │ │ +12 |
│ │ │ + |
│ │ │ +
│ │ │ +| pcp_excessive_remote_peers |
│ │ │ +13 |
│ │ │ + |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum error_code_enum
│ │ │ +
Declared in "libtorrent/upnp.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │
│ │ │ -
│ │ │ +
│ │ │
│ │ │
│ │ │ | name |
│ │ │ value |
│ │ │ description |
│ │ │
│ │ │
│ │ │
│ │ │ -| unknown |
│ │ │ +
| no_error |
│ │ │ 0 |
│ │ │ -the error was unexpected and it is unknown which operation caused it |
│ │ │ +No error |
│ │ │
│ │ │ -| bittorrent |
│ │ │ +
| invalid_argument |
│ │ │ +402 |
│ │ │ +One of the arguments in the request is invalid |
│ │ │ +
│ │ │ +| action_failed |
│ │ │ +501 |
│ │ │ +The request failed |
│ │ │ +
│ │ │ +| value_not_in_array |
│ │ │ +714 |
│ │ │ +The specified value does not exist in the array |
│ │ │ +
│ │ │ +| source_ip_cannot_be_wildcarded |
│ │ │ +715 |
│ │ │ +The source IP address cannot be wild-carded, but
│ │ │ +must be fully specified |
│ │ │ +
│ │ │ +| external_port_cannot_be_wildcarded |
│ │ │ +716 |
│ │ │ +The external port cannot be a wildcard, but must
│ │ │ +be specified |
│ │ │ +
│ │ │ +| port_mapping_conflict |
│ │ │ +718 |
│ │ │ +The port mapping entry specified conflicts with a
│ │ │ +mapping assigned previously to another client |
│ │ │ +
│ │ │ +| internal_port_must_match_external |
│ │ │ +724 |
│ │ │ +Internal and external port value must be the same |
│ │ │ +
│ │ │ +| only_permanent_leases_supported |
│ │ │ +725 |
│ │ │ +The NAT implementation only supports permanent
│ │ │ +lease times on port mappings |
│ │ │ +
│ │ │ +| remote_host_must_be_wildcard |
│ │ │ +726 |
│ │ │ +RemoteHost must be a wildcard and cannot be a
│ │ │ +specific IP address or DNS name |
│ │ │ +
│ │ │ +| external_port_must_be_wildcard |
│ │ │ +727 |
│ │ │ +ExternalPort must be a wildcard and cannot be a
│ │ │ +specific port |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum socks_error_code
│ │ │ +
Declared in "libtorrent/socks5_stream.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| no_error |
│ │ │ +0 |
│ │ │ + |
│ │ │ +
│ │ │ +| unsupported_version |
│ │ │ 1 |
│ │ │ -this is used when the bittorrent logic
│ │ │ -determines to disconnect |
│ │ │ + |
│ │ │
│ │ │ -| iocontrol |
│ │ │ +
| unsupported_authentication_method |
│ │ │ 2 |
│ │ │ -a call to iocontrol failed |
│ │ │ + |
│ │ │
│ │ │ -| getpeername |
│ │ │ +
| unsupported_authentication_version |
│ │ │ 3 |
│ │ │ -a call to getpeername() failed (querying the remote IP of a
│ │ │ -connection) |
│ │ │ + |
│ │ │
│ │ │ -| getname |
│ │ │ +
| authentication_error |
│ │ │ 4 |
│ │ │ -a call to getname failed (querying the local IP of a
│ │ │ -connection) |
│ │ │ + |
│ │ │
│ │ │ -| alloc_recvbuf |
│ │ │ +
| username_required |
│ │ │ 5 |
│ │ │ -an attempt to allocate a receive buffer failed |
│ │ │ + |
│ │ │
│ │ │ -| alloc_sndbuf |
│ │ │ +
| general_failure |
│ │ │ 6 |
│ │ │ -an attempt to allocate a send buffer failed |
│ │ │ + |
│ │ │
│ │ │ -| file_write |
│ │ │ +
| command_not_supported |
│ │ │ 7 |
│ │ │ -writing to a file failed |
│ │ │ + |
│ │ │
│ │ │ -| file_read |
│ │ │ +
| no_identd |
│ │ │ 8 |
│ │ │ -reading from a file failed |
│ │ │ + |
│ │ │
│ │ │ -| file |
│ │ │ +
| identd_error |
│ │ │ 9 |
│ │ │ -a non-read and non-write file operation failed |
│ │ │ + |
│ │ │
│ │ │ -| sock_write |
│ │ │ +
| num_errors |
│ │ │ 10 |
│ │ │ -a socket write operation failed |
│ │ │ + |
│ │ │
│ │ │ -| sock_read |
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum error_code_enum
│ │ │ +
Declared in "libtorrent/gzip.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| no_error |
│ │ │ +0 |
│ │ │ +Not an error |
│ │ │ +
│ │ │ +| invalid_gzip_header |
│ │ │ +1 |
│ │ │ +the supplied gzip buffer has invalid header |
│ │ │ +
│ │ │ +| inflated_data_too_large |
│ │ │ +2 |
│ │ │ +the gzip buffer would inflate to more bytes than the specified
│ │ │ +maximum size, and was rejected. |
│ │ │ +
│ │ │ +| data_did_not_terminate |
│ │ │ +3 |
│ │ │ +available inflate data did not terminate |
│ │ │ +
│ │ │ +| space_exhausted |
│ │ │ +4 |
│ │ │ +output space exhausted before completing inflate |
│ │ │ +
│ │ │ +| invalid_block_type |
│ │ │ +5 |
│ │ │ +invalid block type (type == 3) |
│ │ │ +
│ │ │ +| invalid_stored_block_length |
│ │ │ +6 |
│ │ │ +stored block length did not match one's complement |
│ │ │ +
│ │ │ +| too_many_length_or_distance_codes |
│ │ │ +7 |
│ │ │ +dynamic block code description: too many length or distance codes |
│ │ │ +
│ │ │ +| code_lengths_codes_incomplete |
│ │ │ +8 |
│ │ │ +dynamic block code description: code lengths codes incomplete |
│ │ │ +
│ │ │ +| repeat_lengths_with_no_first_length |
│ │ │ +9 |
│ │ │ +dynamic block code description: repeat lengths with no first length |
│ │ │ +
│ │ │ +| repeat_more_than_specified_lengths |
│ │ │ +10 |
│ │ │ +dynamic block code description: repeat more than specified lengths |
│ │ │ +
│ │ │ +| invalid_literal_length_code_lengths |
│ │ │ 11 |
│ │ │ -a socket read operation failed |
│ │ │ +dynamic block code description: invalid literal/length code lengths |
│ │ │
│ │ │ -| sock_open |
│ │ │ +
| invalid_distance_code_lengths |
│ │ │ 12 |
│ │ │ -a call to open(), to create a socket socket failed |
│ │ │ +dynamic block code description: invalid distance code lengths |
│ │ │
│ │ │ -| sock_bind |
│ │ │ +
| invalid_literal_code_in_block |
│ │ │ 13 |
│ │ │ -a call to bind() on a socket failed |
│ │ │ +invalid literal/length or distance code in fixed or dynamic block |
│ │ │
│ │ │ -| available |
│ │ │ +
| distance_too_far_back_in_block |
│ │ │ 14 |
│ │ │ -an attempt to query the number of bytes available to read from a socket
│ │ │ -failed |
│ │ │ +distance is too far back in fixed or dynamic block |
│ │ │
│ │ │ -| encryption |
│ │ │ +
| unknown_gzip_error |
│ │ │ 15 |
│ │ │ -a call related to bittorrent protocol encryption failed |
│ │ │ +an unknown error occurred during gzip inflation |
│ │ │
│ │ │ -| connect |
│ │ │ +
| error_code_max |
│ │ │ 16 |
│ │ │ -an attempt to connect a socket failed |
│ │ │ +the number of error codes |
│ │ │
│ │ │ -| ssl_handshake |
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum i2p_error_code
│ │ │ +
Declared in "libtorrent/i2p_stream.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| no_error |
│ │ │ +0 |
│ │ │ + |
│ │ │ +
│ │ │ +| parse_failed |
│ │ │ +1 |
│ │ │ + |
│ │ │ +
│ │ │ +| cant_reach_peer |
│ │ │ +2 |
│ │ │ + |
│ │ │ +
│ │ │ +| i2p_error |
│ │ │ +3 |
│ │ │ + |
│ │ │ +
│ │ │ +| invalid_key |
│ │ │ +4 |
│ │ │ + |
│ │ │ +
│ │ │ +| invalid_id |
│ │ │ +5 |
│ │ │ + |
│ │ │ +
│ │ │ +| timeout |
│ │ │ +6 |
│ │ │ + |
│ │ │ +
│ │ │ +| key_not_found |
│ │ │ +7 |
│ │ │ + |
│ │ │ +
│ │ │ +| duplicated_id |
│ │ │ +8 |
│ │ │ + |
│ │ │ +
│ │ │ +| num_errors |
│ │ │ +9 |
│ │ │ + |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum error_code_enum
│ │ │ +
Declared in "libtorrent/bdecode.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| no_error |
│ │ │ +0 |
│ │ │ +Not an error |
│ │ │ +
│ │ │ +| expected_digit |
│ │ │ +1 |
│ │ │ +expected digit in bencoded string |
│ │ │ +
│ │ │ +| expected_colon |
│ │ │ +2 |
│ │ │ +expected colon in bencoded string |
│ │ │ +
│ │ │ +| unexpected_eof |
│ │ │ +3 |
│ │ │ +unexpected end of file in bencoded string |
│ │ │ +
│ │ │ +| expected_value |
│ │ │ +4 |
│ │ │ +expected value (list, dict, int or string) in bencoded string |
│ │ │ +
│ │ │ +| depth_exceeded |
│ │ │ +5 |
│ │ │ +bencoded recursion depth limit exceeded |
│ │ │ +
│ │ │ +| limit_exceeded |
│ │ │ +6 |
│ │ │ +bencoded item count limit exceeded |
│ │ │ +
│ │ │ +| overflow |
│ │ │ +7 |
│ │ │ +integer overflow |
│ │ │ +
│ │ │ +| error_code_max |
│ │ │ +8 |
│ │ │ +the number of error codes |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum error_code_enum
│ │ │ +
Declared in "libtorrent/error_code.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| no_error |
│ │ │ +0 |
│ │ │ +Not an error |
│ │ │ +
│ │ │ +| file_collision |
│ │ │ +1 |
│ │ │ +Two torrents has files which end up overwriting each other |
│ │ │ +
│ │ │ +| failed_hash_check |
│ │ │ +2 |
│ │ │ +A piece did not match its piece hash |
│ │ │ +
│ │ │ +| torrent_is_no_dict |
│ │ │ +3 |
│ │ │ +The .torrent file does not contain a bencoded dictionary at
│ │ │ +its top level |
│ │ │ +
│ │ │ +| torrent_missing_info |
│ │ │ +4 |
│ │ │ +The .torrent file does not have an info dictionary |
│ │ │ +
│ │ │ +| torrent_info_no_dict |
│ │ │ +5 |
│ │ │ +The .torrent file's info entry is not a dictionary |
│ │ │ +
│ │ │ +| torrent_missing_piece_length |
│ │ │ +6 |
│ │ │ +The .torrent file does not have a piece length entry |
│ │ │ +
│ │ │ +| torrent_missing_name |
│ │ │ +7 |
│ │ │ +The .torrent file does not have a name entry |
│ │ │ +
│ │ │ +| torrent_invalid_name |
│ │ │ +8 |
│ │ │ +The .torrent file's name entry is invalid |
│ │ │ +
│ │ │ +| torrent_invalid_length |
│ │ │ +9 |
│ │ │ +The length of a file, or of the whole .torrent file is invalid.
│ │ │ +Either negative or not an integer |
│ │ │ +
│ │ │ +| torrent_file_parse_failed |
│ │ │ +10 |
│ │ │ +Failed to parse a file entry in the .torrent |
│ │ │ +
│ │ │ +| torrent_missing_pieces |
│ │ │ +11 |
│ │ │ +The pieces field is missing or invalid in the .torrent file |
│ │ │ +
│ │ │ +| torrent_invalid_hashes |
│ │ │ +12 |
│ │ │ +The pieces string has incorrect length |
│ │ │ +
│ │ │ +| too_many_pieces_in_torrent |
│ │ │ +13 |
│ │ │ +The .torrent file has more pieces than is supported by libtorrent |
│ │ │ +
│ │ │ +| invalid_swarm_metadata |
│ │ │ +14 |
│ │ │ +The metadata (.torrent file) that was received from the swarm
│ │ │ +matched the info-hash, but failed to be parsed |
│ │ │ +
│ │ │ +| invalid_bencoding |
│ │ │ +15 |
│ │ │ +The file or buffer is not correctly bencoded |
│ │ │ +
│ │ │ +| no_files_in_torrent |
│ │ │ +16 |
│ │ │ +The .torrent file does not contain any files |
│ │ │ +
│ │ │ +| invalid_escaped_string |
│ │ │ 17 |
│ │ │ -establishing an SSL connection failed |
│ │ │ +The string was not properly url-encoded as expected |
│ │ │
│ │ │ -| get_interface |
│ │ │ +
| session_is_closing |
│ │ │ 18 |
│ │ │ -a connection failed to satisfy the bind interface setting |
│ │ │ +Operation is not permitted since the session is shutting down |
│ │ │
│ │ │ -| sock_listen |
│ │ │ +
| duplicate_torrent |
│ │ │ 19 |
│ │ │ -a call to listen() on a socket |
│ │ │ +There's already a torrent with that info-hash added to the
│ │ │ +session |
│ │ │
│ │ │ -| sock_bind_to_device |
│ │ │ +
| invalid_torrent_handle |
│ │ │ 20 |
│ │ │ -a call to the ioctl to bind a socket to a specific network device or
│ │ │ -adapter |
│ │ │ +The supplied torrent_handle is not referring to a valid torrent |
│ │ │
│ │ │ -| sock_accept |
│ │ │ +
| invalid_entry_type |
│ │ │ 21 |
│ │ │ -a call to accept() on a socket |
│ │ │ +The type requested from the entry did not match its type |
│ │ │
│ │ │ -| parse_address |
│ │ │ +
| missing_info_hash_in_uri |
│ │ │ 22 |
│ │ │ -convert a string into a valid network address |
│ │ │ +The specified URI does not contain a valid info-hash |
│ │ │
│ │ │ -| enum_if |
│ │ │ +
| file_too_short |
│ │ │ 23 |
│ │ │ -enumeration network devices or adapters |
│ │ │ +One of the files in the torrent was unexpectedly small. This
│ │ │ +might be caused by files being changed by an external process |
│ │ │
│ │ │ -| file_stat |
│ │ │ +
| unsupported_url_protocol |
│ │ │ 24 |
│ │ │ -invoking stat() on a file |
│ │ │ +The URL used an unknown protocol. Currently http and
│ │ │ +https (if built with openssl support) are recognized. For
│ │ │ +trackers udp is recognized as well. |
│ │ │
│ │ │ -| file_copy |
│ │ │ +
| url_parse_error |
│ │ │ 25 |
│ │ │ -copying a file |
│ │ │ +The URL did not conform to URL syntax and failed to be parsed |
│ │ │
│ │ │ -| file_fallocate |
│ │ │ +
| peer_sent_empty_piece |
│ │ │ 26 |
│ │ │ -allocating storage for a file |
│ │ │ +The peer sent a piece message of length 0 |
│ │ │
│ │ │ -| file_hard_link |
│ │ │ +
| parse_failed |
│ │ │ 27 |
│ │ │ -creating a hard link |
│ │ │ +A bencoded structure was corrupt and failed to be parsed |
│ │ │
│ │ │ -| file_remove |
│ │ │ +
| invalid_file_tag |
│ │ │ 28 |
│ │ │ -removing a file |
│ │ │ +The fast resume file was missing or had an invalid file version
│ │ │ +tag |
│ │ │
│ │ │ -| file_rename |
│ │ │ +
| missing_info_hash |
│ │ │ 29 |
│ │ │ -renaming a file |
│ │ │ +The fast resume file was missing or had an invalid info-hash |
│ │ │
│ │ │ -| file_open |
│ │ │ +
| mismatching_info_hash |
│ │ │ 30 |
│ │ │ -opening a file |
│ │ │ +The info-hash did not match the torrent |
│ │ │
│ │ │ -| mkdir |
│ │ │ +
| invalid_hostname |
│ │ │ 31 |
│ │ │ -creating a directory |
│ │ │ +The URL contained an invalid hostname |
│ │ │
│ │ │ -| check_resume |
│ │ │ +
| invalid_port |
│ │ │ 32 |
│ │ │ -check fast resume data against files on disk |
│ │ │ +The URL had an invalid port |
│ │ │
│ │ │ -| exception |
│ │ │ +
| port_blocked |
│ │ │ 33 |
│ │ │ -an unknown exception |
│ │ │ +The port is blocked by the port-filter, and prevented the
│ │ │ +connection |
│ │ │
│ │ │ -| alloc_cache_piece |
│ │ │ +
| expected_close_bracket_in_address |
│ │ │ 34 |
│ │ │ -allocate space for a piece in the cache |
│ │ │ +The IPv6 address was expected to end with "]" |
│ │ │
│ │ │ -| partfile_move |
│ │ │ +
| destructing_torrent |
│ │ │ 35 |
│ │ │ -move a part-file |
│ │ │ +The torrent is being destructed, preventing the operation to
│ │ │ +succeed |
│ │ │
│ │ │ -| partfile_read |
│ │ │ +
| timed_out |
│ │ │ 36 |
│ │ │ -read from a part file |
│ │ │ +The connection timed out |
│ │ │
│ │ │ -| partfile_write |
│ │ │ +
| upload_upload_connection |
│ │ │ 37 |
│ │ │ -write to a part-file |
│ │ │ +The peer is upload only, and we are upload only. There's no point
│ │ │ +in keeping the connection |
│ │ │
│ │ │ -| hostname_lookup |
│ │ │ +
| uninteresting_upload_peer |
│ │ │ 38 |
│ │ │ -a hostname lookup |
│ │ │ +The peer is upload only, and we're not interested in it. There's
│ │ │ +no point in keeping the connection |
│ │ │
│ │ │ -| symlink |
│ │ │ +
| invalid_info_hash |
│ │ │ 39 |
│ │ │ -create or read a symlink |
│ │ │ +The peer sent an unknown info-hash |
│ │ │
│ │ │ -| handshake |
│ │ │ +
| torrent_paused |
│ │ │ 40 |
│ │ │ -handshake with a peer or server |
│ │ │ +The torrent is paused, preventing the operation from succeeding |
│ │ │
│ │ │ -| sock_option |
│ │ │ +
| invalid_have |
│ │ │ 41 |
│ │ │ -set socket option |
│ │ │ +The peer sent an invalid have message, either wrong size or
│ │ │ +referring to a piece that doesn't exist in the torrent |
│ │ │
│ │ │ -| enum_route |
│ │ │ +
| invalid_bitfield_size |
│ │ │ 42 |
│ │ │ -enumeration of network routes |
│ │ │ +The bitfield message had the incorrect size |
│ │ │
│ │ │ -| file_seek |
│ │ │ +
| too_many_requests_when_choked |
│ │ │ 43 |
│ │ │ -moving read/write position in a file, operation_t::hostname_lookup |
│ │ │ +The peer kept requesting pieces after it was choked, possible
│ │ │ +abuse attempt. |
│ │ │
│ │ │ -| timer |
│ │ │ +
| invalid_piece |
│ │ │ 44 |
│ │ │ -an async wait operation on a timer |
│ │ │ +The peer sent a piece message that does not correspond to a
│ │ │ +piece request sent by the client |
│ │ │
│ │ │ -| file_mmap |
│ │ │ +
| no_memory |
│ │ │ 45 |
│ │ │ -call to mmap() (or windows counterpart) |
│ │ │ +memory allocation failed |
│ │ │
│ │ │ -| file_truncate |
│ │ │ +
| torrent_aborted |
│ │ │ 46 |
│ │ │ -call to ftruncate() (or SetEndOfFile() on windows) |
│ │ │ +The torrent is aborted, preventing the operation to succeed |
│ │ │ +
│ │ │ +| self_connection |
│ │ │ +47 |
│ │ │ +The peer is a connection to ourself, no point in keeping it |
│ │ │ +
│ │ │ +| invalid_piece_size |
│ │ │ +48 |
│ │ │ +The peer sent a piece message with invalid size, either negative
│ │ │ +or greater than one block |
│ │ │ +
│ │ │ +| timed_out_no_interest |
│ │ │ +49 |
│ │ │ +The peer has not been interesting or interested in us for too
│ │ │ +long, no point in keeping it around |
│ │ │ +
│ │ │ +| timed_out_inactivity |
│ │ │ +50 |
│ │ │ +The peer has not said anything in a long time, possibly dead |
│ │ │ +
│ │ │ +| timed_out_no_handshake |
│ │ │ +51 |
│ │ │ +The peer did not send a handshake within a reasonable amount of
│ │ │ +time, it might not be a bittorrent peer |
│ │ │ +
│ │ │ +| timed_out_no_request |
│ │ │ +52 |
│ │ │ +The peer has been unchoked for too long without requesting any
│ │ │ +data. It might be lying about its interest in us |
│ │ │ +
│ │ │ +| invalid_choke |
│ │ │ +53 |
│ │ │ +The peer sent an invalid choke message |
│ │ │ +
│ │ │ +| invalid_unchoke |
│ │ │ +54 |
│ │ │ +The peer send an invalid unchoke message |
│ │ │ +
│ │ │ +| invalid_interested |
│ │ │ +55 |
│ │ │ +The peer sent an invalid interested message |
│ │ │ +
│ │ │ +| invalid_not_interested |
│ │ │ +56 |
│ │ │ +The peer sent an invalid not-interested message |
│ │ │ +
│ │ │ +| invalid_request |
│ │ │ +57 |
│ │ │ +The peer sent an invalid piece request message |
│ │ │ +
│ │ │ +| invalid_hash_list |
│ │ │ +58 |
│ │ │ +The peer sent an invalid hash-list message (this is part of the
│ │ │ +merkle-torrent extension) |
│ │ │ +
│ │ │ +| invalid_hash_piece |
│ │ │ +59 |
│ │ │ +The peer sent an invalid hash-piece message (this is part of the
│ │ │ +merkle-torrent extension) |
│ │ │ +
│ │ │ +| invalid_cancel |
│ │ │ +60 |
│ │ │ +The peer sent an invalid cancel message |
│ │ │ +
│ │ │ +| invalid_dht_port |
│ │ │ +61 |
│ │ │ +The peer sent an invalid DHT port-message |
│ │ │ +
│ │ │ +| invalid_suggest |
│ │ │ +62 |
│ │ │ +The peer sent an invalid suggest piece-message |
│ │ │ +
│ │ │ +| invalid_have_all |
│ │ │ +63 |
│ │ │ +The peer sent an invalid have all-message |
│ │ │ +
│ │ │ +| invalid_have_none |
│ │ │ +64 |
│ │ │ +The peer sent an invalid have none-message |
│ │ │ +
│ │ │ +| invalid_reject |
│ │ │ +65 |
│ │ │ +The peer sent an invalid reject message |
│ │ │ +
│ │ │ +| invalid_allow_fast |
│ │ │ +66 |
│ │ │ +The peer sent an invalid allow fast-message |
│ │ │ +
│ │ │ +| invalid_extended |
│ │ │ +67 |
│ │ │ +The peer sent an invalid extension message ID |
│ │ │ +
│ │ │ +| invalid_message |
│ │ │ +68 |
│ │ │ +The peer sent an invalid message ID |
│ │ │ +
│ │ │ +| sync_hash_not_found |
│ │ │ +69 |
│ │ │ +The synchronization hash was not found in the encrypted handshake |
│ │ │ +
│ │ │ +| invalid_encryption_constant |
│ │ │ +70 |
│ │ │ +The encryption constant in the handshake is invalid |
│ │ │ +
│ │ │ +| no_plaintext_mode |
│ │ │ +71 |
│ │ │ +The peer does not support plain text, which is the selected mode |
│ │ │ +
│ │ │ +| no_rc4_mode |
│ │ │ +72 |
│ │ │ +The peer does not support RC4, which is the selected mode |
│ │ │ +
│ │ │ +| unsupported_encryption_mode |
│ │ │ +73 |
│ │ │ +The peer does not support any of the encryption modes that the
│ │ │ +client supports |
│ │ │ +
│ │ │ +| unsupported_encryption_mode_selected |
│ │ │ +74 |
│ │ │ +The peer selected an encryption mode that the client did not
│ │ │ +advertise and does not support |
│ │ │ +
│ │ │ +| invalid_pad_size |
│ │ │ +75 |
│ │ │ +The pad size used in the encryption handshake is of invalid size |
│ │ │ +
│ │ │ +| invalid_encrypt_handshake |
│ │ │ +76 |
│ │ │ +The encryption handshake is invalid |
│ │ │ +
│ │ │ +| no_incoming_encrypted |
│ │ │ +77 |
│ │ │ +The client is set to not support incoming encrypted connections
│ │ │ +and this is an encrypted connection |
│ │ │ +
│ │ │ +| no_incoming_regular |
│ │ │ +78 |
│ │ │ +The client is set to not support incoming regular bittorrent
│ │ │ +connections, and this is a regular connection |
│ │ │ +
│ │ │ +| duplicate_peer_id |
│ │ │ +79 |
│ │ │ +The client is already connected to this peer-ID |
│ │ │ +
│ │ │ +| torrent_removed |
│ │ │ +80 |
│ │ │ +Torrent was removed |
│ │ │ +
│ │ │ +| packet_too_large |
│ │ │ +81 |
│ │ │ +The packet size exceeded the upper sanity check-limit |
│ │ │ +
│ │ │ +| reserved |
│ │ │ +82 |
│ │ │ + |
│ │ │ +
│ │ │ +| http_error |
│ │ │ +83 |
│ │ │ +The web server responded with an error |
│ │ │ +
│ │ │ +| missing_location |
│ │ │ +84 |
│ │ │ +The web server response is missing a location header |
│ │ │ +
│ │ │ +| invalid_redirection |
│ │ │ +85 |
│ │ │ +The web seed redirected to a path that no longer matches the
│ │ │ +.torrent directory structure |
│ │ │ +
│ │ │ +| redirecting |
│ │ │ +86 |
│ │ │ +The connection was closed because it redirected to a different
│ │ │ +URL |
│ │ │ +
│ │ │ +| invalid_range |
│ │ │ +87 |
│ │ │ +The HTTP range header is invalid |
│ │ │ +
│ │ │ +| no_content_length |
│ │ │ +88 |
│ │ │ +The HTTP response did not have a content length |
│ │ │ +
│ │ │ +| banned_by_ip_filter |
│ │ │ +89 |
│ │ │ +The IP is blocked by the IP filter |
│ │ │ +
│ │ │ +| too_many_connections |
│ │ │ +90 |
│ │ │ +At the connection limit |
│ │ │ +
│ │ │ +| peer_banned |
│ │ │ +91 |
│ │ │ +The peer is marked as banned |
│ │ │ +
│ │ │ +| stopping_torrent |
│ │ │ +92 |
│ │ │ +The torrent is stopping, causing the operation to fail |
│ │ │ +
│ │ │ +| too_many_corrupt_pieces |
│ │ │ +93 |
│ │ │ +The peer has sent too many corrupt pieces and is banned |
│ │ │ +
│ │ │ +| torrent_not_ready |
│ │ │ +94 |
│ │ │ +The torrent is not ready to receive peers |
│ │ │ +
│ │ │ +| peer_not_constructed |
│ │ │ +95 |
│ │ │ +The peer is not completely constructed yet |
│ │ │ +
│ │ │ +| session_closing |
│ │ │ +96 |
│ │ │ +The session is closing, causing the operation to fail |
│ │ │ +
│ │ │ +| optimistic_disconnect |
│ │ │ +97 |
│ │ │ +The peer was disconnected in order to leave room for a
│ │ │ +potentially better peer |
│ │ │ +
│ │ │ +| torrent_finished |
│ │ │ +98 |
│ │ │ +The torrent is finished |
│ │ │ +
│ │ │ +| no_router |
│ │ │ +99 |
│ │ │ +No UPnP router found |
│ │ │ +
│ │ │ +| metadata_too_large |
│ │ │ +100 |
│ │ │ +The metadata message says the metadata exceeds the limit |
│ │ │ +
│ │ │ +| invalid_metadata_request |
│ │ │ +101 |
│ │ │ +The peer sent an invalid metadata request message |
│ │ │ +
│ │ │ +| invalid_metadata_size |
│ │ │ +102 |
│ │ │ +The peer advertised an invalid metadata size |
│ │ │ +
│ │ │ +| invalid_metadata_offset |
│ │ │ +103 |
│ │ │ +The peer sent a message with an invalid metadata offset |
│ │ │ +
│ │ │ +| invalid_metadata_message |
│ │ │ +104 |
│ │ │ +The peer sent an invalid metadata message |
│ │ │ +
│ │ │ +| pex_message_too_large |
│ │ │ +105 |
│ │ │ +The peer sent a peer exchange message that was too large |
│ │ │ +
│ │ │ +| invalid_pex_message |
│ │ │ +106 |
│ │ │ +The peer sent an invalid peer exchange message |
│ │ │ +
│ │ │ +| invalid_lt_tracker_message |
│ │ │ +107 |
│ │ │ +The peer sent an invalid tracker exchange message |
│ │ │ +
│ │ │ +| too_frequent_pex |
│ │ │ +108 |
│ │ │ +The peer sent an pex messages too often. This is a possible
│ │ │ +attempt of and attack |
│ │ │ +
│ │ │ +| no_metadata |
│ │ │ +109 |
│ │ │ +The operation failed because it requires the torrent to have
│ │ │ +the metadata (.torrent file) and it doesn't have it yet.
│ │ │ +This happens for magnet links before they have downloaded the
│ │ │ +metadata, and also torrents added by URL. |
│ │ │ +
│ │ │ +| invalid_dont_have |
│ │ │ +110 |
│ │ │ +The peer sent an invalid dont_have message. The don't have
│ │ │ +message is an extension to allow peers to advertise that the
│ │ │ +no longer has a piece they previously had. |
│ │ │ +
│ │ │ +| requires_ssl_connection |
│ │ │ +111 |
│ │ │ +The peer tried to connect to an SSL torrent without connecting
│ │ │ +over SSL. |
│ │ │ +
│ │ │ +| invalid_ssl_cert |
│ │ │ +112 |
│ │ │ +The peer tried to connect to a torrent with a certificate
│ │ │ +for a different torrent. |
│ │ │ +
│ │ │ +| not_an_ssl_torrent |
│ │ │ +113 |
│ │ │ +the torrent is not an SSL torrent, and the operation requires
│ │ │ +an SSL torrent |
│ │ │ +
│ │ │ +| banned_by_port_filter |
│ │ │ +114 |
│ │ │ +peer was banned because its listen port is within a banned port
│ │ │ +range, as specified by the port_filter. |
│ │ │ +
│ │ │ +| invalid_session_handle |
│ │ │ +115 |
│ │ │ +The session_handle is not referring to a valid session_impl |
│ │ │ +
│ │ │ +| invalid_listen_socket |
│ │ │ +116 |
│ │ │ +the listen socket associated with this request was closed |
│ │ │ +
│ │ │ +| invalid_hash_request |
│ │ │ +117 |
│ │ │ + |
│ │ │ +
│ │ │ +| invalid_hashes |
│ │ │ +118 |
│ │ │ + |
│ │ │ +
│ │ │ +| invalid_hash_reject |
│ │ │ +119 |
│ │ │ + |
│ │ │ +
│ │ │ +| deprecated_120 |
│ │ │ +120 |
│ │ │ + |
│ │ │ +
│ │ │ +| deprecated_121 |
│ │ │ +121 |
│ │ │ + |
│ │ │ +
│ │ │ +| deprecated_122 |
│ │ │ +122 |
│ │ │ + |
│ │ │ +
│ │ │ +| deprecated_123 |
│ │ │ +123 |
│ │ │ + |
│ │ │ +
│ │ │ +| deprecated_124 |
│ │ │ +124 |
│ │ │ + |
│ │ │ +
│ │ │ +| missing_file_sizes |
│ │ │ +130 |
│ │ │ +The resume data file is missing the file sizes entry |
│ │ │ +
│ │ │ +| no_files_in_resume_data |
│ │ │ +131 |
│ │ │ +The resume data file file sizes entry is empty |
│ │ │ +
│ │ │ +| missing_pieces |
│ │ │ +132 |
│ │ │ +The resume data file is missing the pieces and slots entry |
│ │ │ +
│ │ │ +| mismatching_number_of_files |
│ │ │ +133 |
│ │ │ +The number of files in the resume data does not match the number
│ │ │ +of files in the torrent |
│ │ │ +
│ │ │ +| mismatching_file_size |
│ │ │ +134 |
│ │ │ +One of the files on disk has a different size than in the fast
│ │ │ +resume file |
│ │ │ +
│ │ │ +| mismatching_file_timestamp |
│ │ │ +135 |
│ │ │ +One of the files on disk has a different timestamp than in the
│ │ │ +fast resume file |
│ │ │ +
│ │ │ +| not_a_dictionary |
│ │ │ +136 |
│ │ │ +The resume data file is not a dictionary |
│ │ │ +
│ │ │ +| invalid_blocks_per_piece |
│ │ │ +137 |
│ │ │ +The blocks per piece entry is invalid in the resume data file |
│ │ │ +
│ │ │ +| missing_slots |
│ │ │ +138 |
│ │ │ +The resume file is missing the slots entry, which is required
│ │ │ +for torrents with compact allocation. DEPRECATED |
│ │ │ +
│ │ │ +| too_many_slots |
│ │ │ +139 |
│ │ │ +The resume file contains more slots than the torrent |
│ │ │ +
│ │ │ +| invalid_slot_list |
│ │ │ +140 |
│ │ │ +The slot entry is invalid in the resume data |
│ │ │ +
│ │ │ +| invalid_piece_index |
│ │ │ +141 |
│ │ │ +One index in the slot list is invalid |
│ │ │ +
│ │ │ +| pieces_need_reorder |
│ │ │ +142 |
│ │ │ +The pieces on disk needs to be re-ordered for the specified
│ │ │ +allocation mode. This happens if you specify sparse allocation
│ │ │ +and the files on disk are using compact storage. The pieces needs
│ │ │ +to be moved to their right position. DEPRECATED |
│ │ │ +
│ │ │ +| resume_data_not_modified |
│ │ │ +143 |
│ │ │ +this error is returned when asking to save resume data and
│ │ │ +specifying the flag to only save when there's anything new to save
│ │ │ +(torrent_handle::only_if_modified) and there wasn't anything changed. |
│ │ │ +
│ │ │ +| invalid_save_path |
│ │ │ +144 |
│ │ │ +the save_path in add_torrent_params is not valid |
│ │ │ +
│ │ │ +| http_parse_error |
│ │ │ +150 |
│ │ │ +The HTTP header was not correctly formatted |
│ │ │ +
│ │ │ +| http_missing_location |
│ │ │ +151 |
│ │ │ +The HTTP response was in the 300-399 range but lacked a location
│ │ │ +header |
│ │ │ +
│ │ │ +| http_failed_decompress |
│ │ │ +152 |
│ │ │ +The HTTP response was encoded with gzip or deflate but
│ │ │ +decompressing it failed |
│ │ │ +
│ │ │ +| no_i2p_router |
│ │ │ +160 |
│ │ │ +The URL specified an i2p address, but no i2p router is configured |
│ │ │ +
│ │ │ +| no_i2p_endpoint |
│ │ │ +161 |
│ │ │ +i2p acceptor is not available yet, can't announce without endpoint |
│ │ │ +
│ │ │ +| scrape_not_available |
│ │ │ +170 |
│ │ │ +The tracker URL doesn't support transforming it into a scrape
│ │ │ +URL. i.e. it doesn't contain "announce. |
│ │ │ +
│ │ │ +| invalid_tracker_response |
│ │ │ +171 |
│ │ │ +invalid tracker response |
│ │ │ +
│ │ │ +| invalid_peer_dict |
│ │ │ +172 |
│ │ │ +invalid peer dictionary entry. Not a dictionary |
│ │ │ +
│ │ │ +| tracker_failure |
│ │ │ +173 |
│ │ │ +tracker sent a failure message |
│ │ │ +
│ │ │ +| invalid_files_entry |
│ │ │ +174 |
│ │ │ +missing or invalid files entry |
│ │ │ +
│ │ │ +| invalid_hash_entry |
│ │ │ +175 |
│ │ │ +missing or invalid hash entry |
│ │ │ +
│ │ │ +| invalid_peers_entry |
│ │ │ +176 |
│ │ │ +missing or invalid peers and peers6 entry |
│ │ │ +
│ │ │ +| invalid_tracker_response_length |
│ │ │ +177 |
│ │ │ +UDP tracker response packet has invalid size |
│ │ │ +
│ │ │ +| invalid_tracker_transaction_id |
│ │ │ +178 |
│ │ │ +invalid transaction id in UDP tracker response |
│ │ │ +
│ │ │ +| invalid_tracker_action |
│ │ │ +179 |
│ │ │ +invalid action field in UDP tracker response |
│ │ │ +
│ │ │ +| announce_skipped |
│ │ │ +180 |
│ │ │ +skipped announce (because it's assumed to be unreachable over the
│ │ │ +given source network interface) |
│ │ │ +
│ │ │ +| no_entropy |
│ │ │ +200 |
│ │ │ +random number generation failed |
│ │ │ +
│ │ │ +| ssrf_mitigation |
│ │ │ +201 |
│ │ │ +blocked by SSRF mitigation |
│ │ │ +
│ │ │ +| blocked_by_idna |
│ │ │ +202 |
│ │ │ +blocked because IDNA host names are banned |
│ │ │ +
│ │ │ +| torrent_unknown_version |
│ │ │ +210 |
│ │ │ +the torrent file has an unknown meta version |
│ │ │ +
│ │ │ +| torrent_missing_file_tree |
│ │ │ +211 |
│ │ │ +the v2 torrent file has no file tree |
│ │ │ +
│ │ │ +| torrent_missing_meta_version |
│ │ │ +212 |
│ │ │ +the torrent contains v2 keys but does not specify meta version 2 |
│ │ │ +
│ │ │ +| torrent_inconsistent_files |
│ │ │ +213 |
│ │ │ +the v1 and v2 file metadata does not match |
│ │ │ +
│ │ │ +| torrent_missing_piece_layer |
│ │ │ +214 |
│ │ │ +one or more files are missing piece layer hashes |
│ │ │ +
│ │ │ +| torrent_invalid_piece_layer |
│ │ │ +215 |
│ │ │ +a piece layer has the wrong size or failed hash check |
│ │ │ +
│ │ │ +| torrent_missing_pieces_root |
│ │ │ +216 |
│ │ │ +a v2 file entry has no root hash |
│ │ │ +
│ │ │ +| torrent_inconsistent_hashes |
│ │ │ +217 |
│ │ │ +the v1 and v2 hashes do not describe the same data |
│ │ │ +
│ │ │ +| torrent_invalid_pad_file |
│ │ │ +218 |
│ │ │ +a file in the v2 metadata has the pad attribute set |
│ │ │ +
│ │ │ +| error_code_max |
│ │ │ +219 |
│ │ │ +the number of error codes |
│ │ │
│ │ │
│ │ │
│ │ │ -
[report issue]
│ │ │ -
│ │ │ +
│ │ │ +
enum http_errors
│ │ │ +
Declared in "libtorrent/error_code.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| cont |
│ │ │ +100 |
│ │ │ + |
│ │ │ +
│ │ │ +| ok |
│ │ │ +200 |
│ │ │ + |
│ │ │ +
│ │ │ +| created |
│ │ │ +201 |
│ │ │ + |
│ │ │ +
│ │ │ +| accepted |
│ │ │ +202 |
│ │ │ + |
│ │ │ +
│ │ │ +| no_content |
│ │ │ +204 |
│ │ │ + |
│ │ │ +
│ │ │ +| multiple_choices |
│ │ │ +300 |
│ │ │ + |
│ │ │ +
│ │ │ +| moved_permanently |
│ │ │ +301 |
│ │ │ + |
│ │ │ +
│ │ │ +| moved_temporarily |
│ │ │ +302 |
│ │ │ + |
│ │ │ +
│ │ │ +| not_modified |
│ │ │ +304 |
│ │ │ + |
│ │ │ +
│ │ │ +| bad_request |
│ │ │ +400 |
│ │ │ + |
│ │ │ +
│ │ │ +| unauthorized |
│ │ │ +401 |
│ │ │ + |
│ │ │ +
│ │ │ +| forbidden |
│ │ │ +403 |
│ │ │ + |
│ │ │ +
│ │ │ +| not_found |
│ │ │ +404 |
│ │ │ + |
│ │ │ +
│ │ │ +| internal_server_error |
│ │ │ +500 |
│ │ │ + |
│ │ │ +
│ │ │ +| not_implemented |
│ │ │ +501 |
│ │ │ + |
│ │ │ +
│ │ │ +| bad_gateway |
│ │ │ +502 |
│ │ │ + |
│ │ │ +
│ │ │ +| service_unavailable |
│ │ │ +503 |
│ │ │ + |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[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:
│ │ │ +
│ │ │ +- ti - the immutable info-dict part of the torrent
│ │ │ +- info_hash - when you don't have the metadata (.torrent file). This
│ │ │ +uniquely identifies the torrent and can validate the info-dict when
│ │ │ +received from the swarm.
│ │ │ +
│ │ │ +
In order to add a torrent to a session, one of those fields must be set
│ │ │ +in addition to save_path. The add_torrent_params object can then be
│ │ │ +passed into one of the session::add_torrent() overloads or
│ │ │ +session::async_add_torrent().
│ │ │ +
If you only specify the info-hash, the torrent file will be downloaded
│ │ │ +from peers, which requires them to support the metadata extension. For
│ │ │ +the metadata extension to work, libtorrent must be built with extensions
│ │ │ +enabled (TORRENT_DISABLE_EXTENSIONS must not be defined). It also
│ │ │ +takes an optional name argument. This may be left empty in case no
│ │ │ +name should be assigned to the torrent. In case it's not, the name is
│ │ │ +used for the torrent as long as it doesn't have metadata. See
│ │ │ +torrent_handle::name.
│ │ │ +
The add_torrent_params is also used when requesting resume data for a
│ │ │ +torrent. It can be saved to and restored from a file and added back to a
│ │ │ +new session. For serialization and de-serialization of
│ │ │ +add_torrent_params objects, see read_resume_data() and
│ │ │ +write_resume_data().
│ │ │ +
The add_torrent_params is also used to represent a parsed .torrent
│ │ │ +file. It can be loaded via load_torrent_file(), load_torrent_buffer() and
│ │ │ +load_torrent_parsed(). It can be saved via write_torrent_file().
│ │ │ +
│ │ │ +struct add_torrent_params
│ │ │ +{
│ │ │ + int version = LIBTORRENT_VERSION_NUM;
│ │ │ + std::shared_ptr<torrent_info> ti;
│ │ │ + aux::noexcept_movable<std::vector<std::string>> trackers;
│ │ │ + aux::noexcept_movable<std::vector<int>> tracker_tiers;
│ │ │ + aux::noexcept_movable<std::vector<std::pair<std::string, int>>> dht_nodes;
│ │ │ + std::string name;
│ │ │ + std::string save_path;
│ │ │ + storage_mode_t storage_mode = storage_mode_sparse;
│ │ │ + client_data_t userdata;
│ │ │ + aux::noexcept_movable<std::vector<download_priority_t>> file_priorities;
│ │ │ + std::string trackerid;
│ │ │ + torrent_flags_t flags = torrent_flags::default_flags;
│ │ │ + info_hash_t info_hashes;
│ │ │ + int max_uploads = -1;
│ │ │ + int max_connections = -1;
│ │ │ + int upload_limit = -1;
│ │ │ + int download_limit = -1;
│ │ │ + std::int64_t total_uploaded = 0;
│ │ │ + std::int64_t total_downloaded = 0;
│ │ │ + int active_time = 0;
│ │ │ + int finished_time = 0;
│ │ │ + int seeding_time = 0;
│ │ │ + std::time_t added_time = 0;
│ │ │ + std::time_t completed_time = 0;
│ │ │ + std::time_t last_seen_complete = 0;
│ │ │ + int num_complete = -1;
│ │ │ + int num_incomplete = -1;
│ │ │ + int num_downloaded = -1;
│ │ │ + aux::noexcept_movable<std::vector<std::string>> http_seeds;
│ │ │ + aux::noexcept_movable<std::vector<std::string>> url_seeds;
│ │ │ + aux::noexcept_movable<std::vector<tcp::endpoint>> peers;
│ │ │ + aux::noexcept_movable<std::vector<tcp::endpoint>> banned_peers;
│ │ │ + aux::noexcept_movable<std::map<piece_index_t, bitfield>> unfinished_pieces;
│ │ │ + typed_bitfield<piece_index_t> have_pieces;
│ │ │ + typed_bitfield<piece_index_t> verified_pieces;
│ │ │ + aux::noexcept_movable<std::vector<download_priority_t>> piece_priorities;
│ │ │ + aux::vector<std::vector<sha256_hash>, file_index_t> merkle_trees;
│ │ │ + aux::vector<std::vector<bool>, file_index_t> merkle_tree_mask;
│ │ │ + aux::vector<std::vector<bool>, file_index_t> verified_leaf_hashes;
│ │ │ + aux::noexcept_movable<std::map<file_index_t, std::string>> renamed_files;
│ │ │ + std::time_t last_download = 0;
│ │ │ + std::time_t last_upload = 0;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- version
│ │ │ +- filled in by the constructor and should be left untouched. It is used
│ │ │ +for forward binary compatibility.
│ │ │
│ │ │ -
│ │ │ -- num_alert_types
│ │ │ -- this constant represents "max_alert_index" + 1
│ │ │ +[report issue]
│ │ │ +- ti
│ │ │ +- torrent_info object with the torrent to add. Unless the
│ │ │ +info_hash is set, this is required to be initialized.
│ │ │
│ │ │ -[report issue]
│ │ │ -
│ │ │ -
alert_category_t
│ │ │ -
Declared in "libtorrent/alert.hpp"
│ │ │ -
│ │ │ -- error
│ │ │ -Enables alerts that report an error. This includes:
│ │ │ -
│ │ │ -- tracker errors
│ │ │ -- tracker warnings
│ │ │ -- file errors
│ │ │ -- resume data failures
│ │ │ -- web seed errors
│ │ │ -- .torrent files errors
│ │ │ -- listen socket errors
│ │ │ -- port mapping errors
│ │ │ -
│ │ │ +[report issue]
│ │ │ +- trackers
│ │ │ +- If the torrent doesn't have a tracker, but relies on the DHT to find
│ │ │ +peers, the trackers can specify tracker URLs for the torrent.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- tracker_tiers
│ │ │ +- the tiers the URLs in trackers belong to. Trackers belonging to
│ │ │ +different tiers may be treated differently, as defined by the multi
│ │ │ +tracker extension. This is optional, if not specified trackers are
│ │ │ +assumed to be part of tier 0, or whichever the last tier was as
│ │ │ +iterating over the trackers.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- dht_nodes
│ │ │ +- a list of hostname and port pairs, representing DHT nodes to be added
│ │ │ +to the session (if DHT is enabled). The hostname may be an IP address.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- name
│ │ │ +- in case there's no other name in this torrent, this name will be used.
│ │ │ +The name out of the torrent_info object takes precedence if available.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- save_path
│ │ │ +the path where the torrent is or will be stored.
│ │ │ +
│ │ │ +
Note
│ │ │ +
On windows this path (and other paths) are interpreted as UNC
│ │ │ +paths. This means they must use backslashes as directory separators
│ │ │ +and may not contain the special directories "." or "..".
│ │ │ +
│ │ │ +Setting this to an absolute path performs slightly better than a
│ │ │ +relative path.
│ │ │
│ │ │
│ │ │ -
│ │ │ -- peer
│ │ │ -- Enables alerts when peers send invalid requests, get banned or
│ │ │ -snubbed.
│ │ │ +[report issue]
│ │ │ +- storage_mode
│ │ │ +- One of the values from storage_mode_t. For more information, see
│ │ │ +storage allocation.
│ │ │
│ │ │ -
│ │ │ -- port_mapping
│ │ │ -- Enables alerts for port mapping events. For NAT-PMP and UPnP.
│ │ │ +[report issue]
│ │ │ +- userdata
│ │ │ +- The userdata parameter is optional and will be passed on to the
│ │ │ +extension constructor functions, if any
│ │ │ +(see torrent_handle::add_extension()). It will also be stored in the
│ │ │ +torrent object and can be retrieved by calling userdata().
│ │ │
│ │ │ -
│ │ │ -- storage
│ │ │ -- Enables alerts for events related to the storage. File errors and
│ │ │ -synchronization events for moving the storage, renaming files etc.
│ │ │ +[report issue]
│ │ │ +- file_priorities
│ │ │ +- can be set to control the initial file priorities when adding a
│ │ │ +torrent. The semantics are the same as for
│ │ │ +torrent_handle::prioritize_files(). The file priorities specified
│ │ │ +in here take precedence over those specified in the resume data, if
│ │ │ +any.
│ │ │ +If this vector of file priorities is shorter than the number of files
│ │ │ +in the torrent, the remaining files (not covered by this) will still
│ │ │ +have the default download priority. This default can be changed by
│ │ │ +setting the default_dont_download torrent_flag.
│ │ │
│ │ │ -
│ │ │ -- tracker
│ │ │ -- Enables all tracker events. Includes announcing to trackers,
│ │ │ -receiving responses, warnings and errors.
│ │ │ +[report issue]
│ │ │ +- trackerid
│ │ │ +- the default tracker id to be used when announcing to trackers. By
│ │ │ +default this is empty, and no tracker ID is used, since this is an
│ │ │ +optional argument. If a tracker returns a tracker ID, that ID is used
│ │ │ +instead of this.
│ │ │
│ │ │ -
│ │ │ -- connect
│ │ │ -- Low level alerts for when peers are connected and disconnected.
│ │ │ +[report issue]
│ │ │ +- flags
│ │ │ +flags controlling aspects of this torrent and how it's added. See
│ │ │ +torrent_flags_t for details.
│ │ │ +
│ │ │ +
Note
│ │ │ +
The flags field is initialized with default flags by the
│ │ │ +constructor. In order to preserve default behavior when clearing or
│ │ │ +setting other flags, make sure to bitwise OR or in a flag or bitwise
│ │ │ +AND the inverse of a flag to clear it.
│ │ │ +
│ │ │ +
│ │ │
│ │ │ -
│ │ │ -- status
│ │ │ -- Enables alerts for when a torrent or the session changes state.
│ │ │ +[report issue]
│ │ │ +- info_hashes
│ │ │ +- set this to the info hash of the torrent to add in case the info-hash
│ │ │ +is the only known property of the torrent. i.e. you don't have a
│ │ │ +.torrent file nor a magnet link.
│ │ │ +To add a magnet link, use parse_magnet_uri() to populate fields in the
│ │ │ +add_torrent_params object.
│ │ │
│ │ │ -
│ │ │ -- ip_block
│ │ │ -- Alerts when a peer is blocked by the ip blocker or port blocker.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- max_uploads max_connections
│ │ │ +max_uploads, max_connections, upload_limit,
│ │ │ +download_limit correspond to the set_max_uploads(),
│ │ │ +set_max_connections(), set_upload_limit() and
│ │ │ +set_download_limit() functions on torrent_handle. These values let
│ │ │ +you initialize these settings when the torrent is added, instead of
│ │ │ +calling these functions immediately following adding it.
│ │ │ +-1 means unlimited on these settings just like their counterpart
│ │ │ +functions on torrent_handle
│ │ │ +For fine grained control over rate limits, including making them apply
│ │ │ +to local peers, see peer classes.
│ │ │ +
│ │ │
│ │ │ -
│ │ │ -- performance_warning
│ │ │ -- Alerts when some limit is reached that might limit the download
│ │ │ -or upload rate.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- upload_limit download_limit
│ │ │ +- the upload and download rate limits for this torrent, specified in
│ │ │ +bytes per second. -1 means unlimited.
│ │ │
│ │ │ -
│ │ │ -- dht
│ │ │ -- Alerts on events in the DHT node. For incoming searches or
│ │ │ -bootstrapping being done etc.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- total_uploaded total_downloaded
│ │ │ +- the total number of bytes uploaded and downloaded by this torrent so
│ │ │ +far.
│ │ │
│ │ │ -
│ │ │ -- stats
│ │ │ -- If you enable these alerts, you will receive a stats_alert
│ │ │ -approximately once every second, for every active torrent.
│ │ │ -These alerts contain all statistics counters for the interval since
│ │ │ -the lasts stats alert.
│ │ │ +
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- active_time finished_time seeding_time
│ │ │ +- the number of seconds this torrent has spent in started, finished and
│ │ │ +seeding state so far, respectively.
│ │ │
│ │ │ -
│ │ │ -- session_log
│ │ │ -- Enables debug logging alerts. These are available unless libtorrent
│ │ │ -was built with logging disabled (TORRENT_DISABLE_LOGGING). The
│ │ │ -alerts being posted are log_alert and are session wide.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- added_time completed_time
│ │ │ +- if set to a non-zero value, this is the posix time of when this torrent
│ │ │ +was first added, including previous runs/sessions. If set to zero, the
│ │ │ +internal added_time will be set to the time of when add_torrent() is
│ │ │ +called.
│ │ │
│ │ │ -
│ │ │ -- torrent_log
│ │ │ -- Enables debug logging alerts for torrents. These are available
│ │ │ -unless libtorrent was built with logging disabled
│ │ │ -(TORRENT_DISABLE_LOGGING). The alerts being posted are
│ │ │ -torrent_log_alert and are torrent wide debug events.
│ │ │ +[report issue]
│ │ │ +- last_seen_complete
│ │ │ +- if set to non-zero, initializes the time (expressed in posix time) when
│ │ │ +we last saw a seed or peers that together formed a complete copy of the
│ │ │ +torrent. If left set to zero, the internal counterpart to this field
│ │ │ +will be updated when we see a seed or a distributed copies >= 1.0.
│ │ │
│ │ │ -
│ │ │ -- peer_log
│ │ │ -- Enables debug logging alerts for peers. These are available unless
│ │ │ -libtorrent was built with logging disabled
│ │ │ -(TORRENT_DISABLE_LOGGING). The alerts being posted are
│ │ │ -peer_log_alert and low-level peer events and messages.
│ │ │ +
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- num_complete num_incomplete num_downloaded
│ │ │ +these field can be used to initialize the torrent's cached scrape data.
│ │ │ +The scrape data is high level metadata about the current state of the
│ │ │ +swarm, as returned by the tracker (either when announcing to it or by
│ │ │ +sending a specific scrape request). num_complete is the number of
│ │ │ +peers in the swarm that are seeds, or have every piece in the torrent.
│ │ │ +num_incomplete is the number of peers in the swarm that do not have
│ │ │ +every piece. num_downloaded is the number of times the torrent has
│ │ │ +been downloaded (not initiated, but the number of times a download has
│ │ │ +completed).
│ │ │ +Leaving any of these values set to -1 indicates we don't know, or we
│ │ │ +have not received any scrape data.
│ │ │ +
│ │ │
│ │ │ -
│ │ │ -- incoming_request
│ │ │ -- enables the incoming_request_alert.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- http_seeds url_seeds
│ │ │ +URLs can be added to these two lists to specify additional web
│ │ │ +seeds to be used by the torrent. If the flag_override_web_seeds
│ │ │ +is set, these will be the _only_ ones to be used. i.e. any web seeds
│ │ │ +found in the .torrent file will be overridden.
│ │ │ +http_seeds expects URLs to web servers implementing the original HTTP
│ │ │ +seed specification BEP 17.
│ │ │ +url_seeds expects URLs to regular web servers, aka "get right" style,
│ │ │ +specified in BEP 19.
│ │ │ +
│ │ │
│ │ │ -
│ │ │ -- dht_log
│ │ │ -- enables dht_log_alert, debug logging for the DHT
│ │ │ +[report issue]
│ │ │ +- peers
│ │ │ +- peers to add to the torrent, to be tried to be connected to as
│ │ │ +bittorrent peers.
│ │ │
│ │ │ -
│ │ │ -- dht_operation
│ │ │ -- enable events from pure dht operations not related to torrents
│ │ │ +[report issue]
│ │ │ +- banned_peers
│ │ │ +- peers banned from this torrent. The will not be connected to
│ │ │
│ │ │ -
│ │ │ -- port_mapping_log
│ │ │ -- enables port mapping log events. This log is useful
│ │ │ -for debugging the UPnP or NAT-PMP implementation
│ │ │ +[report issue]
│ │ │ +- unfinished_pieces
│ │ │ +- this is a map of partially downloaded piece. The key is the piece index
│ │ │ +and the value is a bitfield where each bit represents a 16 kiB block.
│ │ │ +A set bit means we have that block.
│ │ │
│ │ │ -
│ │ │ -- picker_log
│ │ │ -- enables verbose logging from the piece picker.
│ │ │ +[report issue]
│ │ │ +- have_pieces
│ │ │ +- this is a bitfield indicating which pieces we already have of this
│ │ │ +torrent.
│ │ │
│ │ │ -
│ │ │ -- file_progress
│ │ │ -- alerts when files complete downloading
│ │ │ +[report issue]
│ │ │ +- verified_pieces
│ │ │ +- when in seed_mode, pieces with a set bit in this bitfield have been
│ │ │ +verified to be valid. Other pieces will be verified the first time a
│ │ │ +peer requests it.
│ │ │
│ │ │ -
│ │ │ -- piece_progress
│ │ │ -- alerts when pieces complete downloading or fail hash check
│ │ │ +[report issue]
│ │ │ +- piece_priorities
│ │ │ +- this sets the priorities for each individual piece in the torrent. Each
│ │ │ +element in the vector represent the piece with the same index. If you
│ │ │ +set both file- and piece priorities, file priorities will take
│ │ │ +precedence.
│ │ │
│ │ │ -
│ │ │ -- upload
│ │ │ -- alerts when we upload blocks to other peers
│ │ │ +[report issue]
│ │ │ +- merkle_trees
│ │ │ +- v2 hashes, if known
│ │ │
│ │ │ -
│ │ │ -- block_progress
│ │ │ -- alerts on individual blocks being requested, downloading, finished,
│ │ │ -rejected, time-out and cancelled. This is likely to post alerts at a
│ │ │ -high rate.
│ │ │ +[report issue]
│ │ │ +- merkle_tree_mask
│ │ │ +- if set, indicates which hashes are included in the corresponding
│ │ │ +vector of merkle_trees. These bitmasks always cover the full
│ │ │ +tree, a cleared bit means the hash is all zeros (i.e. not set) and
│ │ │ +set bit means the next hash in the corresponding vector in
│ │ │ +merkle_trees is the hash for that node. This is an optimization
│ │ │ +to avoid storing a lot of zeros.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- verified_leaf_hashes
│ │ │ +- bit-fields indicating which v2 leaf hashes have been verified
│ │ │ +against the root hash. If this vector is empty and merkle_trees is
│ │ │ +non-empty it implies that all hashes in merkle_trees are verified.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- renamed_files
│ │ │ +- this is a map of file indices in the torrent and new filenames to be
│ │ │ +applied before the torrent is added.
│ │ │ +
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- last_download last_upload
│ │ │ +- the posix time of the last time payload was received or sent for this
│ │ │ +torrent, respectively. A value of 0 means we don't know when we last
│ │ │ +uploaded or downloaded, or we have never uploaded or downloaded any
│ │ │ +payload for this torrent.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +
│ │ │ +
client_data_t
│ │ │ +
Declared in "libtorrent/client_data.hpp"
│ │ │ +
A thin wrapper around a void pointer used as "user data". i.e. an opaque
│ │ │ +cookie passed in to libtorrent and returned on demand. It adds type-safety by
│ │ │ +requiring the same type be requested out of it as was assigned to it.
│ │ │ +
│ │ │ +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;
│ │ │ + client_data_t& operator= (void*) = delete;
│ │ │ + client_data_t& operator= (void const*) = delete;
│ │ │ + operator void const* () const = delete;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
client_data_t()
│ │ │ +
│ │ │ +client_data_t () = default;
│ │ │ +
│ │ │ +
construct a nullptr client data
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
client_data_t()
│ │ │ +
│ │ │ +explicit client_data_t (T* v);
│ │ │ +
│ │ │ +
initialize the client data with the specified pointer
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
operator=()
│ │ │ +
│ │ │ +client_data_t& operator= (T* v);
│ │ │ +
│ │ │ +
assigns a new pointer to the client data
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
T() get()
│ │ │ +
│ │ │ +T* get () const;
│ │ │ +explicit operator T () const;
│ │ │ +
│ │ │ +
request to retrieve the pointer back again. The type T must be
│ │ │ +identical to the type of the pointer assigned earlier, including
│ │ │ +const & volatile qualifiers.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
void*() const*() operator=()
│ │ │ +
│ │ │ +operator void* () const = delete;
│ │ │ +client_data_t& operator= (void*) = delete;
│ │ │ +client_data_t& operator= (void const*) = delete;
│ │ │ +operator void const* () const = delete;
│ │ │ +
│ │ │ +
we don't allow type-unsafe operations
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
torrent_status
│ │ │ +
Declared in "libtorrent/torrent_status.hpp"
│ │ │ +
holds a snapshot of the status of a torrent, as queried by
│ │ │ +torrent_handle::status().
│ │ │ +
│ │ │ +struct torrent_status
│ │ │ +{
│ │ │ + bool operator== (torrent_status const& st) const;
│ │ │ +
│ │ │ + enum state_t
│ │ │ + {
│ │ │ + checking_files,
│ │ │ + downloading_metadata,
│ │ │ + downloading,
│ │ │ + finished,
│ │ │ + seeding,
│ │ │ + checking_resume_data,
│ │ │ + };
│ │ │ +
│ │ │ + torrent_handle handle;
│ │ │ + error_code errc;
│ │ │ + file_index_t error_file = torrent_status::error_file_none;
│ │ │ + static constexpr file_index_t error_file_none {-1};
│ │ │ + static constexpr file_index_t error_file_ssl_ctx {-3};
│ │ │ + static constexpr file_index_t error_file_metadata {-4};
│ │ │ + static constexpr file_index_t error_file_exception {-5};
│ │ │ + static constexpr file_index_t error_file_partfile {-6};
│ │ │ + std::string save_path;
│ │ │ + std::string name;
│ │ │ + std::weak_ptr<const torrent_info> torrent_file;
│ │ │ + time_duration next_announce = seconds{0};
│ │ │ + std::string current_tracker;
│ │ │ + std::int64_t total_download = 0;
│ │ │ + std::int64_t total_upload = 0;
│ │ │ + std::int64_t total_payload_download = 0;
│ │ │ + std::int64_t total_payload_upload = 0;
│ │ │ + std::int64_t total_failed_bytes = 0;
│ │ │ + std::int64_t total_redundant_bytes = 0;
│ │ │ + typed_bitfield<piece_index_t> pieces;
│ │ │ + typed_bitfield<piece_index_t> verified_pieces;
│ │ │ + std::int64_t total_done = 0;
│ │ │ + std::int64_t total = 0;
│ │ │ + std::int64_t total_wanted_done = 0;
│ │ │ + std::int64_t total_wanted = 0;
│ │ │ + std::int64_t all_time_upload = 0;
│ │ │ + std::int64_t all_time_download = 0;
│ │ │ + std::time_t added_time = 0;
│ │ │ + std::time_t completed_time = 0;
│ │ │ + std::time_t last_seen_complete = 0;
│ │ │ + storage_mode_t storage_mode = storage_mode_sparse;
│ │ │ + float progress = 0.f;
│ │ │ + int progress_ppm = 0;
│ │ │ + queue_position_t queue_position {};
│ │ │ + int download_rate = 0;
│ │ │ + int upload_rate = 0;
│ │ │ + int download_payload_rate = 0;
│ │ │ + int upload_payload_rate = 0;
│ │ │ + int num_seeds = 0;
│ │ │ + int num_peers = 0;
│ │ │ + int num_complete = -1;
│ │ │ + int num_incomplete = -1;
│ │ │ + int list_seeds = 0;
│ │ │ + int list_peers = 0;
│ │ │ + int connect_candidates = 0;
│ │ │ + int num_pieces = 0;
│ │ │ + int distributed_full_copies = 0;
│ │ │ + int distributed_fraction = 0;
│ │ │ + float distributed_copies = 0.f;
│ │ │ + int block_size = 0;
│ │ │ + int num_uploads = 0;
│ │ │ + int num_connections = 0;
│ │ │ + int uploads_limit = 0;
│ │ │ + int connections_limit = 0;
│ │ │ + int up_bandwidth_queue = 0;
│ │ │ + int down_bandwidth_queue = 0;
│ │ │ + int seed_rank = 0;
│ │ │ + state_t state = checking_resume_data;
│ │ │ + bool need_save_resume = false;
│ │ │ + bool is_seeding = false;
│ │ │ + bool is_finished = false;
│ │ │ + bool has_metadata = false;
│ │ │ + bool has_incoming = false;
│ │ │ + bool moving_storage = false;
│ │ │ + bool announcing_to_trackers = false;
│ │ │ + bool announcing_to_lsd = false;
│ │ │ + bool announcing_to_dht = false;
│ │ │ + info_hash_t info_hashes;
│ │ │ + time_point last_upload;
│ │ │ + time_point last_download;
│ │ │ + seconds active_duration;
│ │ │ + seconds finished_duration;
│ │ │ + seconds seeding_duration;
│ │ │ + torrent_flags_t flags {};
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
operator==()
│ │ │ +
│ │ │ +bool operator== (torrent_status const& st) const;
│ │ │ +
│ │ │ +
compares if the torrent status objects come from the same torrent. i.e.
│ │ │ +only the torrent_handle field is compared.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum state_t
│ │ │ +
Declared in "libtorrent/torrent_status.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| checking_files |
│ │ │ +1 |
│ │ │ +The torrent has not started its download yet, and is
│ │ │ +currently checking existing files. |
│ │ │ +
│ │ │ +| downloading_metadata |
│ │ │ +2 |
│ │ │ +The torrent is trying to download metadata from peers.
│ │ │ +This implies the ut_metadata extension is in use. |
│ │ │ +
│ │ │ +| downloading |
│ │ │ +3 |
│ │ │ +The torrent is being downloaded. This is the state
│ │ │ +most torrents will be in most of the time. The progress
│ │ │ +meter will tell how much of the files that has been
│ │ │ +downloaded. |
│ │ │ +
│ │ │ +| finished |
│ │ │ +4 |
│ │ │ +In this state the torrent has finished downloading but
│ │ │ +still doesn't have the entire torrent. i.e. some pieces
│ │ │ +are filtered and won't get downloaded. |
│ │ │ +
│ │ │ +| seeding |
│ │ │ +5 |
│ │ │ +In this state the torrent has finished downloading and
│ │ │ +is a pure seeder. |
│ │ │ +
│ │ │ +| checking_resume_data |
│ │ │ +7 |
│ │ │ +If the torrent was started in full allocation mode, this
│ │ │ +indicates that the (disk) storage for the torrent is
│ │ │ +allocated.
│ │ │ +The torrent is currently checking the fast resume data and
│ │ │ +comparing it to the files on disk. This is typically
│ │ │ +completed in a fraction of a second, but if you add a
│ │ │ +large number of torrents at once, they will queue up. |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- handle
│ │ │ +- a handle to the torrent whose status the object represents.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- errc
│ │ │ +- may be set to an error code describing why the torrent was paused, in
│ │ │ +case it was paused by an error. If the torrent is not paused or if it's
│ │ │ +paused but not because of an error, this error_code is not set.
│ │ │ +if the error is attributed specifically to a file, error_file is set to
│ │ │ +the index of that file in the .torrent file.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error_file
│ │ │ +- if the torrent is stopped because of an disk I/O error, this field
│ │ │ +contains the index of the file in the torrent that encountered the
│ │ │ +error. If the error did not originate in a file in the torrent, there
│ │ │ +are a few special values this can be set to: error_file_none,
│ │ │ +error_file_ssl_ctx, error_file_exception, error_file_partfile or
│ │ │ +error_file_metadata;
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error_file_none
│ │ │ +- special values for error_file to describe which file or component
│ │ │ +encountered the error (errc).
│ │ │ +the error did not occur on a file
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error_file_ssl_ctx
│ │ │ +- the error occurred setting up the SSL context
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error_file_metadata
│ │ │ +- the error occurred while loading the metadata for the torrent
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error_file_exception
│ │ │ +- there was a serious error reported in this torrent. The error code
│ │ │ +or a torrent log alert may provide more information.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- error_file_partfile
│ │ │ +- the error occurred with the partfile
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- save_path
│ │ │ +- the path to the directory where this torrent's files are stored.
│ │ │ +It's typically the path as was given to async_add_torrent() or
│ │ │ +add_torrent() when this torrent was started. This field is only
│ │ │ +included if the torrent status is queried with
│ │ │ +torrent_handle::query_save_path.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- name
│ │ │ +- the name of the torrent. Typically this is derived from the
│ │ │ +.torrent file. In case the torrent was started without metadata,
│ │ │ +and hasn't completely received it yet, it returns the name given
│ │ │ +to it when added to the session. See session::add_torrent.
│ │ │ +This field is only included if the torrent status is queried
│ │ │ +with torrent_handle::query_name.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- torrent_file
│ │ │ +- set to point to the torrent_info object for this torrent. It's
│ │ │ +only included if the torrent status is queried with
│ │ │ +torrent_handle::query_torrent_file.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- next_announce
│ │ │ +- the time until the torrent will announce itself to the tracker.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- current_tracker
│ │ │ +- the URL of the last working tracker. If no tracker request has
│ │ │ +been successful yet, it's set to an empty string.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- total_download total_upload
│ │ │ +- the number of bytes downloaded and uploaded to all peers, accumulated,
│ │ │ +this session only. The session is considered to restart when a
│ │ │ +torrent is paused and restarted again. When a torrent is paused, these
│ │ │ +counters are reset to 0. If you want complete, persistent, stats, see
│ │ │ +all_time_upload and all_time_download.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- total_payload_download total_payload_upload
│ │ │ +- counts the amount of bytes send and received this session, but only
│ │ │ +the actual payload data (i.e the interesting data), these counters
│ │ │ +ignore any protocol overhead. The session is considered to restart
│ │ │ +when a torrent is paused and restarted again. When a torrent is
│ │ │ +paused, these counters are reset to 0.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- total_failed_bytes
│ │ │ +- the number of bytes that has been downloaded and that has failed the
│ │ │ +piece hash test. In other words, this is just how much crap that has
│ │ │ +been downloaded since the torrent was last started. If a torrent is
│ │ │ +paused and then restarted again, this counter will be reset.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- total_redundant_bytes
│ │ │ +- the number of bytes that has been downloaded even though that data
│ │ │ +already was downloaded. The reason for this is that in some situations
│ │ │ +the same data can be downloaded by mistake. When libtorrent sends
│ │ │ +requests to a peer, and the peer doesn't send a response within a
│ │ │ +certain timeout, libtorrent will re-request that block. Another
│ │ │ +situation when libtorrent may re-request blocks is when the requests
│ │ │ +it sends out are not replied in FIFO-order (it will re-request blocks
│ │ │ +that are skipped by an out of order block). This is supposed to be as
│ │ │ +low as possible. This only counts bytes since the torrent was last
│ │ │ +started. If a torrent is paused and then restarted again, this counter
│ │ │ +will be reset.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- pieces
│ │ │ +- a bitmask that represents which pieces we have (set to true) and the
│ │ │ +pieces we don't have. It's a pointer and may be set to 0 if the
│ │ │ +torrent isn't downloading or seeding.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- verified_pieces
│ │ │ +- a bitmask representing which pieces has had their hash checked. This
│ │ │ +only applies to torrents in seed mode. If the torrent is not in seed
│ │ │ +mode, this bitmask may be empty.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- total_done
│ │ │ +- the total number of bytes of the file(s) that we have. All this does
│ │ │ +not necessarily has to be downloaded during this session (that's
│ │ │ +total_payload_download).
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- total
│ │ │ +- the total number of bytes to download for this torrent. This
│ │ │ +may be less than the size of the torrent in case there are
│ │ │ +pad files. This number only counts bytes that will actually
│ │ │ +be requested from peers.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- total_wanted_done
│ │ │ +- the number of bytes we have downloaded, only counting the pieces that
│ │ │ +we actually want to download. i.e. excluding any pieces that we have
│ │ │ +but have priority 0 (i.e. not wanted).
│ │ │ +Once a torrent becomes seed, any piece- and file priorities are
│ │ │ +forgotten and all bytes are considered "wanted".
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- total_wanted
│ │ │ +- The total number of bytes we want to download. This may be smaller
│ │ │ +than the total torrent size in case any pieces are prioritized to 0,
│ │ │ +i.e. not wanted.
│ │ │ +Once a torrent becomes seed, any piece- and file priorities are
│ │ │ +forgotten and all bytes are considered "wanted".
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- all_time_upload all_time_download
│ │ │ +- are accumulated upload and download payload byte counters. They are
│ │ │ +saved in and restored from resume data to keep totals across sessions.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- added_time
│ │ │ +- the posix-time when this torrent was added. i.e. what time(nullptr)
│ │ │ +returned at the time.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- completed_time
│ │ │ +- the posix-time when this torrent was finished. If the torrent is not
│ │ │ +yet finished, this is 0.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- last_seen_complete
│ │ │ +- the time when we, or one of our peers, last saw a complete copy of
│ │ │ +this torrent.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- storage_mode
│ │ │ +- The allocation mode for the torrent. See storage_mode_t for the
│ │ │ +options. For more information, see storage allocation.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- progress
│ │ │ +- a value in the range [0, 1], that represents the progress of the
│ │ │ +torrent's current task. It may be checking files or downloading.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- progress_ppm
│ │ │ +progress parts per million (progress * 1000000) when disabling
│ │ │ +floating point operations, this is the only option to query progress
│ │ │ +reflects the same value as progress, but instead in a range [0,
│ │ │ +1000000] (ppm = parts per million). When floating point operations are
│ │ │ +disabled, this is the only alternative to the floating point value in
│ │ │ +progress.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- queue_position
│ │ │ +- the position this torrent has in the download
│ │ │ +queue. If the torrent is a seed or finished, this is -1.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- download_rate upload_rate
│ │ │ +- the total rates for all peers for this torrent. These will usually
│ │ │ +have better precision than summing the rates from all peers. The rates
│ │ │ +are given as the number of bytes per second.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- download_payload_rate upload_payload_rate
│ │ │ +- the total transfer rate of payload only, not counting protocol
│ │ │ +chatter. This might be slightly smaller than the other rates, but if
│ │ │ +projected over a long time (e.g. when calculating ETA:s) the
│ │ │ +difference may be noticeable.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_seeds
│ │ │ +- the number of peers that are seeding that this client is
│ │ │ +currently connected to.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_peers
│ │ │ +- the number of peers this torrent currently is connected to. Peer
│ │ │ +connections that are in the half-open state (is attempting to connect)
│ │ │ +or are queued for later connection attempt do not count. Although they
│ │ │ +are visible in the peer list when you call get_peer_info().
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_complete num_incomplete
│ │ │ +- if the tracker sends scrape info in its announce reply, these fields
│ │ │ +will be set to the total number of peers that have the whole file and
│ │ │ +the total number of peers that are still downloading. set to -1 if the
│ │ │ +tracker did not send any scrape data in its announce reply.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- list_seeds list_peers
│ │ │ +- the number of seeds in our peer list and the total number of peers
│ │ │ +(including seeds). We are not necessarily connected to all the peers
│ │ │ +in our peer list. This is the number of peers we know of in total,
│ │ │ +including banned peers and peers that we have failed to connect to.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- connect_candidates
│ │ │ +- the number of peers in this torrent's peer list that is a candidate to
│ │ │ +be connected to. i.e. It has fewer connect attempts than the max fail
│ │ │ +count, it is not a seed if we are a seed, it is not banned etc. If
│ │ │ +this is 0, it means we don't know of any more peers that we can try.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- num_pieces
│ │ │ +- the number of pieces that has been downloaded. It is equivalent to:
│ │ │ +std::accumulate(pieces->begin(), pieces->end()). So you don't have
│ │ │ +to count yourself. This can be used to see if anything has updated
│ │ │ +since last time if you want to keep a graph of the pieces up to date.
│ │ │ +Note that these pieces have not necessarily been written to disk yet,
│ │ │ +and there is a risk the write to disk will fail.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- distributed_full_copies
│ │ │ +- the number of distributed copies of the torrent. Note that one copy
│ │ │ +may be spread out among many peers. It tells how many copies there are
│ │ │ +currently of the rarest piece(s) among the peers this client is
│ │ │ +connected to.
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- distributed_fraction
│ │ │ +tells the share of pieces that have more copies than the rarest
│ │ │ +piece(s). Divide this number by 1000 to get the fraction.
│ │ │ +For example, if distributed_full_copies is 2 and
│ │ │ +distributed_fraction is 500, it means that the rarest pieces have
│ │ │ +only 2 copies among the peers this torrent is connected to, and that
│ │ │ +50% of all the pieces have more than two copies.
│ │ │ +If we are a seed, the piece picker is deallocated as an optimization,
│ │ │ +and piece availability is no longer tracked. In this case the
│ │ │ +distributed copies members are set to -1.
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- distributed_copies
│ │ │ +the number of distributed copies of the file. note that one copy may
│ │ │ +be spread out among many peers. This is a floating point
│ │ │ +representation of the distributed copies.
│ │ │ +
│ │ │ +- the integer part tells how many copies
│ │ │ +- there are of the rarest piece(s)
│ │ │ +- the fractional part tells the fraction of pieces that
│ │ │ +- have more copies than the rarest piece(s).
│ │ │
│ │ │ -
│ │ │ -- all
│ │ │ -The full bitmask, representing all available categories.
│ │ │ -since the enum is signed, make sure this isn't
│ │ │ -interpreted as -1. For instance, boost.python
│ │ │ -does that and fails when assigning it to an
│ │ │ -unsigned parameter.
│ │ │
│ │ │
│ │ │ +[report issue]
│ │ │ +- block_size
│ │ │ +- the size of a block, in bytes. A block is a sub piece, it is the
│ │ │ +number of bytes that each piece request asks for and the number of
│ │ │ +bytes that each bit in the partial_piece_info's bitset represents,
│ │ │ +see get_download_queue(). This is typically 16 kB, but it may be
│ │ │ +smaller, if the pieces are smaller.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- num_uploads
│ │ │ +- the number of unchoked peers in this torrent.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- num_connections
│ │ │ +- the number of peer connections this torrent has, including half-open
│ │ │ +connections that hasn't completed the bittorrent handshake yet. This
│ │ │ +is always >= num_peers.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- uploads_limit
│ │ │ +- the set limit of upload slots (unchoked peers) for this torrent.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- connections_limit
│ │ │ +- the set limit of number of connections for this torrent.
│ │ │ +
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- up_bandwidth_queue down_bandwidth_queue
│ │ │ +- the number of peers in this torrent that are waiting for more
│ │ │ +bandwidth quota from the torrent rate limiter. This can determine if
│ │ │ +the rate you get from this torrent is bound by the torrents limit or
│ │ │ +not. If there is no limit set on this torrent, the peers might still
│ │ │ +be waiting for bandwidth quota from the global limiter, but then they
│ │ │ +are counted in the session_status object.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- seed_rank
│ │ │ +- A rank of how important it is to seed the torrent, it is used to
│ │ │ +determine which torrents to seed and which to queue. It is based on
│ │ │ +the peer to seed ratio from the tracker scrape. For more information,
│ │ │ +see queuing. Higher value means more important to seed
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- state
│ │ │ +- the main state the torrent is in. See torrent_status::state_t.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- need_save_resume
│ │ │ +- true if this torrent has unsaved changes
│ │ │ +to its download state and statistics since the last resume data
│ │ │ +was saved.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- is_seeding
│ │ │ +- true if all pieces have been downloaded.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- is_finished
│ │ │ +- true if all pieces that have a priority > 0 are downloaded. There is
│ │ │ +only a distinction between finished and seeding if some pieces or
│ │ │ +files have been set to priority 0, i.e. are not downloaded.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- has_metadata
│ │ │ +- true if this torrent has metadata (either it was started from a
│ │ │ +.torrent file or the metadata has been downloaded). The only scenario
│ │ │ +where this can be false is when the torrent was started torrent-less
│ │ │ +(i.e. with just an info-hash and tracker ip, a magnet link for
│ │ │ +instance).
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- has_incoming
│ │ │ +- true if there has ever been an incoming connection attempt to this
│ │ │ +torrent.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- moving_storage
│ │ │ +- this is true if this torrent's storage is currently being moved from
│ │ │ +one location to another. This may potentially be a long operation
│ │ │ +if a large file ends up being copied from one drive to another.
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- announcing_to_trackers announcing_to_lsd announcing_to_dht
│ │ │ +- these are set to true if this torrent is allowed to announce to the
│ │ │ +respective peer source. Whether they are true or false is determined by
│ │ │ +the queue logic/auto manager. Torrents that are not auto managed will
│ │ │ +always be allowed to announce to all peer sources.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- info_hashes
│ │ │ +- the info-hash for this torrent
│ │ │ +
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- last_upload last_download
│ │ │ +- the timestamps of the last time this torrent uploaded or downloaded
│ │ │ +payload to any peer.
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- active_duration finished_duration seeding_duration
│ │ │ +- these are cumulative counters of for how long the torrent has been in
│ │ │ +different states. active means not paused and added to session. Whether
│ │ │ +it has found any peers or not is not relevant.
│ │ │ +finished means all selected files/pieces were downloaded and available
│ │ │ +to other peers (this is always a subset of active time).
│ │ │ +seeding means all files/pieces were downloaded and available to
│ │ │ +peers. Being available to peers does not imply there are other peers
│ │ │ +asking for the payload.
│ │ │ +
│ │ │ +[report issue]
│ │ │ +- flags
│ │ │ +- reflects several of the torrent's flags. For more
│ │ │ +information, see torrent_handle::flags().
│ │ │ +
│ │ │ +Bencoding is a common representation in bittorrent used for dictionary,
│ │ │ +list, int and string hierarchies. It's used to encode .torrent files and
│ │ │ +some messages in the network protocol. libtorrent also uses it to store
│ │ │ +settings, resume data and other session state.
│ │ │ +Strings in bencoded structures do not necessarily represent text.
│ │ │ +Strings are raw byte buffers of a certain length. If a string is meant to be
│ │ │ +interpreted as text, it is required to be UTF-8 encoded. See BEP 3.
│ │ │ +The function for decoding bencoded data bdecode(), returning a bdecode_node.
│ │ │ +This function builds a tree that points back into the original buffer. The
│ │ │ +returned bdecode_node will not be valid once the buffer it was parsed out of
│ │ │ +is discarded.
│ │ │ +It's possible to construct an entry from a bdecode_node, if a structure needs
│ │ │ +to be altered and re-encoded.
│ │ │ +[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
entry
│ │ │ +
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 (span<char const>);
│ │ │ + entry (list_type);
│ │ │ + entry (integer_type);
│ │ │ + entry (preformatted_type);
│ │ │ + entry (dictionary_type);
│ │ │ + entry (data_type t);
│ │ │ + entry (bdecode_node const& n);
│ │ │ + entry& operator= (entry const&) &;
│ │ │ + entry& operator= (entry&&) & noexcept;
│ │ │ + entry& operator= (integer_type) &;
│ │ │ + entry& operator= (span<char const>) &;
│ │ │ + entry& operator= (dictionary_type) &;
│ │ │ + entry& operator= (preformatted_type) &;
│ │ │ + entry& operator= (bdecode_node const&) &;
│ │ │ + entry& operator= (list_type) &;
│ │ │ + list_type& list ();
│ │ │ + dictionary_type const& dict () const;
│ │ │ + preformatted_type const& preformatted () const;
│ │ │ + integer_type const& integer () const;
│ │ │ + string_type& string ();
│ │ │ + preformatted_type& preformatted ();
│ │ │ + list_type const& list () const;
│ │ │ + string_type const& string () const;
│ │ │ + integer_type& integer ();
│ │ │ + dictionary_type& dict ();
│ │ │ + 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* find_key (string_view key);
│ │ │ + std::string to_string (bool single_line = false) const;
│ │ │ +
│ │ │ + enum data_type
│ │ │ + {
│ │ │ + int_t,
│ │ │ + string_t,
│ │ │ + list_t,
│ │ │ + dictionary_t,
│ │ │ + undefined_t,
│ │ │ + preformatted_t,
│ │ │ + };
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
type()
│ │ │ +
│ │ │ +data_type type () const;
│ │ │ +
│ │ │ +
returns the concrete type of the entry
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
entry()
│ │ │ +
│ │ │ +entry (span<char const>);
│ │ │ +entry (list_type);
│ │ │ +entry (integer_type);
│ │ │ +entry (preformatted_type);
│ │ │ +entry (dictionary_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= (entry const&) &;
│ │ │ +entry& operator= (entry&&) & noexcept;
│ │ │ +entry& operator= (integer_type) &;
│ │ │ +entry& operator= (span<char const>) &;
│ │ │ +entry& operator= (dictionary_type) &;
│ │ │ +entry& operator= (preformatted_type) &;
│ │ │ +entry& operator= (bdecode_node const&) &;
│ │ │ +entry& operator= (list_type) &;
│ │ │ +
│ │ │ +
copies the structure of the right hand side into this
│ │ │ +entry.
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[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;
│ │ │ +
│ │ │ +
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);
│ │ │ +
│ │ │ +
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()
│ │ │ +
│ │ │ +std::string to_string (bool single_line = false) const;
│ │ │ +
│ │ │ +
returns a pretty-printed string representation
│ │ │ +of the bencoded structure, with JSON-style syntax
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
enum data_type
│ │ │ +
Declared in "libtorrent/entry.hpp"
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| name |
│ │ │ +value |
│ │ │ +description |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +| int_t |
│ │ │ +0 |
│ │ │ + |
│ │ │ +
│ │ │ +| string_t |
│ │ │ +1 |
│ │ │ + |
│ │ │ +
│ │ │ +| list_t |
│ │ │ +2 |
│ │ │ + |
│ │ │ +
│ │ │ +| dictionary_t |
│ │ │ +3 |
│ │ │ + |
│ │ │ +
│ │ │ +| undefined_t |
│ │ │ +4 |
│ │ │ + |
│ │ │ +
│ │ │ +| preformatted_t |
│ │ │ +5 |
│ │ │ + |
│ │ │ +
│ │ │ +
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
│ │ │ +
bencode()
│ │ │ +
Declared in "libtorrent/bencode.hpp"
│ │ │ +
│ │ │ +template<class OutIt> int bencode (OutIt out, const entry& e);
│ │ │ +
│ │ │ +
This function will encode data to bencoded form.
│ │ │ +
The entry class is the internal representation of the bencoded data
│ │ │ +and it can be used to retrieve information, an entry can also be build by
│ │ │ +the program and given to bencode() to encode it into the OutIt
│ │ │ +iterator.
│ │ │ +
OutIt is an OutputIterator. It's a template and usually
│ │ │ +instantiated as ostream_iterator or back_insert_iterator. This
│ │ │ +function assumes the value_type of the iterator is a char.
│ │ │ +In order to encode entry e into a buffer, do:
│ │ │ +
│ │ │ +std::vector<char> buf;
│ │ │ +bencode(std::back_inserter(buf), e);
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
operator<<()
│ │ │ +
Declared in "libtorrent/entry.hpp"
│ │ │ +
│ │ │ +inline std::ostream& operator<< (std::ostream& os, const entry& e);
│ │ │ +
│ │ │ +
prints the bencoded structure to the ostream as a JSON-style structure.
│ │ │ +
[report issue]
│ │ │ +
│ │ │ +
dht_state
│ │ │ +
Declared in "libtorrent/kademlia/dht_state.hpp"
│ │ │ +
This structure helps to store and load the state
│ │ │ +of the dht_tracker.
│ │ │ +At this moment the library is only a dual stack
│ │ │ +implementation of the DHT. See BEP 32
│ │ │ +
│ │ │ +struct dht_state
│ │ │ +{
│ │ │ + void clear ();
│ │ │ +
│ │ │ + node_ids_t nids;
│ │ │ + std::vector<udp::endpoint> nodes;
│ │ │ + std::vector<udp::endpoint> nodes6;
│ │ │ +};
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- nodes
│ │ │ +- the bootstrap nodes saved from the buckets node
│ │ │ +
│ │ │ +
[report issue]
│ │ │ +- nodes6
│ │ │ +- the bootstrap nodes saved from the IPv6 buckets node
│ │ │ +
│ │ │
[report issue]
│ │ │
│ │ │
│ │ │
counters()
│ │ │
│ │ │ virtual dht_storage_counters counters () const = 0;
│ │ │
│ │ │
return stats counters for the store
│ │ │ -
[report issue]
│ │ │ +
[report issue]
│ │ │
│ │ │ -
│ │ │ -
dht_state
│ │ │ -
Declared in "libtorrent/kademlia/dht_state.hpp"
│ │ │ -
This structure helps to store and load the state
│ │ │ -of the dht_tracker.
│ │ │ -At this moment the library is only a dual stack
│ │ │ -implementation of the DHT. See BEP 32
│ │ │ +
│ │ │ +
dht_default_storage_constructor()
│ │ │ +
Declared in "libtorrent/kademlia/dht_storage.hpp"
│ │ │
│ │ │ -struct dht_state
│ │ │ -{
│ │ │ - void clear ();
│ │ │ -
│ │ │ - node_ids_t nids;
│ │ │ - std::vector<udp::endpoint> nodes;
│ │ │ - std::vector<udp::endpoint> nodes6;
│ │ │ -};
│ │ │ +std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (
│ │ │ + settings_interface const& settings);
│ │ │
│ │ │ -
[report issue]
│ │ │ -- nodes
│ │ │ -- the bootstrap nodes saved from the buckets node
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -- nodes6
│ │ │ -- the bootstrap nodes saved from the IPv6 buckets node
│ │ │ -
│ │ │ +
constructor for the default DHT storage. The DHT storage is responsible
│ │ │ +for maintaining peers and mutable and immutable items announced and
│ │ │ +stored/put to the DHT node.
│ │ │
[report issue]
│ │ │
│ │ │
sign_mutable_item()
│ │ │
Declared in "libtorrent/kademlia/item.hpp"
│ │ │
│ │ │ signature sign_mutable_item (
│ │ │ span<char const> v
│ │ │ @@ -20859,25 +20870,14 @@
│ │ │
│ │ │
given a byte range v and an optional byte range salt, a
│ │ │ sequence number, public key pk (must be 32 bytes) and a secret key
│ │ │ sk (must be 64 bytes), this function produces a signature which
│ │ │ is written into a 64 byte buffer pointed to by sig. The caller
│ │ │ is responsible for allocating the destination buffer that's passed in
│ │ │ as the sig argument. Typically it would be allocated on the stack.
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
dht_default_storage_constructor()
│ │ │ -
Declared in "libtorrent/kademlia/dht_storage.hpp"
│ │ │ -
│ │ │ -std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (
│ │ │ - settings_interface const& settings);
│ │ │ -
│ │ │ -
constructor for the default DHT storage. The DHT storage is responsible
│ │ │ -for maintaining peers and mutable and immutable items announced and
│ │ │ -stored/put to the DHT node.
│ │ │
[report issue]
│ │ │
│ │ │
announce_flags_t
│ │ │
Declared in "libtorrent/kademlia/announce_flags.hpp"
│ │ │
│ │ │ - seed
│ │ │ - announce to DHT as a seed
│ │ │ @@ -20888,55 +20888,23 @@
│ │ │ your source UDP port as your listen port, rather than the one 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]
│ │ │ -
│ │ │ -
write_resume_data() write_resume_data_buf()
│ │ │ -
Declared in "libtorrent/write_resume_data.hpp"
│ │ │ -
│ │ │ -entry write_resume_data (add_torrent_params const& atp);
│ │ │ -std::vector<char> write_resume_data_buf (add_torrent_params const& atp);
│ │ │ -
│ │ │ -
this function turns the resume data in an add_torrent_params object
│ │ │ -into a bencoded structure
│ │ │ -
│ │ │ -
[report issue]
│ │ │ -
│ │ │ -
write_torrent_file_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);
│ │ │ -entry write_torrent_file (add_torrent_params const& atp);
│ │ │ -std::vector<char> write_torrent_file_buf (add_torrent_params const& atp
│ │ │ - , write_torrent_flags_t flags);
│ │ │ -
│ │ │ -
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 add custom fields.
│ │ │
[report issue]
│ │ │
│ │ │
read_resume_data()
│ │ │
Declared in "libtorrent/read_resume_data.hpp"
│ │ │
│ │ │ -add_torrent_params read_resume_data (span<char const> buffer
│ │ │ - , error_code& ec, load_torrent_limits const& cfg = {});
│ │ │ add_torrent_params read_resume_data (bdecode_node const& rd
│ │ │ , error_code& ec, int piece_limit = 0x200000);
│ │ │ +add_torrent_params read_resume_data (span<char const> buffer
│ │ │ + , error_code& ec, load_torrent_limits const& cfg = {});
│ │ │ add_torrent_params read_resume_data (bdecode_node const& rd
│ │ │ , int piece_limit = 0x200000);
│ │ │ add_torrent_params read_resume_data (span<char const> buffer
│ │ │ , load_torrent_limits const& cfg = {});
│ │ │
│ │ │
these functions are used to parse resume data and populate the appropriate
│ │ │ fields in an add_torrent_params object. This object can then be used to add
│ │ │ @@ -20967,14 +20935,46 @@
│ │ │
Client applications are responsible for protecting resume files from
│ │ │ tampering. At minimum, store them with filesystem permissions that
│ │ │ prevent other users on the system from modifying them, and do not load
│ │ │ resume data received from untrusted sources (e.g. downloaded, synced
│ │ │ from a shared location, or supplied by a peer) without independently
│ │ │ validating or overriding the security-sensitive fields after parsing.
│ │ │
│ │ │ +
│ │ │ +
[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() write_torrent_file_buf()
│ │ │ +
Declared in "libtorrent/write_resume_data.hpp"
│ │ │ +
│ │ │ +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
│ │ │ +
│ │ │ +
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 add custom fields.
│ │ │
[report issue]
│ │ │
│ │ │
write_torrent_flags_t
│ │ │
Declared in "libtorrent/write_resume_data.hpp"
│ │ │
│ │ │ - allow_missing_piece_layer
│ │ │ - this makes write_torrent_file() not fail when attempting to write a
│ │ │ ├── html2text {}
│ │ │ │ @@ -1,158 +1,50 @@
│ │ │ │ >
│ │ │ │ _[_l_i_b_t_o_r_r_e_n_t_ _l_o_g_o_]
│ │ │ │ VVeerrssiioonn:: 2.0.14
│ │ │ │ _h_o_m_e
│ │ │ │ Table of contents
│ │ │ │ - * _t_o_r_r_e_n_t___s_t_a_t_u_s
│ │ │ │ - o _o_p_e_r_a_t_o_r_=_=_(_)
│ │ │ │ - o _e_n_u_m_ _s_t_a_t_e___t
│ │ │ │ - * _w_e_b___s_e_e_d___e_n_t_r_y
│ │ │ │ - o _o_p_e_r_a_t_o_r_=_=_(_)
│ │ │ │ - o _o_p_e_r_a_t_o_r_<_(_)
│ │ │ │ - o _e_n_u_m_ _t_y_p_e___t
│ │ │ │ - * _l_o_a_d___t_o_r_r_e_n_t___l_i_m_i_t_s
│ │ │ │ - * _t_o_r_r_e_n_t___i_n_f_o
│ │ │ │ - o _t_o_r_r_e_n_t___i_n_f_o_(_)
│ │ │ │ - o _~_t_o_r_r_e_n_t___i_n_f_o_(_)
│ │ │ │ - o _f_i_l_e_s_(_)_ _o_r_i_g___f_i_l_e_s_(_)
│ │ │ │ - o _r_e_n_a_m_e___f_i_l_e_(_)
│ │ │ │ - o _r_e_m_a_p___f_i_l_e_s_(_)
│ │ │ │ - o _a_d_d___t_r_a_c_k_e_r_(_)_ _t_r_a_c_k_e_r_s_(_)_ _c_l_e_a_r___t_r_a_c_k_e_r_s_(_)
│ │ │ │ - o _s_i_m_i_l_a_r___t_o_r_r_e_n_t_s_(_)_ _c_o_l_l_e_c_t_i_o_n_s_(_)
│ │ │ │ - o _s_e_t___w_e_b___s_e_e_d_s_(_)_ _a_d_d___h_t_t_p___s_e_e_d_(_)_ _w_e_b___s_e_e_d_s_(_)_ _a_d_d___u_r_l___s_e_e_d_(_)
│ │ │ │ - o _t_o_t_a_l___s_i_z_e_(_)
│ │ │ │ - o _n_u_m___p_i_e_c_e_s_(_)_ _p_i_e_c_e___l_e_n_g_t_h_(_)
│ │ │ │ - o _b_l_o_c_k_s___p_e_r___p_i_e_c_e_(_)
│ │ │ │ - o _p_i_e_c_e___r_a_n_g_e_(_)_ _l_a_s_t___p_i_e_c_e_(_)_ _e_n_d___p_i_e_c_e_(_)
│ │ │ │ - o _i_n_f_o___h_a_s_h_e_s_(_)_ _i_n_f_o___h_a_s_h_(_)
│ │ │ │ - o _v_2_(_)_ _v_1_(_)
│ │ │ │ - o _n_u_m___f_i_l_e_s_(_)
│ │ │ │ - o _m_a_p___b_l_o_c_k_(_)
│ │ │ │ - o _m_a_p___f_i_l_e_(_)
│ │ │ │ - o _s_s_l___c_e_r_t_(_)
│ │ │ │ - o _i_s___v_a_l_i_d_(_)
│ │ │ │ - o _p_r_i_v_(_)
│ │ │ │ - o _i_s___i_2_p_(_)
│ │ │ │ - o _p_i_e_c_e___s_i_z_e_(_)
│ │ │ │ - o _p_i_e_c_e___s_i_z_e___f_o_r___r_e_q_(_)
│ │ │ │ - o _h_a_s_h___f_o_r___p_i_e_c_e_(_)_ _h_a_s_h___f_o_r___p_i_e_c_e___p_t_r_(_)
│ │ │ │ - o _n_a_m_e_(_)
│ │ │ │ - o _c_r_e_a_t_i_o_n___d_a_t_e_(_)
│ │ │ │ - o _c_r_e_a_t_o_r_(_)
│ │ │ │ - o _c_o_m_m_e_n_t_(_)
│ │ │ │ - o _n_o_d_e_s_(_)
│ │ │ │ - o _a_d_d___n_o_d_e_(_)
│ │ │ │ - o _p_a_r_s_e___i_n_f_o___s_e_c_t_i_o_n_(_)
│ │ │ │ - o _i_n_f_o_(_)
│ │ │ │ - o _i_n_f_o___s_e_c_t_i_o_n_(_)
│ │ │ │ - o _p_i_e_c_e___l_a_y_e_r_(_)
│ │ │ │ - o _f_r_e_e___p_i_e_c_e___l_a_y_e_r_s_(_)
│ │ │ │ - * _b_l_o_c_k___i_n_f_o
│ │ │ │ - o _p_e_e_r_(_)_ _s_e_t___p_e_e_r_(_)
│ │ │ │ - o _e_n_u_m_ _b_l_o_c_k___s_t_a_t_e___t
│ │ │ │ - * _p_a_r_t_i_a_l___p_i_e_c_e___i_n_f_o
│ │ │ │ - * _t_o_r_r_e_n_t___h_a_n_d_l_e
│ │ │ │ - o _t_o_r_r_e_n_t___h_a_n_d_l_e_(_)
│ │ │ │ - o _a_d_d___p_i_e_c_e_(_)
│ │ │ │ - o _r_e_a_d___p_i_e_c_e_(_)
│ │ │ │ - o _h_a_v_e___p_i_e_c_e_(_)
│ │ │ │ - o _p_o_s_t___p_e_e_r___i_n_f_o_(_)_ _g_e_t___p_e_e_r___i_n_f_o_(_)
│ │ │ │ - o _s_t_a_t_u_s_(_)_ _p_o_s_t___s_t_a_t_u_s_(_)
│ │ │ │ - o _p_o_s_t___d_o_w_n_l_o_a_d___q_u_e_u_e_(_)_ _g_e_t___d_o_w_n_l_o_a_d___q_u_e_u_e_(_)
│ │ │ │ - o _r_e_s_e_t___p_i_e_c_e___d_e_a_d_l_i_n_e_(_)_ _c_l_e_a_r___p_i_e_c_e___d_e_a_d_l_i_n_e_s_(_)_ _s_e_t___p_i_e_c_e___d_e_a_d_l_i_n_e_(_)
│ │ │ │ - o _p_o_s_t___f_i_l_e___p_r_o_g_r_e_s_s_(_)_ _f_i_l_e___p_r_o_g_r_e_s_s_(_)
│ │ │ │ - o _f_i_l_e___s_t_a_t_u_s_(_)
│ │ │ │ - o _c_l_e_a_r___e_r_r_o_r_(_)
│ │ │ │ - o _a_d_d___t_r_a_c_k_e_r_(_)_ _t_r_a_c_k_e_r_s_(_)_ _p_o_s_t___t_r_a_c_k_e_r_s_(_)_ _r_e_p_l_a_c_e___t_r_a_c_k_e_r_s_(_)
│ │ │ │ - o _r_e_m_o_v_e___u_r_l___s_e_e_d_(_)_ _u_r_l___s_e_e_d_s_(_)_ _a_d_d___u_r_l___s_e_e_d_(_)
│ │ │ │ - o _a_d_d___h_t_t_p___s_e_e_d_(_)_ _r_e_m_o_v_e___h_t_t_p___s_e_e_d_(_)_ _h_t_t_p___s_e_e_d_s_(_)
│ │ │ │ - o _a_d_d___e_x_t_e_n_s_i_o_n_(_)
│ │ │ │ - o _s_e_t___m_e_t_a_d_a_t_a_(_)
│ │ │ │ - o _i_s___v_a_l_i_d_(_)
│ │ │ │ - o _p_a_u_s_e_(_)_ _r_e_s_u_m_e_(_)
│ │ │ │ - o _u_n_s_e_t___f_l_a_g_s_(_)_ _f_l_a_g_s_(_)_ _s_e_t___f_l_a_g_s_(_)
│ │ │ │ - o _f_l_u_s_h___c_a_c_h_e_(_)
│ │ │ │ - o _f_o_r_c_e___r_e_c_h_e_c_k_(_)
│ │ │ │ - o _s_a_v_e___r_e_s_u_m_e___d_a_t_a_(_)_ _g_e_t___r_e_s_u_m_e___d_a_t_a_(_)
│ │ │ │ - o _n_e_e_d___s_a_v_e___r_e_s_u_m_e___d_a_t_a_(_)
│ │ │ │ - o _q_u_e_u_e___p_o_s_i_t_i_o_n___u_p_(_)_ _q_u_e_u_e___p_o_s_i_t_i_o_n___d_o_w_n_(_)_ _q_u_e_u_e___p_o_s_i_t_i_o_n_(_)
│ │ │ │ - _q_u_e_u_e___p_o_s_i_t_i_o_n___t_o_p_(_)_ _q_u_e_u_e___p_o_s_i_t_i_o_n___b_o_t_t_o_m_(_)
│ │ │ │ - o _q_u_e_u_e___p_o_s_i_t_i_o_n___s_e_t_(_)
│ │ │ │ - o _s_e_t___s_s_l___c_e_r_t_i_f_i_c_a_t_e_(_)_ _s_e_t___s_s_l___c_e_r_t_i_f_i_c_a_t_e___b_u_f_f_e_r_(_)
│ │ │ │ - o _t_o_r_r_e_n_t___f_i_l_e_(_)_ _t_o_r_r_e_n_t___f_i_l_e___w_i_t_h___h_a_s_h_e_s_(_)
│ │ │ │ - o _p_i_e_c_e___l_a_y_e_r_s_(_)
│ │ │ │ - o _p_i_e_c_e___a_v_a_i_l_a_b_i_l_i_t_y_(_)_ _p_o_s_t___p_i_e_c_e___a_v_a_i_l_a_b_i_l_i_t_y_(_)
│ │ │ │ - o _p_i_e_c_e___p_r_i_o_r_i_t_y_(_)_ _g_e_t___p_i_e_c_e___p_r_i_o_r_i_t_i_e_s_(_)_ _p_r_i_o_r_i_t_i_z_e___p_i_e_c_e_s_(_)
│ │ │ │ - o _g_e_t___f_i_l_e___p_r_i_o_r_i_t_i_e_s_(_)_ _p_r_i_o_r_i_t_i_z_e___f_i_l_e_s_(_)_ _f_i_l_e___p_r_i_o_r_i_t_y_(_)
│ │ │ │ - o _f_o_r_c_e___r_e_a_n_n_o_u_n_c_e_(_)_ _f_o_r_c_e___l_s_d___a_n_n_o_u_n_c_e_(_)_ _f_o_r_c_e___d_h_t___a_n_n_o_u_n_c_e_(_)
│ │ │ │ - o _s_c_r_a_p_e___t_r_a_c_k_e_r_(_)
│ │ │ │ - o _u_p_l_o_a_d___l_i_m_i_t_(_)_ _d_o_w_n_l_o_a_d___l_i_m_i_t_(_)_ _s_e_t___u_p_l_o_a_d___l_i_m_i_t_(_)
│ │ │ │ - _s_e_t___d_o_w_n_l_o_a_d___l_i_m_i_t_(_)
│ │ │ │ - o _c_o_n_n_e_c_t___p_e_e_r_(_)
│ │ │ │ - o _c_l_e_a_r___p_e_e_r_s_(_)
│ │ │ │ - o _m_a_x___u_p_l_o_a_d_s_(_)_ _s_e_t___m_a_x___u_p_l_o_a_d_s_(_)
│ │ │ │ - o _m_a_x___c_o_n_n_e_c_t_i_o_n_s_(_)_ _s_e_t___m_a_x___c_o_n_n_e_c_t_i_o_n_s_(_)
│ │ │ │ - o _m_o_v_e___s_t_o_r_a_g_e_(_)
│ │ │ │ - o _r_e_n_a_m_e___f_i_l_e_(_)
│ │ │ │ - o _i_n_f_o___h_a_s_h_e_s_(_)_ _i_n_f_o___h_a_s_h_(_)
│ │ │ │ - o _o_p_e_r_a_t_o_r_<_(_)_ _o_p_e_r_a_t_o_r_=_=_(_)_ _o_p_e_r_a_t_o_r_!_=_(_)
│ │ │ │ - o _i_d_(_)
│ │ │ │ - o _n_a_t_i_v_e___h_a_n_d_l_e_(_)
│ │ │ │ - o _u_s_e_r_d_a_t_a_(_)
│ │ │ │ - o _i_n___s_e_s_s_i_o_n_(_)
│ │ │ │ - * _h_a_s_h___v_a_l_u_e_(_)
│ │ │ │ - * _s_t_o_r_a_g_e___p_a_r_a_m_s
│ │ │ │ - * _f_i_l_e___s_l_i_c_e
│ │ │ │ - * _f_i_l_e___s_t_o_r_a_g_e
│ │ │ │ - o _i_s___v_a_l_i_d_(_)
│ │ │ │ - o _r_e_s_e_r_v_e_(_)
│ │ │ │ - o _a_d_d___f_i_l_e___b_o_r_r_o_w_(_)_ _a_d_d___f_i_l_e_(_)
│ │ │ │ - o _r_e_n_a_m_e___f_i_l_e_(_)
│ │ │ │ - o _m_a_p___b_l_o_c_k_(_)
│ │ │ │ - o _m_a_p___f_i_l_e_(_)
│ │ │ │ - o _n_u_m___f_i_l_e_s_(_)
│ │ │ │ - o _e_n_d___f_i_l_e_(_)
│ │ │ │ - o _f_i_l_e___r_a_n_g_e_(_)
│ │ │ │ - o _t_o_t_a_l___s_i_z_e_(_)
│ │ │ │ - o _n_u_m___p_i_e_c_e_s_(_)_ _s_e_t___n_u_m___p_i_e_c_e_s_(_)
│ │ │ │ - o _e_n_d___p_i_e_c_e_(_)
│ │ │ │ - o _l_a_s_t___p_i_e_c_e_(_)
│ │ │ │ - o _p_i_e_c_e___r_a_n_g_e_(_)
│ │ │ │ - o _s_e_t___p_i_e_c_e___l_e_n_g_t_h_(_)_ _p_i_e_c_e___l_e_n_g_t_h_(_)
│ │ │ │ - o _p_i_e_c_e___s_i_z_e_(_)
│ │ │ │ - o _p_i_e_c_e___s_i_z_e_2_(_)
│ │ │ │ - o _b_l_o_c_k_s___i_n___p_i_e_c_e_2_(_)
│ │ │ │ - o _b_l_o_c_k_s___p_e_r___p_i_e_c_e_(_)
│ │ │ │ - o _s_e_t___n_a_m_e_(_)_ _n_a_m_e_(_)
│ │ │ │ + * _h_a_s_h_e_r
│ │ │ │ + o _h_a_s_h_e_r_(_)_ _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ + o _u_p_d_a_t_e_(_)
│ │ │ │ + o _f_i_n_a_l_(_)
│ │ │ │ + o _r_e_s_e_t_(_)
│ │ │ │ + * _h_a_s_h_e_r_2_5_6
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_(_)_ _h_a_s_h_e_r_2_5_6_(_)
│ │ │ │ + o _u_p_d_a_t_e_(_)
│ │ │ │ + o _f_i_n_a_l_(_)
│ │ │ │ + o _r_e_s_e_t_(_)
│ │ │ │ + * _b_i_t_f_i_e_l_d
│ │ │ │ + o _b_i_t_f_i_e_l_d_(_)
│ │ │ │ + o _a_s_s_i_g_n_(_)
│ │ │ │ + o _g_e_t___b_i_t_(_)_ _o_p_e_r_a_t_o_r_[_]_(_)
│ │ │ │ + o _s_e_t___b_i_t_(_)_ _c_l_e_a_r___b_i_t_(_)
│ │ │ │ + o _a_l_l___s_e_t_(_)
│ │ │ │ + o _n_o_n_e___s_e_t_(_)
│ │ │ │ + o _s_i_z_e_(_)
│ │ │ │ + o _n_u_m___w_o_r_d_s_(_)
│ │ │ │ + o _n_u_m___b_y_t_e_s_(_)
│ │ │ │ + o _e_m_p_t_y_(_)
│ │ │ │ + o _d_a_t_a_(_)
│ │ │ │ o _s_w_a_p_(_)
│ │ │ │ - o _c_a_n_o_n_i_c_a_l_i_z_e_(_)
│ │ │ │ - o _p_a_d___f_i_l_e___a_t_(_)_ _s_y_m_l_i_n_k_(_)_ _r_o_o_t___p_t_r_(_)_ _m_t_i_m_e_(_)_ _f_i_l_e___s_i_z_e_(_)_ _f_i_l_e___o_f_f_s_e_t
│ │ │ │ - _(_)_ _r_o_o_t_(_)_ _f_i_l_e___n_a_m_e_(_)_ _f_i_l_e___p_a_t_h_(_)_ _h_a_s_h_(_)
│ │ │ │ - o _f_i_l_e___n_u_m___b_l_o_c_k_s_(_)_ _f_i_l_e___n_u_m___p_i_e_c_e_s_(_)_ _f_i_l_e___p_i_e_c_e___r_a_n_g_e_(_)
│ │ │ │ - o _f_i_l_e___f_i_r_s_t___b_l_o_c_k___n_o_d_e_(_)_ _f_i_l_e___f_i_r_s_t___p_i_e_c_e___n_o_d_e_(_)
│ │ │ │ - o _f_i_l_e___p_a_t_h___h_a_s_h_(_)
│ │ │ │ - o _a_l_l___p_a_t_h___h_a_s_h_e_s_(_)
│ │ │ │ - o _f_i_l_e___f_l_a_g_s_(_)
│ │ │ │ - o _f_i_l_e___a_b_s_o_l_u_t_e___p_a_t_h_(_)
│ │ │ │ - o _f_i_l_e___i_n_d_e_x___a_t___o_f_f_s_e_t_(_)_ _f_i_l_e___i_n_d_e_x___a_t___p_i_e_c_e_(_)
│ │ │ │ - o _f_i_l_e___i_n_d_e_x___f_o_r___r_o_o_t_(_)
│ │ │ │ - o _p_i_e_c_e___i_n_d_e_x___a_t___f_i_l_e_(_)
│ │ │ │ - o _s_a_n_i_t_i_z_e___s_y_m_l_i_n_k_s_(_)
│ │ │ │ - o _v_2_(_)
│ │ │ │ - * _d_e_f_a_u_l_t___d_i_s_k___i_o___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ - * _p_o_s_i_x___d_i_s_k___i_o___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ - * _m_m_a_p___d_i_s_k___i_o___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ - * _d_i_s_a_b_l_e_d___d_i_s_k___i_o___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ - * _e_n_u_m_ _s_t_o_r_a_g_e___m_o_d_e___t
│ │ │ │ - * _e_n_u_m_ _s_t_a_t_u_s___t
│ │ │ │ - * _e_n_u_m_ _m_o_v_e___f_l_a_g_s___t
│ │ │ │ + o _c_o_u_n_t_(_)
│ │ │ │ + o _f_i_n_d___f_i_r_s_t___s_e_t_(_)
│ │ │ │ + o _f_i_n_d___l_a_s_t___c_l_e_a_r_(_)
│ │ │ │ + * _s_t_a_t_s___m_e_t_r_i_c
│ │ │ │ + * _c_o_u_n_t_e_r_s
│ │ │ │ + o _o_p_e_r_a_t_o_r_[_]_(_)_ _i_n_c___s_t_a_t_s___c_o_u_n_t_e_r_(_)
│ │ │ │ + * _s_e_s_s_i_o_n___s_t_a_t_s___m_e_t_r_i_c_s_(_)
│ │ │ │ + * _f_i_n_d___m_e_t_r_i_c___i_d_x_(_)
│ │ │ │ + * _e_n_u_m_ _m_e_t_r_i_c___t_y_p_e___t
│ │ │ │ + * _a_n_n_o_u_n_c_e___i_n_f_o_h_a_s_h
│ │ │ │ + * _a_n_n_o_u_n_c_e___e_n_d_p_o_i_n_t
│ │ │ │ + * _a_n_n_o_u_n_c_e___e_n_t_r_y
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_(_)_ _~_a_n_n_o_u_n_c_e___e_n_t_r_y_(_)_ _a_n_n_o_u_n_c_e___e_n_t_r_y_(_)
│ │ │ │ + o _e_n_u_m_ _t_r_a_c_k_e_r___s_o_u_r_c_e
│ │ │ │ * _s_e_t_t_i_n_g_s___i_n_t_e_r_f_a_c_e
│ │ │ │ - * _d_i_s_k___o_b_s_e_r_v_e_r
│ │ │ │ - o _o_n___d_i_s_k_(_)
│ │ │ │ * _o_p_e_n___f_i_l_e___s_t_a_t_e
│ │ │ │ * _d_i_s_k___i_n_t_e_r_f_a_c_e
│ │ │ │ o _n_e_w___t_o_r_r_e_n_t_(_)
│ │ │ │ o _r_e_m_o_v_e___t_o_r_r_e_n_t_(_)
│ │ │ │ o _a_s_y_n_c___r_e_a_d_(_)_ _a_s_y_n_c___w_r_i_t_e_(_)
│ │ │ │ o _a_s_y_n_c___h_a_s_h_(_)
│ │ │ │ o _a_s_y_n_c___h_a_s_h_2_(_)
│ │ │ │ @@ -166,14 +58,16 @@
│ │ │ │ o _a_s_y_n_c___c_l_e_a_r___p_i_e_c_e_(_)
│ │ │ │ o _u_p_d_a_t_e___s_t_a_t_s___c_o_u_n_t_e_r_s_(_)
│ │ │ │ o _g_e_t___s_t_a_t_u_s_(_)
│ │ │ │ o _a_b_o_r_t_(_)
│ │ │ │ o _s_u_b_m_i_t___j_o_b_s_(_)
│ │ │ │ o _s_e_t_t_i_n_g_s___u_p_d_a_t_e_d_(_)
│ │ │ │ * _s_t_o_r_a_g_e___h_o_l_d_e_r
│ │ │ │ + * _d_i_s_k___o_b_s_e_r_v_e_r
│ │ │ │ + o _o_n___d_i_s_k_(_)
│ │ │ │ * _b_u_f_f_e_r___a_l_l_o_c_a_t_o_r___i_n_t_e_r_f_a_c_e
│ │ │ │ * _d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r
│ │ │ │ o _d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r_(_)
│ │ │ │ o _d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r_(_)
│ │ │ │ o _~_d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r_(_)
│ │ │ │ o _d_a_t_a_(_)
│ │ │ │ o _r_e_s_e_t_(_)
│ │ │ │ @@ -182,303 +76,74 @@
│ │ │ │ o _b_o_o_l_(_)
│ │ │ │ * _f_i_l_e___o_p_e_n___m_o_d_e___t
│ │ │ │ * _s_e_t_t_i_n_g_s___p_a_c_k
│ │ │ │ o _s_e_t___i_n_t_(_)_ _s_e_t___s_t_r_(_)_ _s_e_t___b_o_o_l_(_)
│ │ │ │ o _h_a_s___v_a_l_(_)
│ │ │ │ o _c_l_e_a_r_(_)
│ │ │ │ o _c_l_e_a_r_(_)
│ │ │ │ - o _g_e_t___b_o_o_l_(_)_ _g_e_t___i_n_t_(_)_ _g_e_t___s_t_r_(_)
│ │ │ │ + o _g_e_t___s_t_r_(_)_ _g_e_t___i_n_t_(_)_ _g_e_t___b_o_o_l_(_)
│ │ │ │ o _e_n_u_m_ _t_y_p_e___b_a_s_e_s
│ │ │ │ o _e_n_u_m_ _m_m_a_p___w_r_i_t_e___m_o_d_e___t
│ │ │ │ o _e_n_u_m_ _s_u_g_g_e_s_t___m_o_d_e___t
│ │ │ │ o _e_n_u_m_ _c_h_o_k_i_n_g___a_l_g_o_r_i_t_h_m___t
│ │ │ │ o _e_n_u_m_ _s_e_e_d___c_h_o_k_i_n_g___a_l_g_o_r_i_t_h_m___t
│ │ │ │ o _e_n_u_m_ _i_o___b_u_f_f_e_r___m_o_d_e___t
│ │ │ │ o _e_n_u_m_ _b_a_n_d_w_i_d_t_h___m_i_x_e_d___a_l_g_o___t
│ │ │ │ o _e_n_u_m_ _e_n_c___p_o_l_i_c_y
│ │ │ │ o _e_n_u_m_ _e_n_c___l_e_v_e_l
│ │ │ │ o _e_n_u_m_ _p_r_o_x_y___t_y_p_e___t
│ │ │ │ * _n_a_m_e___f_o_r___s_e_t_t_i_n_g_(_)_ _s_e_t_t_i_n_g___b_y___n_a_m_e_(_)
│ │ │ │ * _d_e_f_a_u_l_t___s_e_t_t_i_n_g_s_(_)
│ │ │ │ * _h_i_g_h___p_e_r_f_o_r_m_a_n_c_e___s_e_e_d_(_)_ _m_i_n___m_e_m_o_r_y___u_s_a_g_e_(_)
│ │ │ │ * _g_e_n_e_r_a_t_e___f_i_n_g_e_r_p_r_i_n_t_(_)
│ │ │ │ - * _s_t_a_t_s___m_e_t_r_i_c
│ │ │ │ - * _c_o_u_n_t_e_r_s
│ │ │ │ - o _o_p_e_r_a_t_o_r_[_]_(_)_ _i_n_c___s_t_a_t_s___c_o_u_n_t_e_r_(_)
│ │ │ │ - * _s_e_s_s_i_o_n___s_t_a_t_s___m_e_t_r_i_c_s_(_)
│ │ │ │ - * _f_i_n_d___m_e_t_r_i_c___i_d_x_(_)
│ │ │ │ - * _e_n_u_m_ _m_e_t_r_i_c___t_y_p_e___t
│ │ │ │ - * _s_e_s_s_i_o_n___p_a_r_a_m_s
│ │ │ │ - o _s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ - o _s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ - * _s_e_s_s_i_o_n___h_a_n_d_l_e
│ │ │ │ - o _i_s___v_a_l_i_d_(_)
│ │ │ │ - o _s_e_s_s_i_o_n___s_t_a_t_e_(_)
│ │ │ │ - o _g_e_t___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)_ _r_e_f_r_e_s_h___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)
│ │ │ │ - o _p_o_s_t___t_o_r_r_e_n_t___u_p_d_a_t_e_s_(_)
│ │ │ │ - o _p_o_s_t___s_e_s_s_i_o_n___s_t_a_t_s_(_)
│ │ │ │ - o _p_o_s_t___d_h_t___s_t_a_t_s_(_)
│ │ │ │ - o _s_e_t___d_h_t___s_t_a_t_e_(_)
│ │ │ │ - o _f_i_n_d___t_o_r_r_e_n_t_(_)_ _g_e_t___t_o_r_r_e_n_t_s_(_)
│ │ │ │ - o _a_d_d___t_o_r_r_e_n_t_(_)_ _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_)
│ │ │ │ - o _p_a_u_s_e_(_)_ _i_s___p_a_u_s_e_d_(_)_ _r_e_s_u_m_e_(_)
│ │ │ │ - o _i_s___d_h_t___r_u_n_n_i_n_g_(_)
│ │ │ │ - o _s_e_t___d_h_t___s_t_o_r_a_g_e_(_)
│ │ │ │ - o _a_d_d___d_h_t___n_o_d_e_(_)
│ │ │ │ - o _d_h_t___g_e_t___i_t_e_m_(_)
│ │ │ │ - o _d_h_t___g_e_t___i_t_e_m_(_)
│ │ │ │ - o _d_h_t___p_u_t___i_t_e_m_(_)
│ │ │ │ - o _d_h_t___p_u_t___i_t_e_m_(_)
│ │ │ │ - o _d_h_t___g_e_t___p_e_e_r_s_(_)_ _d_h_t___a_n_n_o_u_n_c_e_(_)
│ │ │ │ - o _d_h_t___l_i_v_e___n_o_d_e_s_(_)
│ │ │ │ - o _d_h_t___s_a_m_p_l_e___i_n_f_o_h_a_s_h_e_s_(_)
│ │ │ │ - o _d_h_t___d_i_r_e_c_t___r_e_q_u_e_s_t_(_)
│ │ │ │ - o _a_d_d___e_x_t_e_n_s_i_o_n_(_)
│ │ │ │ - o _s_e_t___i_p___f_i_l_t_e_r_(_)_ _g_e_t___i_p___f_i_l_t_e_r_(_)
│ │ │ │ - o _s_e_t___p_o_r_t___f_i_l_t_e_r_(_)
│ │ │ │ - o _i_s___l_i_s_t_e_n_i_n_g_(_)_ _l_i_s_t_e_n___p_o_r_t_(_)_ _s_s_l___l_i_s_t_e_n___p_o_r_t_(_)
│ │ │ │ - o _s_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_)_ _g_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_)
│ │ │ │ - o _s_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)_ _g_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)
│ │ │ │ - o _c_r_e_a_t_e___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ - o _d_e_l_e_t_e___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ - o _s_e_t___p_e_e_r___c_l_a_s_s_(_)_ _g_e_t___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ - o _r_e_m_o_v_e___t_o_r_r_e_n_t_(_)
│ │ │ │ - o _a_p_p_l_y___s_e_t_t_i_n_g_s_(_)_ _g_e_t___s_e_t_t_i_n_g_s_(_)
│ │ │ │ - o _s_e_t___a_l_e_r_t___n_o_t_i_f_y_(_)_ _w_a_i_t___f_o_r___a_l_e_r_t_(_)_ _p_o_p___a_l_e_r_t_s_(_)
│ │ │ │ - o _d_e_l_e_t_e___p_o_r_t___m_a_p_p_i_n_g_(_)_ _a_d_d___p_o_r_t___m_a_p_p_i_n_g_(_)
│ │ │ │ - o _r_e_o_p_e_n___n_e_t_w_o_r_k___s_o_c_k_e_t_s_(_)
│ │ │ │ - o _n_a_t_i_v_e___h_a_n_d_l_e_(_)
│ │ │ │ - * _s_e_s_s_i_o_n___p_r_o_x_y
│ │ │ │ - o _s_e_s_s_i_o_n___p_r_o_x_y_(_)_ _o_p_e_r_a_t_o_r_=_(_)_ _~_s_e_s_s_i_o_n___p_r_o_x_y_(_)
│ │ │ │ - * _s_e_s_s_i_o_n
│ │ │ │ - o _s_e_s_s_i_o_n_(_)
│ │ │ │ - o _s_e_s_s_i_o_n_(_)
│ │ │ │ - o _~_s_e_s_s_i_o_n_(_)
│ │ │ │ - o _a_b_o_r_t_(_)
│ │ │ │ - * _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s___b_u_f_(_)_ _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)_ _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ * _p_i_e_c_e___b_l_o_c_k
│ │ │ │ - * _p_e_e_r___r_e_q_u_e_s_t
│ │ │ │ - o _o_p_e_r_a_t_o_r_=_=_(_)
│ │ │ │ - * _p_e_e_r___i_n_f_o
│ │ │ │ - o _i_2_p___d_e_s_t_i_n_a_t_i_o_n_(_)
│ │ │ │ * _i_n_f_o___h_a_s_h___t
│ │ │ │ o _i_n_f_o___h_a_s_h___t_(_)
│ │ │ │ - o _h_a_s___v_2_(_)_ _h_a_s___v_1_(_)_ _h_a_s_(_)
│ │ │ │ + o _h_a_s___v_1_(_)_ _h_a_s_(_)_ _h_a_s___v_2_(_)
│ │ │ │ o _g_e_t_(_)
│ │ │ │ o _g_e_t___b_e_s_t_(_)
│ │ │ │ - * _v_e_r_s_i_o_n_(_)
│ │ │ │ + * _p_e_e_r___r_e_q_u_e_s_t
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_=_(_)
│ │ │ │ + * _p_e_e_r___i_n_f_o
│ │ │ │ + o _i_2_p___d_e_s_t_i_n_a_t_i_o_n_(_)
│ │ │ │ + * _l_o_a_d___t_o_r_r_e_n_t___p_a_r_s_e_d_(_)_ _l_o_a_d___t_o_r_r_e_n_t___f_i_l_e_(_)_ _l_o_a_d___t_o_r_r_e_n_t___b_u_f_f_e_r_(_)
│ │ │ │ * _t_r_u_n_c_a_t_e___f_i_l_e_s_(_)
│ │ │ │ - * _t_o_r_r_e_n_t___p_e_e_r___e_q_u_a_l_(_)
│ │ │ │ * _m_a_k_e___m_a_g_n_e_t___u_r_i_(_)
│ │ │ │ * _p_a_r_s_e___m_a_g_n_e_t___u_r_i_(_)
│ │ │ │ - * _l_o_a_d___t_o_r_r_e_n_t___b_u_f_f_e_r_(_)_ _l_o_a_d___t_o_r_r_e_n_t___p_a_r_s_e_d_(_)_ _l_o_a_d___t_o_r_r_e_n_t___f_i_l_e_(_)
│ │ │ │ + * _t_o_r_r_e_n_t___p_e_e_r___e_q_u_a_l_(_)
│ │ │ │ + * _v_e_r_s_i_o_n_(_)
│ │ │ │ + * _e_n_u_m_ _p_r_o_t_o_c_o_l___v_e_r_s_i_o_n
│ │ │ │ * _e_n_u_m_ _e_v_e_n_t___t
│ │ │ │ - * _e_n_u_m_ _s_o_c_k_e_t___t_y_p_e___t
│ │ │ │ + * _e_n_u_m_ _c_o_n_n_e_c_t_i_o_n___t_y_p_e
│ │ │ │ * _e_n_u_m_ _p_o_r_t_m_a_p___t_r_a_n_s_p_o_r_t
│ │ │ │ * _e_n_u_m_ _p_o_r_t_m_a_p___p_r_o_t_o_c_o_l
│ │ │ │ - * _e_n_u_m_ _c_o_n_n_e_c_t_i_o_n___t_y_p_e
│ │ │ │ - * _e_n_u_m_ _p_r_o_t_o_c_o_l___v_e_r_s_i_o_n
│ │ │ │ + * _e_n_u_m_ _s_o_c_k_e_t___t_y_p_e___t
│ │ │ │ * _i_n_t
│ │ │ │ + * _d_o_w_n_l_o_a_d___p_r_i_o_r_i_t_y___t
│ │ │ │ + * _p_e_x___f_l_a_g_s___t
│ │ │ │ * _c_h_a_r_ _c_o_n_s_t_*
│ │ │ │ * _s_t_d_:_:_u_i_n_t_6_4___t
│ │ │ │ * _t_o_r_r_e_n_t___f_l_a_g_s___t
│ │ │ │ - * _p_e_x___f_l_a_g_s___t
│ │ │ │ - * _d_o_w_n_l_o_a_d___p_r_i_o_r_i_t_y___t
│ │ │ │ - * _a_ _w_o_r_d_ _o_f_ _c_a_u_t_i_o_n
│ │ │ │ - * _p_l_u_g_i_n_-_i_n_t_e_r_f_a_c_e
│ │ │ │ - * _c_u_s_t_o_m_ _a_l_e_r_t_s
│ │ │ │ - * _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e
│ │ │ │ - * _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e
│ │ │ │ - * _p_l_u_g_i_n
│ │ │ │ - o _i_m_p_l_e_m_e_n_t_e_d___f_e_a_t_u_r_e_s_(_)
│ │ │ │ - o _n_e_w___t_o_r_r_e_n_t_(_)
│ │ │ │ - o _a_d_d_e_d_(_)
│ │ │ │ - o _a_b_o_r_t_(_)
│ │ │ │ - o _o_n___d_h_t___r_e_q_u_e_s_t_(_)
│ │ │ │ - o _o_n___a_l_e_r_t_(_)
│ │ │ │ - o _o_n___u_n_k_n_o_w_n___t_o_r_r_e_n_t_(_)
│ │ │ │ - o _o_n___t_i_c_k_(_)
│ │ │ │ - o _g_e_t___u_n_c_h_o_k_e___p_r_i_o_r_i_t_y_(_)
│ │ │ │ - o _l_o_a_d___s_t_a_t_e_(_)
│ │ │ │ - * _t_o_r_r_e_n_t___p_l_u_g_i_n
│ │ │ │ - o _n_e_w___c_o_n_n_e_c_t_i_o_n_(_)
│ │ │ │ - o _o_n___p_i_e_c_e___f_a_i_l_e_d_(_)_ _o_n___p_i_e_c_e___p_a_s_s_(_)
│ │ │ │ - o _t_i_c_k_(_)
│ │ │ │ - o _o_n___p_a_u_s_e_(_)_ _o_n___r_e_s_u_m_e_(_)
│ │ │ │ - o _o_n___f_i_l_e_s___c_h_e_c_k_e_d_(_)
│ │ │ │ - o _o_n___s_t_a_t_e_(_)
│ │ │ │ - o _o_n___a_d_d___p_e_e_r_(_)
│ │ │ │ - * _p_e_e_r___p_l_u_g_i_n
│ │ │ │ - o _t_y_p_e_(_)
│ │ │ │ - o _a_d_d___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ - o _o_n___d_i_s_c_o_n_n_e_c_t_(_)
│ │ │ │ - o _o_n___c_o_n_n_e_c_t_e_d_(_)
│ │ │ │ - o _o_n___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ - o _o_n___e_x_t_e_n_s_i_o_n___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ - o _o_n___h_a_v_e_(_)_ _o_n___a_l_l_o_w_e_d___f_a_s_t_(_)_ _o_n___i_n_t_e_r_e_s_t_e_d_(_)_ _o_n___u_n_c_h_o_k_e_(_)
│ │ │ │ - _o_n___h_a_v_e___n_o_n_e_(_)_ _o_n___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _o_n___d_o_n_t___h_a_v_e_(_)_ _o_n___r_e_q_u_e_s_t_(_)
│ │ │ │ - _o_n___h_a_v_e___a_l_l_(_)_ _o_n___b_i_t_f_i_e_l_d_(_)_ _o_n___c_h_o_k_e_(_)
│ │ │ │ - o _o_n___p_i_e_c_e_(_)
│ │ │ │ - o _s_e_n_t___p_i_e_c_e_(_)_ _s_e_n_t___i_n_t_e_r_e_s_t_e_d_(_)_ _s_e_n_t___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _s_e_n_t___u_n_c_h_o_k_e_(_)
│ │ │ │ - _s_e_n_t___h_a_v_e_(_)
│ │ │ │ - o _s_e_n_t___p_a_y_l_o_a_d_(_)
│ │ │ │ - o _c_a_n___d_i_s_c_o_n_n_e_c_t_(_)
│ │ │ │ - o _o_n___e_x_t_e_n_d_e_d_(_)
│ │ │ │ - o _o_n___u_n_k_n_o_w_n___m_e_s_s_a_g_e_(_)
│ │ │ │ - o _o_n___p_i_e_c_e___f_a_i_l_e_d_(_)_ _o_n___p_i_e_c_e___p_a_s_s_(_)
│ │ │ │ - o _t_i_c_k_(_)
│ │ │ │ - o _w_r_i_t_e___r_e_q_u_e_s_t_(_)
│ │ │ │ - * _c_r_y_p_t_o___p_l_u_g_i_n
│ │ │ │ - o _e_n_c_r_y_p_t_(_)
│ │ │ │ - o _d_e_c_r_y_p_t_(_)
│ │ │ │ - * _c_r_e_a_t_e___u_t___p_e_x___p_l_u_g_i_n_(_)
│ │ │ │ - * _c_r_e_a_t_e___u_t___m_e_t_a_d_a_t_a___p_l_u_g_i_n_(_)
│ │ │ │ - * _c_r_e_a_t_e___s_m_a_r_t___b_a_n___p_l_u_g_i_n_(_)
│ │ │ │ * _p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r
│ │ │ │ o _r_e_m_o_v_e_(_)_ _a_d_d_(_)
│ │ │ │ - o _a_l_l_o_w_(_)_ _d_i_s_a_l_l_o_w_(_)
│ │ │ │ + o _d_i_s_a_l_l_o_w_(_)_ _a_l_l_o_w_(_)
│ │ │ │ o _a_p_p_l_y_(_)
│ │ │ │ o _e_n_u_m_ _s_o_c_k_e_t___t_y_p_e___t
│ │ │ │ * _p_e_e_r___c_l_a_s_s___i_n_f_o
│ │ │ │ - * _i_p___f_i_l_t_e_r
│ │ │ │ - o _e_m_p_t_y_(_)
│ │ │ │ - o _a_d_d___r_u_l_e_(_)
│ │ │ │ - o _a_c_c_e_s_s_(_)
│ │ │ │ - o _e_x_p_o_r_t___f_i_l_t_e_r_(_)
│ │ │ │ - o _e_n_u_m_ _a_c_c_e_s_s___f_l_a_g_s
│ │ │ │ - * _p_o_r_t___f_i_l_t_e_r
│ │ │ │ - o _a_d_d___r_u_l_e_(_)
│ │ │ │ - o _a_c_c_e_s_s_(_)
│ │ │ │ - o _e_n_u_m_ _a_c_c_e_s_s___f_l_a_g_s
│ │ │ │ - * _h_a_s_h_e_r
│ │ │ │ - o _h_a_s_h_e_r_(_)_ _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ - o _u_p_d_a_t_e_(_)
│ │ │ │ - o _f_i_n_a_l_(_)
│ │ │ │ - o _r_e_s_e_t_(_)
│ │ │ │ - * _h_a_s_h_e_r_2_5_6
│ │ │ │ - o _h_a_s_h_e_r_2_5_6_(_)_ _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ - o _u_p_d_a_t_e_(_)
│ │ │ │ - o _f_i_n_a_l_(_)
│ │ │ │ - o _r_e_s_e_t_(_)
│ │ │ │ - * _b_i_t_f_i_e_l_d
│ │ │ │ - o _b_i_t_f_i_e_l_d_(_)
│ │ │ │ - o _a_s_s_i_g_n_(_)
│ │ │ │ - o _g_e_t___b_i_t_(_)_ _o_p_e_r_a_t_o_r_[_]_(_)
│ │ │ │ - o _s_e_t___b_i_t_(_)_ _c_l_e_a_r___b_i_t_(_)
│ │ │ │ - o _a_l_l___s_e_t_(_)
│ │ │ │ - o _n_o_n_e___s_e_t_(_)
│ │ │ │ - o _s_i_z_e_(_)
│ │ │ │ - o _n_u_m___w_o_r_d_s_(_)
│ │ │ │ - o _n_u_m___b_y_t_e_s_(_)
│ │ │ │ - o _e_m_p_t_y_(_)
│ │ │ │ - o _d_a_t_a_(_)
│ │ │ │ - o _s_w_a_p_(_)
│ │ │ │ - o _c_o_u_n_t_(_)
│ │ │ │ - o _f_i_n_d___f_i_r_s_t___s_e_t_(_)
│ │ │ │ - o _f_i_n_d___l_a_s_t___c_l_e_a_r_(_)
│ │ │ │ - * _s_t_o_r_a_g_e___e_r_r_o_r
│ │ │ │ - o _b_o_o_l_(_)
│ │ │ │ - o _f_i_l_e_(_)
│ │ │ │ - * _u_p_n_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ - * _s_o_c_k_s___c_a_t_e_g_o_r_y_(_)
│ │ │ │ - * _p_c_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ - * _i_2_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ - * _g_z_i_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ - * _l_i_b_t_o_r_r_e_n_t___c_a_t_e_g_o_r_y_(_)
│ │ │ │ - * _h_t_t_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ - * _b_d_e_c_o_d_e___c_a_t_e_g_o_r_y_(_)
│ │ │ │ - * _e_n_u_m_ _e_r_r_o_r___c_o_d_e___e_n_u_m
│ │ │ │ - * _e_n_u_m_ _s_o_c_k_s___e_r_r_o_r___c_o_d_e
│ │ │ │ - * _e_n_u_m_ _p_c_p___e_r_r_o_r_s
│ │ │ │ - * _e_n_u_m_ _i_2_p___e_r_r_o_r___c_o_d_e
│ │ │ │ - * _e_n_u_m_ _e_r_r_o_r___c_o_d_e___e_n_u_m
│ │ │ │ - * _e_n_u_m_ _e_r_r_o_r___c_o_d_e___e_n_u_m
│ │ │ │ - * _e_n_u_m_ _h_t_t_p___e_r_r_o_r_s
│ │ │ │ - * _e_n_u_m_ _e_r_r_o_r___c_o_d_e___e_n_u_m
│ │ │ │ - * _e_n_t_r_y
│ │ │ │ - o _t_y_p_e_(_)
│ │ │ │ - o _e_n_t_r_y_(_)
│ │ │ │ - o _e_n_t_r_y_(_)
│ │ │ │ - o _e_n_t_r_y_(_)
│ │ │ │ - o _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ - o _l_i_s_t_(_)_ _i_n_t_e_g_e_r_(_)_ _d_i_c_t_(_)_ _s_t_r_i_n_g_(_)_ _p_r_e_f_o_r_m_a_t_t_e_d_(_)
│ │ │ │ - o _s_w_a_p_(_)
│ │ │ │ - o _o_p_e_r_a_t_o_r_[_]_(_)
│ │ │ │ - o _f_i_n_d___k_e_y_(_)
│ │ │ │ - o _t_o___s_t_r_i_n_g_(_)
│ │ │ │ - o _e_n_u_m_ _d_a_t_a___t_y_p_e
│ │ │ │ - * _o_p_e_r_a_t_o_r_<_<_(_)
│ │ │ │ - * _b_e_n_c_o_d_e_(_)
│ │ │ │ - * _c_r_e_a_t_e___t_o_r_r_e_n_t
│ │ │ │ - o _c_r_e_a_t_e___t_o_r_r_e_n_t_(_)
│ │ │ │ - o _g_e_n_e_r_a_t_e___b_u_f_(_)_ _g_e_n_e_r_a_t_e_(_)
│ │ │ │ - o _f_i_l_e_s_(_)
│ │ │ │ - o _s_e_t___c_o_m_m_e_n_t_(_)
│ │ │ │ - o _s_e_t___c_r_e_a_t_o_r_(_)
│ │ │ │ - o _s_e_t___c_r_e_a_t_i_o_n___d_a_t_e_(_)
│ │ │ │ - o _s_e_t___h_a_s_h_(_)
│ │ │ │ - o _s_e_t___h_a_s_h_2_(_)
│ │ │ │ - o _a_d_d___h_t_t_p___s_e_e_d_(_)_ _a_d_d___u_r_l___s_e_e_d_(_)
│ │ │ │ - o _a_d_d___n_o_d_e_(_)
│ │ │ │ - o _a_d_d___t_r_a_c_k_e_r_(_)
│ │ │ │ - o _s_e_t___r_o_o_t___c_e_r_t_(_)
│ │ │ │ - o _s_e_t___p_r_i_v_(_)_ _p_r_i_v_(_)
│ │ │ │ - o _n_u_m___p_i_e_c_e_s_(_)
│ │ │ │ - o _p_i_e_c_e___r_a_n_g_e_(_)
│ │ │ │ - o _f_i_l_e___r_a_n_g_e_(_)
│ │ │ │ - o _f_i_l_e___p_i_e_c_e___r_a_n_g_e_(_)
│ │ │ │ - o _t_o_t_a_l___s_i_z_e_(_)
│ │ │ │ - o _p_i_e_c_e___s_i_z_e_(_)_ _p_i_e_c_e___l_e_n_g_t_h_(_)
│ │ │ │ - o _a_d_d___c_o_l_l_e_c_t_i_o_n_(_)_ _a_d_d___s_i_m_i_l_a_r___t_o_r_r_e_n_t_(_)
│ │ │ │ - * _a_d_d___f_i_l_e_s_(_)
│ │ │ │ - * _s_e_t___p_i_e_c_e___h_a_s_h_e_s_(_)
│ │ │ │ - * _c_l_i_e_n_t___d_a_t_a___t
│ │ │ │ - o _c_l_i_e_n_t___d_a_t_a___t_(_)
│ │ │ │ - o _c_l_i_e_n_t___d_a_t_a___t_(_)
│ │ │ │ - o _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ - o _T_(_)_ _g_e_t_(_)
│ │ │ │ - o _c_o_n_s_t_*_(_)_ _v_o_i_d_*_(_)_ _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ - * _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s
│ │ │ │ - * _b_d_e_c_o_d_e___n_o_d_e
│ │ │ │ - o _b_d_e_c_o_d_e___n_o_d_e_(_)
│ │ │ │ - o _b_d_e_c_o_d_e___n_o_d_e_(_)_ _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ - o _t_y_p_e_(_)
│ │ │ │ - o _b_o_o_l_(_)
│ │ │ │ - o _n_o_n___o_w_n_i_n_g_(_)
│ │ │ │ - o _d_a_t_a___o_f_f_s_e_t_(_)_ _d_a_t_a___s_e_c_t_i_o_n_(_)
│ │ │ │ - o _l_i_s_t___s_t_r_i_n_g___v_a_l_u_e___a_t_(_)_ _l_i_s_t___i_n_t___v_a_l_u_e___a_t_(_)_ _l_i_s_t___a_t_(_)_ _l_i_s_t___s_i_z_e_(_)
│ │ │ │ - o _d_i_c_t___f_i_n_d_(_)_ _d_i_c_t___f_i_n_d___d_i_c_t_(_)_ _d_i_c_t___f_i_n_d___i_n_t___v_a_l_u_e_(_)_ _d_i_c_t___f_i_n_d___i_n_t_(_)
│ │ │ │ - _d_i_c_t___f_i_n_d___l_i_s_t_(_)_ _d_i_c_t___f_i_n_d___s_t_r_i_n_g___v_a_l_u_e_(_)_ _d_i_c_t___a_t___n_o_d_e_(_)_ _d_i_c_t___a_t_(_)
│ │ │ │ - _d_i_c_t___s_i_z_e_(_)_ _d_i_c_t___f_i_n_d___s_t_r_i_n_g_(_)
│ │ │ │ - o _i_n_t___v_a_l_u_e_(_)
│ │ │ │ - o _s_t_r_i_n_g___v_a_l_u_e_(_)_ _s_t_r_i_n_g___l_e_n_g_t_h_(_)_ _s_t_r_i_n_g___p_t_r_(_)_ _s_t_r_i_n_g___o_f_f_s_e_t_(_)
│ │ │ │ - o _c_l_e_a_r_(_)
│ │ │ │ - o _s_w_a_p_(_)
│ │ │ │ - o _r_e_s_e_r_v_e_(_)
│ │ │ │ - o _s_w_i_t_c_h___u_n_d_e_r_l_y_i_n_g___b_u_f_f_e_r_(_)
│ │ │ │ - o _h_a_s___s_o_f_t___e_r_r_o_r_(_)
│ │ │ │ - o _e_n_u_m_ _t_y_p_e___t
│ │ │ │ - * _p_r_i_n_t___e_n_t_r_y_(_)
│ │ │ │ - * _b_d_e_c_o_d_e_(_)
│ │ │ │ - * _a_n_n_o_u_n_c_e___i_n_f_o_h_a_s_h
│ │ │ │ - * _a_n_n_o_u_n_c_e___e_n_d_p_o_i_n_t
│ │ │ │ - * _a_n_n_o_u_n_c_e___e_n_t_r_y
│ │ │ │ - o _o_p_e_r_a_t_o_r_=_(_)_ _a_n_n_o_u_n_c_e___e_n_t_r_y_(_)_ _~_a_n_n_o_u_n_c_e___e_n_t_r_y_(_)
│ │ │ │ - o _e_n_u_m_ _t_r_a_c_k_e_r___s_o_u_r_c_e
│ │ │ │ * _d_h_t___r_o_u_t_i_n_g___b_u_c_k_e_t
│ │ │ │ * _t_o_r_r_e_n_t___a_l_e_r_t
│ │ │ │ o _m_e_s_s_a_g_e_(_)
│ │ │ │ * _p_e_e_r___a_l_e_r_t
│ │ │ │ * _t_r_a_c_k_e_r___a_l_e_r_t
│ │ │ │ o _t_r_a_c_k_e_r___u_r_l_(_)
│ │ │ │ * _t_o_r_r_e_n_t___r_e_m_o_v_e_d___a_l_e_r_t
│ │ │ │ * _r_e_a_d___p_i_e_c_e___a_l_e_r_t
│ │ │ │ * _f_i_l_e___c_o_m_p_l_e_t_e_d___a_l_e_r_t
│ │ │ │ * _f_i_l_e___r_e_n_a_m_e_d___a_l_e_r_t
│ │ │ │ - o _n_e_w___n_a_m_e_(_)_ _o_l_d___n_a_m_e_(_)
│ │ │ │ + o _o_l_d___n_a_m_e_(_)_ _n_e_w___n_a_m_e_(_)
│ │ │ │ * _f_i_l_e___r_e_n_a_m_e___f_a_i_l_e_d___a_l_e_r_t
│ │ │ │ * _p_e_r_f_o_r_m_a_n_c_e___a_l_e_r_t
│ │ │ │ o _e_n_u_m_ _p_e_r_f_o_r_m_a_n_c_e___w_a_r_n_i_n_g___t
│ │ │ │ * _s_t_a_t_e___c_h_a_n_g_e_d___a_l_e_r_t
│ │ │ │ * _t_r_a_c_k_e_r___e_r_r_o_r___a_l_e_r_t
│ │ │ │ o _f_a_i_l_u_r_e___r_e_a_s_o_n_(_)
│ │ │ │ * _t_r_a_c_k_e_r___w_a_r_n_i_n_g___a_l_e_r_t
│ │ │ │ @@ -575,18 +240,18 @@
│ │ │ │ o _p_k_t___b_u_f_(_)
│ │ │ │ o _e_n_u_m_ _d_i_r_e_c_t_i_o_n___t
│ │ │ │ * _d_h_t___g_e_t___p_e_e_r_s___r_e_p_l_y___a_l_e_r_t
│ │ │ │ * _d_h_t___d_i_r_e_c_t___r_e_s_p_o_n_s_e___a_l_e_r_t
│ │ │ │ * _p_i_c_k_e_r___l_o_g___a_l_e_r_t
│ │ │ │ * _s_e_s_s_i_o_n___e_r_r_o_r___a_l_e_r_t
│ │ │ │ * _d_h_t___l_i_v_e___n_o_d_e_s___a_l_e_r_t
│ │ │ │ - o _n_u_m___n_o_d_e_s_(_)_ _n_o_d_e_s_(_)
│ │ │ │ + o _n_o_d_e_s_(_)_ _n_u_m___n_o_d_e_s_(_)
│ │ │ │ * _s_e_s_s_i_o_n___s_t_a_t_s___h_e_a_d_e_r___a_l_e_r_t
│ │ │ │ * _d_h_t___s_a_m_p_l_e___i_n_f_o_h_a_s_h_e_s___a_l_e_r_t
│ │ │ │ - o _n_u_m___s_a_m_p_l_e_s_(_)_ _s_a_m_p_l_e_s_(_)
│ │ │ │ + o _s_a_m_p_l_e_s_(_)_ _n_u_m___s_a_m_p_l_e_s_(_)
│ │ │ │ o _n_u_m___n_o_d_e_s_(_)
│ │ │ │ o _n_o_d_e_s_(_)
│ │ │ │ * _b_l_o_c_k___u_p_l_o_a_d_e_d___a_l_e_r_t
│ │ │ │ * _a_l_e_r_t_s___d_r_o_p_p_e_d___a_l_e_r_t
│ │ │ │ * _s_o_c_k_s_5___a_l_e_r_t
│ │ │ │ * _f_i_l_e___p_r_i_o___a_l_e_r_t
│ │ │ │ * _o_v_e_r_s_i_z_e_d___f_i_l_e___a_l_e_r_t
│ │ │ │ @@ -603,2561 +268,773 @@
│ │ │ │ o _m_e_s_s_a_g_e_(_)
│ │ │ │ o _c_a_t_e_g_o_r_y_(_)
│ │ │ │ * _o_p_e_r_a_t_i_o_n___n_a_m_e_(_)
│ │ │ │ * _a_l_e_r_t___c_a_s_t_(_)
│ │ │ │ * _e_n_u_m_ _o_p_e_r_a_t_i_o_n___t
│ │ │ │ * _i_n_t
│ │ │ │ * _a_l_e_r_t___c_a_t_e_g_o_r_y___t
│ │ │ │ + * _s_e_s_s_i_o_n___p_a_r_a_m_s
│ │ │ │ + o _s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ + o _s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ + * _s_e_s_s_i_o_n___p_r_o_x_y
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_(_)_ _~_s_e_s_s_i_o_n___p_r_o_x_y_(_)_ _s_e_s_s_i_o_n___p_r_o_x_y_(_)
│ │ │ │ + * _s_e_s_s_i_o_n
│ │ │ │ + o _s_e_s_s_i_o_n_(_)
│ │ │ │ + o _s_e_s_s_i_o_n_(_)
│ │ │ │ + o _~_s_e_s_s_i_o_n_(_)
│ │ │ │ + o _a_b_o_r_t_(_)
│ │ │ │ + * _s_e_s_s_i_o_n___h_a_n_d_l_e
│ │ │ │ + o _i_s___v_a_l_i_d_(_)
│ │ │ │ + o _s_e_s_s_i_o_n___s_t_a_t_e_(_)
│ │ │ │ + o _r_e_f_r_e_s_h___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)_ _g_e_t___t_o_r_r_e_n_t___s_t_a_t_u_s_(_)
│ │ │ │ + o _p_o_s_t___t_o_r_r_e_n_t___u_p_d_a_t_e_s_(_)
│ │ │ │ + o _p_o_s_t___s_e_s_s_i_o_n___s_t_a_t_s_(_)
│ │ │ │ + o _p_o_s_t___d_h_t___s_t_a_t_s_(_)
│ │ │ │ + o _s_e_t___d_h_t___s_t_a_t_e_(_)
│ │ │ │ + o _g_e_t___t_o_r_r_e_n_t_s_(_)_ _f_i_n_d___t_o_r_r_e_n_t_(_)
│ │ │ │ + o _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_)_ _a_d_d___t_o_r_r_e_n_t_(_)
│ │ │ │ + o _p_a_u_s_e_(_)_ _i_s___p_a_u_s_e_d_(_)_ _r_e_s_u_m_e_(_)
│ │ │ │ + o _i_s___d_h_t___r_u_n_n_i_n_g_(_)
│ │ │ │ + o _s_e_t___d_h_t___s_t_o_r_a_g_e_(_)
│ │ │ │ + o _a_d_d___d_h_t___n_o_d_e_(_)
│ │ │ │ + o _d_h_t___g_e_t___i_t_e_m_(_)
│ │ │ │ + o _d_h_t___g_e_t___i_t_e_m_(_)
│ │ │ │ + o _d_h_t___p_u_t___i_t_e_m_(_)
│ │ │ │ + o _d_h_t___p_u_t___i_t_e_m_(_)
│ │ │ │ + o _d_h_t___a_n_n_o_u_n_c_e_(_)_ _d_h_t___g_e_t___p_e_e_r_s_(_)
│ │ │ │ + o _d_h_t___l_i_v_e___n_o_d_e_s_(_)
│ │ │ │ + o _d_h_t___s_a_m_p_l_e___i_n_f_o_h_a_s_h_e_s_(_)
│ │ │ │ + o _d_h_t___d_i_r_e_c_t___r_e_q_u_e_s_t_(_)
│ │ │ │ + o _a_d_d___e_x_t_e_n_s_i_o_n_(_)
│ │ │ │ + o _g_e_t___i_p___f_i_l_t_e_r_(_)_ _s_e_t___i_p___f_i_l_t_e_r_(_)
│ │ │ │ + o _s_e_t___p_o_r_t___f_i_l_t_e_r_(_)
│ │ │ │ + o _l_i_s_t_e_n___p_o_r_t_(_)_ _i_s___l_i_s_t_e_n_i_n_g_(_)_ _s_s_l___l_i_s_t_e_n___p_o_r_t_(_)
│ │ │ │ + o _g_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_)_ _s_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_)
│ │ │ │ + o _s_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)_ _g_e_t___p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_(_)
│ │ │ │ + o _c_r_e_a_t_e___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ + o _d_e_l_e_t_e___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ + o _g_e_t___p_e_e_r___c_l_a_s_s_(_)_ _s_e_t___p_e_e_r___c_l_a_s_s_(_)
│ │ │ │ + o _r_e_m_o_v_e___t_o_r_r_e_n_t_(_)
│ │ │ │ + o _a_p_p_l_y___s_e_t_t_i_n_g_s_(_)_ _g_e_t___s_e_t_t_i_n_g_s_(_)
│ │ │ │ + o _s_e_t___a_l_e_r_t___n_o_t_i_f_y_(_)_ _p_o_p___a_l_e_r_t_s_(_)_ _w_a_i_t___f_o_r___a_l_e_r_t_(_)
│ │ │ │ + o _d_e_l_e_t_e___p_o_r_t___m_a_p_p_i_n_g_(_)_ _a_d_d___p_o_r_t___m_a_p_p_i_n_g_(_)
│ │ │ │ + o _r_e_o_p_e_n___n_e_t_w_o_r_k___s_o_c_k_e_t_s_(_)
│ │ │ │ + o _n_a_t_i_v_e___h_a_n_d_l_e_(_)
│ │ │ │ + * _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s___b_u_f_(_)_ _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)_ _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ + * _w_e_b___s_e_e_d___e_n_t_r_y
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_=_(_)
│ │ │ │ + o _o_p_e_r_a_t_o_r_<_(_)
│ │ │ │ + o _e_n_u_m_ _t_y_p_e___t
│ │ │ │ + * _l_o_a_d___t_o_r_r_e_n_t___l_i_m_i_t_s
│ │ │ │ + * _t_o_r_r_e_n_t___i_n_f_o
│ │ │ │ + o _t_o_r_r_e_n_t___i_n_f_o_(_)
│ │ │ │ + o _~_t_o_r_r_e_n_t___i_n_f_o_(_)
│ │ │ │ + o _o_r_i_g___f_i_l_e_s_(_)_ _f_i_l_e_s_(_)
│ │ │ │ + o _r_e_n_a_m_e___f_i_l_e_(_)
│ │ │ │ + o _r_e_m_a_p___f_i_l_e_s_(_)
│ │ │ │ + o _t_r_a_c_k_e_r_s_(_)_ _a_d_d___t_r_a_c_k_e_r_(_)_ _c_l_e_a_r___t_r_a_c_k_e_r_s_(_)
│ │ │ │ + o _s_i_m_i_l_a_r___t_o_r_r_e_n_t_s_(_)_ _c_o_l_l_e_c_t_i_o_n_s_(_)
│ │ │ │ + o _a_d_d___h_t_t_p___s_e_e_d_(_)_ _w_e_b___s_e_e_d_s_(_)_ _a_d_d___u_r_l___s_e_e_d_(_)_ _s_e_t___w_e_b___s_e_e_d_s_(_)
│ │ │ │ + o _t_o_t_a_l___s_i_z_e_(_)
│ │ │ │ + o _p_i_e_c_e___l_e_n_g_t_h_(_)_ _n_u_m___p_i_e_c_e_s_(_)
│ │ │ │ + o _b_l_o_c_k_s___p_e_r___p_i_e_c_e_(_)
│ │ │ │ + o _p_i_e_c_e___r_a_n_g_e_(_)_ _e_n_d___p_i_e_c_e_(_)_ _l_a_s_t___p_i_e_c_e_(_)
│ │ │ │ + o _i_n_f_o___h_a_s_h_e_s_(_)_ _i_n_f_o___h_a_s_h_(_)
│ │ │ │ + o _v_1_(_)_ _v_2_(_)
│ │ │ │ + o _n_u_m___f_i_l_e_s_(_)
│ │ │ │ + o _m_a_p___b_l_o_c_k_(_)
│ │ │ │ + o _m_a_p___f_i_l_e_(_)
│ │ │ │ + o _s_s_l___c_e_r_t_(_)
│ │ │ │ + o _i_s___v_a_l_i_d_(_)
│ │ │ │ + o _p_r_i_v_(_)
│ │ │ │ + o _i_s___i_2_p_(_)
│ │ │ │ + o _p_i_e_c_e___s_i_z_e_(_)
│ │ │ │ + o _p_i_e_c_e___s_i_z_e___f_o_r___r_e_q_(_)
│ │ │ │ + o _h_a_s_h___f_o_r___p_i_e_c_e___p_t_r_(_)_ _h_a_s_h___f_o_r___p_i_e_c_e_(_)
│ │ │ │ + o _n_a_m_e_(_)
│ │ │ │ + o _c_r_e_a_t_i_o_n___d_a_t_e_(_)
│ │ │ │ + o _c_r_e_a_t_o_r_(_)
│ │ │ │ + o _c_o_m_m_e_n_t_(_)
│ │ │ │ + o _n_o_d_e_s_(_)
│ │ │ │ + o _a_d_d___n_o_d_e_(_)
│ │ │ │ + o _p_a_r_s_e___i_n_f_o___s_e_c_t_i_o_n_(_)
│ │ │ │ + o _i_n_f_o_(_)
│ │ │ │ + o _i_n_f_o___s_e_c_t_i_o_n_(_)
│ │ │ │ + o _p_i_e_c_e___l_a_y_e_r_(_)
│ │ │ │ + o _f_r_e_e___p_i_e_c_e___l_a_y_e_r_s_(_)
│ │ │ │ + * _b_l_o_c_k___i_n_f_o
│ │ │ │ + o _s_e_t___p_e_e_r_(_)_ _p_e_e_r_(_)
│ │ │ │ + o _e_n_u_m_ _b_l_o_c_k___s_t_a_t_e___t
│ │ │ │ + * _p_a_r_t_i_a_l___p_i_e_c_e___i_n_f_o
│ │ │ │ + * _t_o_r_r_e_n_t___h_a_n_d_l_e
│ │ │ │ + o _t_o_r_r_e_n_t___h_a_n_d_l_e_(_)
│ │ │ │ + o _a_d_d___p_i_e_c_e_(_)
│ │ │ │ + o _r_e_a_d___p_i_e_c_e_(_)
│ │ │ │ + o _h_a_v_e___p_i_e_c_e_(_)
│ │ │ │ + o _g_e_t___p_e_e_r___i_n_f_o_(_)_ _p_o_s_t___p_e_e_r___i_n_f_o_(_)
│ │ │ │ + o _s_t_a_t_u_s_(_)_ _p_o_s_t___s_t_a_t_u_s_(_)
│ │ │ │ + o _p_o_s_t___d_o_w_n_l_o_a_d___q_u_e_u_e_(_)_ _g_e_t___d_o_w_n_l_o_a_d___q_u_e_u_e_(_)
│ │ │ │ + o _s_e_t___p_i_e_c_e___d_e_a_d_l_i_n_e_(_)_ _r_e_s_e_t___p_i_e_c_e___d_e_a_d_l_i_n_e_(_)_ _c_l_e_a_r___p_i_e_c_e___d_e_a_d_l_i_n_e_s_(_)
│ │ │ │ + o _p_o_s_t___f_i_l_e___p_r_o_g_r_e_s_s_(_)_ _f_i_l_e___p_r_o_g_r_e_s_s_(_)
│ │ │ │ + o _f_i_l_e___s_t_a_t_u_s_(_)
│ │ │ │ + o _c_l_e_a_r___e_r_r_o_r_(_)
│ │ │ │ + o _t_r_a_c_k_e_r_s_(_)_ _p_o_s_t___t_r_a_c_k_e_r_s_(_)_ _a_d_d___t_r_a_c_k_e_r_(_)_ _r_e_p_l_a_c_e___t_r_a_c_k_e_r_s_(_)
│ │ │ │ + o _r_e_m_o_v_e___u_r_l___s_e_e_d_(_)_ _a_d_d___u_r_l___s_e_e_d_(_)_ _u_r_l___s_e_e_d_s_(_)
│ │ │ │ + o _h_t_t_p___s_e_e_d_s_(_)_ _a_d_d___h_t_t_p___s_e_e_d_(_)_ _r_e_m_o_v_e___h_t_t_p___s_e_e_d_(_)
│ │ │ │ + o _a_d_d___e_x_t_e_n_s_i_o_n_(_)
│ │ │ │ + o _s_e_t___m_e_t_a_d_a_t_a_(_)
│ │ │ │ + o _i_s___v_a_l_i_d_(_)
│ │ │ │ + o _p_a_u_s_e_(_)_ _r_e_s_u_m_e_(_)
│ │ │ │ + o _u_n_s_e_t___f_l_a_g_s_(_)_ _s_e_t___f_l_a_g_s_(_)_ _f_l_a_g_s_(_)
│ │ │ │ + o _f_l_u_s_h___c_a_c_h_e_(_)
│ │ │ │ + o _f_o_r_c_e___r_e_c_h_e_c_k_(_)
│ │ │ │ + o _g_e_t___r_e_s_u_m_e___d_a_t_a_(_)_ _s_a_v_e___r_e_s_u_m_e___d_a_t_a_(_)
│ │ │ │ + o _n_e_e_d___s_a_v_e___r_e_s_u_m_e___d_a_t_a_(_)
│ │ │ │ + o _q_u_e_u_e___p_o_s_i_t_i_o_n___b_o_t_t_o_m_(_)_ _q_u_e_u_e___p_o_s_i_t_i_o_n___d_o_w_n_(_)_ _q_u_e_u_e___p_o_s_i_t_i_o_n_(_)
│ │ │ │ + _q_u_e_u_e___p_o_s_i_t_i_o_n___u_p_(_)_ _q_u_e_u_e___p_o_s_i_t_i_o_n___t_o_p_(_)
│ │ │ │ + o _q_u_e_u_e___p_o_s_i_t_i_o_n___s_e_t_(_)
│ │ │ │ + o _s_e_t___s_s_l___c_e_r_t_i_f_i_c_a_t_e_(_)_ _s_e_t___s_s_l___c_e_r_t_i_f_i_c_a_t_e___b_u_f_f_e_r_(_)
│ │ │ │ + o _t_o_r_r_e_n_t___f_i_l_e_(_)_ _t_o_r_r_e_n_t___f_i_l_e___w_i_t_h___h_a_s_h_e_s_(_)
│ │ │ │ + o _p_i_e_c_e___l_a_y_e_r_s_(_)
│ │ │ │ + o _p_i_e_c_e___a_v_a_i_l_a_b_i_l_i_t_y_(_)_ _p_o_s_t___p_i_e_c_e___a_v_a_i_l_a_b_i_l_i_t_y_(_)
│ │ │ │ + o _g_e_t___p_i_e_c_e___p_r_i_o_r_i_t_i_e_s_(_)_ _p_i_e_c_e___p_r_i_o_r_i_t_y_(_)_ _p_r_i_o_r_i_t_i_z_e___p_i_e_c_e_s_(_)
│ │ │ │ + o _f_i_l_e___p_r_i_o_r_i_t_y_(_)_ _g_e_t___f_i_l_e___p_r_i_o_r_i_t_i_e_s_(_)_ _p_r_i_o_r_i_t_i_z_e___f_i_l_e_s_(_)
│ │ │ │ + o _f_o_r_c_e___l_s_d___a_n_n_o_u_n_c_e_(_)_ _f_o_r_c_e___d_h_t___a_n_n_o_u_n_c_e_(_)_ _f_o_r_c_e___r_e_a_n_n_o_u_n_c_e_(_)
│ │ │ │ + o _s_c_r_a_p_e___t_r_a_c_k_e_r_(_)
│ │ │ │ + o _s_e_t___d_o_w_n_l_o_a_d___l_i_m_i_t_(_)_ _u_p_l_o_a_d___l_i_m_i_t_(_)_ _s_e_t___u_p_l_o_a_d___l_i_m_i_t_(_)
│ │ │ │ + _d_o_w_n_l_o_a_d___l_i_m_i_t_(_)
│ │ │ │ + o _c_o_n_n_e_c_t___p_e_e_r_(_)
│ │ │ │ + o _c_l_e_a_r___p_e_e_r_s_(_)
│ │ │ │ + o _m_a_x___u_p_l_o_a_d_s_(_)_ _s_e_t___m_a_x___u_p_l_o_a_d_s_(_)
│ │ │ │ + o _s_e_t___m_a_x___c_o_n_n_e_c_t_i_o_n_s_(_)_ _m_a_x___c_o_n_n_e_c_t_i_o_n_s_(_)
│ │ │ │ + o _m_o_v_e___s_t_o_r_a_g_e_(_)
│ │ │ │ + o _r_e_n_a_m_e___f_i_l_e_(_)
│ │ │ │ + o _i_n_f_o___h_a_s_h_e_s_(_)_ _i_n_f_o___h_a_s_h_(_)
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_=_(_)_ _o_p_e_r_a_t_o_r_<_(_)_ _o_p_e_r_a_t_o_r_!_=_(_)
│ │ │ │ + o _i_d_(_)
│ │ │ │ + o _n_a_t_i_v_e___h_a_n_d_l_e_(_)
│ │ │ │ + o _u_s_e_r_d_a_t_a_(_)
│ │ │ │ + o _i_n___s_e_s_s_i_o_n_(_)
│ │ │ │ + * _h_a_s_h___v_a_l_u_e_(_)
│ │ │ │ + * _s_t_o_r_a_g_e___p_a_r_a_m_s
│ │ │ │ + * _f_i_l_e___s_l_i_c_e
│ │ │ │ + * _f_i_l_e___s_t_o_r_a_g_e
│ │ │ │ + o _i_s___v_a_l_i_d_(_)
│ │ │ │ + o _r_e_s_e_r_v_e_(_)
│ │ │ │ + o _a_d_d___f_i_l_e___b_o_r_r_o_w_(_)_ _a_d_d___f_i_l_e_(_)
│ │ │ │ + o _r_e_n_a_m_e___f_i_l_e_(_)
│ │ │ │ + o _m_a_p___b_l_o_c_k_(_)
│ │ │ │ + o _m_a_p___f_i_l_e_(_)
│ │ │ │ + o _n_u_m___f_i_l_e_s_(_)
│ │ │ │ + o _e_n_d___f_i_l_e_(_)
│ │ │ │ + o _f_i_l_e___r_a_n_g_e_(_)
│ │ │ │ + o _t_o_t_a_l___s_i_z_e_(_)
│ │ │ │ + o _s_e_t___n_u_m___p_i_e_c_e_s_(_)_ _n_u_m___p_i_e_c_e_s_(_)
│ │ │ │ + o _e_n_d___p_i_e_c_e_(_)
│ │ │ │ + o _l_a_s_t___p_i_e_c_e_(_)
│ │ │ │ + o _p_i_e_c_e___r_a_n_g_e_(_)
│ │ │ │ + o _p_i_e_c_e___l_e_n_g_t_h_(_)_ _s_e_t___p_i_e_c_e___l_e_n_g_t_h_(_)
│ │ │ │ + o _p_i_e_c_e___s_i_z_e_(_)
│ │ │ │ + o _p_i_e_c_e___s_i_z_e_2_(_)
│ │ │ │ + o _b_l_o_c_k_s___i_n___p_i_e_c_e_2_(_)
│ │ │ │ + o _b_l_o_c_k_s___p_e_r___p_i_e_c_e_(_)
│ │ │ │ + o _n_a_m_e_(_)_ _s_e_t___n_a_m_e_(_)
│ │ │ │ + o _s_w_a_p_(_)
│ │ │ │ + o _c_a_n_o_n_i_c_a_l_i_z_e_(_)
│ │ │ │ + o _f_i_l_e___o_f_f_s_e_t_(_)_ _p_a_d___f_i_l_e___a_t_(_)_ _m_t_i_m_e_(_)_ _s_y_m_l_i_n_k_(_)_ _f_i_l_e___s_i_z_e_(_)_ _f_i_l_e___p_a_t_h
│ │ │ │ + _(_)_ _f_i_l_e___n_a_m_e_(_)_ _h_a_s_h_(_)_ _r_o_o_t___p_t_r_(_)_ _r_o_o_t_(_)
│ │ │ │ + o _f_i_l_e___n_u_m___b_l_o_c_k_s_(_)_ _f_i_l_e___p_i_e_c_e___r_a_n_g_e_(_)_ _f_i_l_e___n_u_m___p_i_e_c_e_s_(_)
│ │ │ │ + o _f_i_l_e___f_i_r_s_t___p_i_e_c_e___n_o_d_e_(_)_ _f_i_l_e___f_i_r_s_t___b_l_o_c_k___n_o_d_e_(_)
│ │ │ │ + o _f_i_l_e___p_a_t_h___h_a_s_h_(_)
│ │ │ │ + o _a_l_l___p_a_t_h___h_a_s_h_e_s_(_)
│ │ │ │ + o _f_i_l_e___f_l_a_g_s_(_)
│ │ │ │ + o _f_i_l_e___a_b_s_o_l_u_t_e___p_a_t_h_(_)
│ │ │ │ + o _f_i_l_e___i_n_d_e_x___a_t___p_i_e_c_e_(_)_ _f_i_l_e___i_n_d_e_x___a_t___o_f_f_s_e_t_(_)
│ │ │ │ + o _f_i_l_e___i_n_d_e_x___f_o_r___r_o_o_t_(_)
│ │ │ │ + o _p_i_e_c_e___i_n_d_e_x___a_t___f_i_l_e_(_)
│ │ │ │ + o _s_a_n_i_t_i_z_e___s_y_m_l_i_n_k_s_(_)
│ │ │ │ + o _v_2_(_)
│ │ │ │ + * _m_m_a_p___d_i_s_k___i_o___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ + * _d_e_f_a_u_l_t___d_i_s_k___i_o___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ + * _d_i_s_a_b_l_e_d___d_i_s_k___i_o___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ + * _p_o_s_i_x___d_i_s_k___i_o___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ + * _e_n_u_m_ _s_t_o_r_a_g_e___m_o_d_e___t
│ │ │ │ + * _e_n_u_m_ _s_t_a_t_u_s___t
│ │ │ │ + * _e_n_u_m_ _m_o_v_e___f_l_a_g_s___t
│ │ │ │ + * _c_r_e_a_t_e___t_o_r_r_e_n_t
│ │ │ │ + o _c_r_e_a_t_e___t_o_r_r_e_n_t_(_)
│ │ │ │ + o _g_e_n_e_r_a_t_e_(_)_ _g_e_n_e_r_a_t_e___b_u_f_(_)
│ │ │ │ + o _f_i_l_e_s_(_)
│ │ │ │ + o _s_e_t___c_o_m_m_e_n_t_(_)
│ │ │ │ + o _s_e_t___c_r_e_a_t_o_r_(_)
│ │ │ │ + o _s_e_t___c_r_e_a_t_i_o_n___d_a_t_e_(_)
│ │ │ │ + o _s_e_t___h_a_s_h_(_)
│ │ │ │ + o _s_e_t___h_a_s_h_2_(_)
│ │ │ │ + o _a_d_d___h_t_t_p___s_e_e_d_(_)_ _a_d_d___u_r_l___s_e_e_d_(_)
│ │ │ │ + o _a_d_d___n_o_d_e_(_)
│ │ │ │ + o _a_d_d___t_r_a_c_k_e_r_(_)
│ │ │ │ + o _s_e_t___r_o_o_t___c_e_r_t_(_)
│ │ │ │ + o _p_r_i_v_(_)_ _s_e_t___p_r_i_v_(_)
│ │ │ │ + o _n_u_m___p_i_e_c_e_s_(_)
│ │ │ │ + o _p_i_e_c_e___r_a_n_g_e_(_)
│ │ │ │ + o _f_i_l_e___r_a_n_g_e_(_)
│ │ │ │ + o _f_i_l_e___p_i_e_c_e___r_a_n_g_e_(_)
│ │ │ │ + o _t_o_t_a_l___s_i_z_e_(_)
│ │ │ │ + o _p_i_e_c_e___l_e_n_g_t_h_(_)_ _p_i_e_c_e___s_i_z_e_(_)
│ │ │ │ + o _a_d_d___s_i_m_i_l_a_r___t_o_r_r_e_n_t_(_)_ _a_d_d___c_o_l_l_e_c_t_i_o_n_(_)
│ │ │ │ + * _a_d_d___f_i_l_e_s_(_)
│ │ │ │ + * _s_e_t___p_i_e_c_e___h_a_s_h_e_s_(_)
│ │ │ │ + * _a_ _w_o_r_d_ _o_f_ _c_a_u_t_i_o_n
│ │ │ │ + * _p_l_u_g_i_n_-_i_n_t_e_r_f_a_c_e
│ │ │ │ + * _c_u_s_t_o_m_ _a_l_e_r_t_s
│ │ │ │ + * _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e
│ │ │ │ + * _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e
│ │ │ │ + * _p_l_u_g_i_n
│ │ │ │ + o _i_m_p_l_e_m_e_n_t_e_d___f_e_a_t_u_r_e_s_(_)
│ │ │ │ + o _n_e_w___t_o_r_r_e_n_t_(_)
│ │ │ │ + o _a_d_d_e_d_(_)
│ │ │ │ + o _a_b_o_r_t_(_)
│ │ │ │ + o _o_n___d_h_t___r_e_q_u_e_s_t_(_)
│ │ │ │ + o _o_n___a_l_e_r_t_(_)
│ │ │ │ + o _o_n___u_n_k_n_o_w_n___t_o_r_r_e_n_t_(_)
│ │ │ │ + o _o_n___t_i_c_k_(_)
│ │ │ │ + o _g_e_t___u_n_c_h_o_k_e___p_r_i_o_r_i_t_y_(_)
│ │ │ │ + o _l_o_a_d___s_t_a_t_e_(_)
│ │ │ │ + * _t_o_r_r_e_n_t___p_l_u_g_i_n
│ │ │ │ + o _n_e_w___c_o_n_n_e_c_t_i_o_n_(_)
│ │ │ │ + o _o_n___p_i_e_c_e___f_a_i_l_e_d_(_)_ _o_n___p_i_e_c_e___p_a_s_s_(_)
│ │ │ │ + o _t_i_c_k_(_)
│ │ │ │ + o _o_n___p_a_u_s_e_(_)_ _o_n___r_e_s_u_m_e_(_)
│ │ │ │ + o _o_n___f_i_l_e_s___c_h_e_c_k_e_d_(_)
│ │ │ │ + o _o_n___s_t_a_t_e_(_)
│ │ │ │ + o _o_n___a_d_d___p_e_e_r_(_)
│ │ │ │ + * _p_e_e_r___p_l_u_g_i_n
│ │ │ │ + o _t_y_p_e_(_)
│ │ │ │ + o _a_d_d___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ + o _o_n___d_i_s_c_o_n_n_e_c_t_(_)
│ │ │ │ + o _o_n___c_o_n_n_e_c_t_e_d_(_)
│ │ │ │ + o _o_n___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ + o _o_n___e_x_t_e_n_s_i_o_n___h_a_n_d_s_h_a_k_e_(_)
│ │ │ │ + o _o_n___c_h_o_k_e_(_)_ _o_n___d_o_n_t___h_a_v_e_(_)_ _o_n___h_a_v_e___a_l_l_(_)_ _o_n___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)
│ │ │ │ + _o_n___u_n_c_h_o_k_e_(_)_ _o_n___a_l_l_o_w_e_d___f_a_s_t_(_)_ _o_n___h_a_v_e_(_)_ _o_n___h_a_v_e___n_o_n_e_(_)_ _o_n___r_e_q_u_e_s_t
│ │ │ │ + _(_)_ _o_n___b_i_t_f_i_e_l_d_(_)_ _o_n___i_n_t_e_r_e_s_t_e_d_(_)
│ │ │ │ + o _o_n___p_i_e_c_e_(_)
│ │ │ │ + o _s_e_n_t___n_o_t___i_n_t_e_r_e_s_t_e_d_(_)_ _s_e_n_t___h_a_v_e_(_)_ _s_e_n_t___i_n_t_e_r_e_s_t_e_d_(_)_ _s_e_n_t___p_i_e_c_e_(_)
│ │ │ │ + _s_e_n_t___u_n_c_h_o_k_e_(_)
│ │ │ │ + o _s_e_n_t___p_a_y_l_o_a_d_(_)
│ │ │ │ + o _c_a_n___d_i_s_c_o_n_n_e_c_t_(_)
│ │ │ │ + o _o_n___e_x_t_e_n_d_e_d_(_)
│ │ │ │ + o _o_n___u_n_k_n_o_w_n___m_e_s_s_a_g_e_(_)
│ │ │ │ + o _o_n___p_i_e_c_e___f_a_i_l_e_d_(_)_ _o_n___p_i_e_c_e___p_a_s_s_(_)
│ │ │ │ + o _t_i_c_k_(_)
│ │ │ │ + o _w_r_i_t_e___r_e_q_u_e_s_t_(_)
│ │ │ │ + * _c_r_y_p_t_o___p_l_u_g_i_n
│ │ │ │ + o _e_n_c_r_y_p_t_(_)
│ │ │ │ + o _d_e_c_r_y_p_t_(_)
│ │ │ │ + * _c_r_e_a_t_e___u_t___p_e_x___p_l_u_g_i_n_(_)
│ │ │ │ + * _c_r_e_a_t_e___s_m_a_r_t___b_a_n___p_l_u_g_i_n_(_)
│ │ │ │ + * _c_r_e_a_t_e___u_t___m_e_t_a_d_a_t_a___p_l_u_g_i_n_(_)
│ │ │ │ + * _i_p___f_i_l_t_e_r
│ │ │ │ + o _e_m_p_t_y_(_)
│ │ │ │ + o _a_d_d___r_u_l_e_(_)
│ │ │ │ + o _a_c_c_e_s_s_(_)
│ │ │ │ + o _e_x_p_o_r_t___f_i_l_t_e_r_(_)
│ │ │ │ + o _e_n_u_m_ _a_c_c_e_s_s___f_l_a_g_s
│ │ │ │ + * _p_o_r_t___f_i_l_t_e_r
│ │ │ │ + o _a_d_d___r_u_l_e_(_)
│ │ │ │ + o _a_c_c_e_s_s_(_)
│ │ │ │ + o _e_n_u_m_ _a_c_c_e_s_s___f_l_a_g_s
│ │ │ │ + * _b_d_e_c_o_d_e___n_o_d_e
│ │ │ │ + o _b_d_e_c_o_d_e___n_o_d_e_(_)
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_(_)_ _b_d_e_c_o_d_e___n_o_d_e_(_)
│ │ │ │ + o _t_y_p_e_(_)
│ │ │ │ + o _b_o_o_l_(_)
│ │ │ │ + o _n_o_n___o_w_n_i_n_g_(_)
│ │ │ │ + o _d_a_t_a___s_e_c_t_i_o_n_(_)_ _d_a_t_a___o_f_f_s_e_t_(_)
│ │ │ │ + o _l_i_s_t___s_t_r_i_n_g___v_a_l_u_e___a_t_(_)_ _l_i_s_t___i_n_t___v_a_l_u_e___a_t_(_)_ _l_i_s_t___a_t_(_)_ _l_i_s_t___s_i_z_e_(_)
│ │ │ │ + o _d_i_c_t___f_i_n_d___s_t_r_i_n_g___v_a_l_u_e_(_)_ _d_i_c_t___f_i_n_d___s_t_r_i_n_g_(_)_ _d_i_c_t___f_i_n_d___i_n_t___v_a_l_u_e_(_)
│ │ │ │ + _d_i_c_t___a_t___n_o_d_e_(_)_ _d_i_c_t___s_i_z_e_(_)_ _d_i_c_t___f_i_n_d___l_i_s_t_(_)_ _d_i_c_t___f_i_n_d_(_)
│ │ │ │ + _d_i_c_t___f_i_n_d___i_n_t_(_)_ _d_i_c_t___a_t_(_)_ _d_i_c_t___f_i_n_d___d_i_c_t_(_)
│ │ │ │ + o _i_n_t___v_a_l_u_e_(_)
│ │ │ │ + o _s_t_r_i_n_g___p_t_r_(_)_ _s_t_r_i_n_g___o_f_f_s_e_t_(_)_ _s_t_r_i_n_g___l_e_n_g_t_h_(_)_ _s_t_r_i_n_g___v_a_l_u_e_(_)
│ │ │ │ + o _c_l_e_a_r_(_)
│ │ │ │ + o _s_w_a_p_(_)
│ │ │ │ + o _r_e_s_e_r_v_e_(_)
│ │ │ │ + o _s_w_i_t_c_h___u_n_d_e_r_l_y_i_n_g___b_u_f_f_e_r_(_)
│ │ │ │ + o _h_a_s___s_o_f_t___e_r_r_o_r_(_)
│ │ │ │ + o _e_n_u_m_ _t_y_p_e___t
│ │ │ │ + * _p_r_i_n_t___e_n_t_r_y_(_)
│ │ │ │ + * _b_d_e_c_o_d_e_(_)
│ │ │ │ + * _s_t_o_r_a_g_e___e_r_r_o_r
│ │ │ │ + o _b_o_o_l_(_)
│ │ │ │ + o _f_i_l_e_(_)
│ │ │ │ + * _p_c_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ + * _u_p_n_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ + * _s_o_c_k_s___c_a_t_e_g_o_r_y_(_)
│ │ │ │ + * _g_z_i_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ + * _i_2_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ + * _b_d_e_c_o_d_e___c_a_t_e_g_o_r_y_(_)
│ │ │ │ + * _l_i_b_t_o_r_r_e_n_t___c_a_t_e_g_o_r_y_(_)
│ │ │ │ + * _h_t_t_p___c_a_t_e_g_o_r_y_(_)
│ │ │ │ + * _e_n_u_m_ _p_c_p___e_r_r_o_r_s
│ │ │ │ + * _e_n_u_m_ _e_r_r_o_r___c_o_d_e___e_n_u_m
│ │ │ │ + * _e_n_u_m_ _s_o_c_k_s___e_r_r_o_r___c_o_d_e
│ │ │ │ + * _e_n_u_m_ _e_r_r_o_r___c_o_d_e___e_n_u_m
│ │ │ │ + * _e_n_u_m_ _i_2_p___e_r_r_o_r___c_o_d_e
│ │ │ │ + * _e_n_u_m_ _e_r_r_o_r___c_o_d_e___e_n_u_m
│ │ │ │ + * _e_n_u_m_ _e_r_r_o_r___c_o_d_e___e_n_u_m
│ │ │ │ + * _e_n_u_m_ _h_t_t_p___e_r_r_o_r_s
│ │ │ │ + * _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s
│ │ │ │ + * _c_l_i_e_n_t___d_a_t_a___t
│ │ │ │ + o _c_l_i_e_n_t___d_a_t_a___t_(_)
│ │ │ │ + o _c_l_i_e_n_t___d_a_t_a___t_(_)
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ + o _T_(_)_ _g_e_t_(_)
│ │ │ │ + o _v_o_i_d_*_(_)_ _c_o_n_s_t_*_(_)_ _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ + * _t_o_r_r_e_n_t___s_t_a_t_u_s
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_=_(_)
│ │ │ │ + o _e_n_u_m_ _s_t_a_t_e___t
│ │ │ │ + * _e_n_t_r_y
│ │ │ │ + o _t_y_p_e_(_)
│ │ │ │ + o _e_n_t_r_y_(_)
│ │ │ │ + o _e_n_t_r_y_(_)
│ │ │ │ + o _e_n_t_r_y_(_)
│ │ │ │ + o _o_p_e_r_a_t_o_r_=_(_)
│ │ │ │ + o _i_n_t_e_g_e_r_(_)_ _d_i_c_t_(_)_ _s_t_r_i_n_g_(_)_ _l_i_s_t_(_)_ _p_r_e_f_o_r_m_a_t_t_e_d_(_)
│ │ │ │ + o _s_w_a_p_(_)
│ │ │ │ + o _o_p_e_r_a_t_o_r_[_]_(_)
│ │ │ │ + o _f_i_n_d___k_e_y_(_)
│ │ │ │ + o _t_o___s_t_r_i_n_g_(_)
│ │ │ │ + o _e_n_u_m_ _d_a_t_a___t_y_p_e
│ │ │ │ + * _b_e_n_c_o_d_e_(_)
│ │ │ │ + * _o_p_e_r_a_t_o_r_<_<_(_)
│ │ │ │ + * _d_h_t___s_t_a_t_e
│ │ │ │ * _d_h_t___s_t_o_r_a_g_e___c_o_u_n_t_e_r_s
│ │ │ │ o _r_e_s_e_t_(_)
│ │ │ │ * _d_h_t___s_t_o_r_a_g_e___i_n_t_e_r_f_a_c_e
│ │ │ │ o _u_p_d_a_t_e___n_o_d_e___i_d_s_(_)
│ │ │ │ o _g_e_t___p_e_e_r_s_(_)
│ │ │ │ o _a_n_n_o_u_n_c_e___p_e_e_r_(_)
│ │ │ │ o _g_e_t___i_m_m_u_t_a_b_l_e___i_t_e_m_(_)
│ │ │ │ o _p_u_t___i_m_m_u_t_a_b_l_e___i_t_e_m_(_)
│ │ │ │ o _g_e_t___m_u_t_a_b_l_e___i_t_e_m___s_e_q_(_)
│ │ │ │ o _g_e_t___m_u_t_a_b_l_e___i_t_e_m_(_)
│ │ │ │ o _p_u_t___m_u_t_a_b_l_e___i_t_e_m_(_)
│ │ │ │ o _g_e_t___i_n_f_o_h_a_s_h_e_s___s_a_m_p_l_e_(_)
│ │ │ │ o _t_i_c_k_(_)
│ │ │ │ o _c_o_u_n_t_e_r_s_(_)
│ │ │ │ - * _d_h_t___s_t_a_t_e
│ │ │ │ - * _s_i_g_n___m_u_t_a_b_l_e___i_t_e_m_(_)
│ │ │ │ * _d_h_t___d_e_f_a_u_l_t___s_t_o_r_a_g_e___c_o_n_s_t_r_u_c_t_o_r_(_)
│ │ │ │ + * _s_i_g_n___m_u_t_a_b_l_e___i_t_e_m_(_)
│ │ │ │ * _a_n_n_o_u_n_c_e___f_l_a_g_s___t
│ │ │ │ - * _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_(_)_ _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a___b_u_f_(_)
│ │ │ │ - * _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e___b_u_f_(_)_ _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_)
│ │ │ │ * _r_e_a_d___r_e_s_u_m_e___d_a_t_a_(_)
│ │ │ │ + * _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a_(_)_ _w_r_i_t_e___r_e_s_u_m_e___d_a_t_a___b_u_f_(_)
│ │ │ │ + * _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_)_ _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e___b_u_f_(_)
│ │ │ │ * _w_r_i_t_e___t_o_r_r_e_n_t___f_l_a_g_s___t
│ │ │ │ * _e_d_2_5_5_1_9___c_r_e_a_t_e___s_e_e_d_(_)
│ │ │ │ * _e_d_2_5_5_1_9___c_r_e_a_t_e___k_e_y_p_a_i_r_(_)
│ │ │ │ * _e_d_2_5_5_1_9___s_i_g_n_(_)
│ │ │ │ * _e_d_2_5_5_1_9___v_e_r_i_f_y_(_)
│ │ │ │ * _e_d_2_5_5_1_9___a_d_d___s_c_a_l_a_r_(_)
│ │ │ │ * _e_d_2_5_5_1_9___k_e_y___e_x_c_h_a_n_g_e_(_)
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ttoorrrreenntt__ssttaattuuss ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___s_t_a_t_u_s_._h_p_p"
│ │ │ │ -holds a snapshot of the status of a torrent, as queried by _t_o_r_r_e_n_t___h_a_n_d_l_e_:_:
│ │ │ │ -_s_t_a_t_u_s_(_).
│ │ │ │ -struct torrent_status
│ │ │ │ -{
│ │ │ │ - bool ooppeerraattoorr==== (torrent_status const& st) const;
│ │ │ │ -
│ │ │ │ - enum state_t
│ │ │ │ - {
│ │ │ │ - checking_files,
│ │ │ │ - downloading_metadata,
│ │ │ │ - downloading,
│ │ │ │ - finished,
│ │ │ │ - seeding,
│ │ │ │ - checking_resume_data,
│ │ │ │ - };
│ │ │ │ -
│ │ │ │ - torrent_handle handle;
│ │ │ │ - error_code errc;
│ │ │ │ - file_index_t eerrrroorr__ffiillee = torrent_status::error_file_none;
│ │ │ │ - static constexpr file_index_t eerrrroorr__ffiillee__nnoonnee {-1};
│ │ │ │ - static constexpr file_index_t eerrrroorr__ffiillee__ssssll__ccttxx {-3};
│ │ │ │ - static constexpr file_index_t eerrrroorr__ffiillee__mmeettaaddaattaa {-4};
│ │ │ │ - static constexpr file_index_t eerrrroorr__ffiillee__eexxcceeppttiioonn {-5};
│ │ │ │ - static constexpr file_index_t eerrrroorr__ffiillee__ppaarrttffiillee {-6};
│ │ │ │ - std::string save_path;
│ │ │ │ - std::string name;
│ │ │ │ - std::weak_ptr torrent_file;
│ │ │ │ - time_duration nneexxtt__aannnnoouunnccee = seconds{0};
│ │ │ │ - std::string current_tracker;
│ │ │ │ - std::int64_t ttoottaall__ddoowwnnllooaadd = 0;
│ │ │ │ - std::int64_t ttoottaall__uuppllooaadd = 0;
│ │ │ │ - std::int64_t ttoottaall__ppaayyllooaadd__ddoowwnnllooaadd = 0;
│ │ │ │ - std::int64_t ttoottaall__ppaayyllooaadd__uuppllooaadd = 0;
│ │ │ │ - std::int64_t ttoottaall__ffaaiilleedd__bbyytteess = 0;
│ │ │ │ - std::int64_t ttoottaall__rreedduunnddaanntt__bbyytteess = 0;
│ │ │ │ - typed_bitfield pieces;
│ │ │ │ - typed_bitfield verified_pieces;
│ │ │ │ - std::int64_t ttoottaall__ddoonnee = 0;
│ │ │ │ - std::int64_t ttoottaall = 0;
│ │ │ │ - std::int64_t ttoottaall__wwaanntteedd__ddoonnee = 0;
│ │ │ │ - std::int64_t ttoottaall__wwaanntteedd = 0;
│ │ │ │ - std::int64_t aallll__ttiimmee__uuppllooaadd = 0;
│ │ │ │ - std::int64_t aallll__ttiimmee__ddoowwnnllooaadd = 0;
│ │ │ │ - std::time_t aaddddeedd__ttiimmee = 0;
│ │ │ │ - std::time_t ccoommpplleetteedd__ttiimmee = 0;
│ │ │ │ - std::time_t llaasstt__sseeeenn__ccoommpplleettee = 0;
│ │ │ │ - storage_mode_t ssttoorraaggee__mmooddee = storage_mode_sparse;
│ │ │ │ - float pprrooggrreessss = 0.f;
│ │ │ │ - int pprrooggrreessss__ppppmm = 0;
│ │ │ │ - queue_position_t qquueeuuee__ppoossiittiioonn {};
│ │ │ │ - int ddoowwnnllooaadd__rraattee = 0;
│ │ │ │ - int uuppllooaadd__rraattee = 0;
│ │ │ │ - int ddoowwnnllooaadd__ppaayyllooaadd__rraattee = 0;
│ │ │ │ - int uuppllooaadd__ppaayyllooaadd__rraattee = 0;
│ │ │ │ - int nnuumm__sseeeeddss = 0;
│ │ │ │ - int nnuumm__ppeeeerrss = 0;
│ │ │ │ - int nnuumm__ccoommpplleettee = -1;
│ │ │ │ - int nnuumm__iinnccoommpplleettee = -1;
│ │ │ │ - int lliisstt__sseeeeddss = 0;
│ │ │ │ - int lliisstt__ppeeeerrss = 0;
│ │ │ │ - int ccoonnnneecctt__ccaannddiiddaatteess = 0;
│ │ │ │ - int nnuumm__ppiieecceess = 0;
│ │ │ │ - int ddiissttrriibbuutteedd__ffuullll__ccooppiieess = 0;
│ │ │ │ - int ddiissttrriibbuutteedd__ffrraaccttiioonn = 0;
│ │ │ │ - float ddiissttrriibbuutteedd__ccooppiieess = 0.f;
│ │ │ │ - int bblloocckk__ssiizzee = 0;
│ │ │ │ - int nnuumm__uuppllooaaddss = 0;
│ │ │ │ - int nnuumm__ccoonnnneeccttiioonnss = 0;
│ │ │ │ - int uuppllooaaddss__lliimmiitt = 0;
│ │ │ │ - int ccoonnnneeccttiioonnss__lliimmiitt = 0;
│ │ │ │ - int uupp__bbaannddwwiiddtthh__qquueeuuee = 0;
│ │ │ │ - int ddoowwnn__bbaannddwwiiddtthh__qquueeuuee = 0;
│ │ │ │ - int sseeeedd__rraannkk = 0;
│ │ │ │ - state_t ssttaattee = checking_resume_data;
│ │ │ │ - bool nneeeedd__ssaavvee__rreessuummee = false;
│ │ │ │ - bool iiss__sseeeeddiinngg = false;
│ │ │ │ - bool iiss__ffiinniisshheedd = false;
│ │ │ │ - bool hhaass__mmeettaaddaattaa = false;
│ │ │ │ - bool hhaass__iinnccoommiinngg = false;
│ │ │ │ - bool mmoovviinngg__ssttoorraaggee = false;
│ │ │ │ - bool aannnnoouunncciinngg__ttoo__ttrraacckkeerrss = false;
│ │ │ │ - bool aannnnoouunncciinngg__ttoo__llssdd = false;
│ │ │ │ - bool aannnnoouunncciinngg__ttoo__ddhhtt = false;
│ │ │ │ - info_hash_t info_hashes;
│ │ │ │ - time_point last_upload;
│ │ │ │ - time_point last_download;
│ │ │ │ - seconds active_duration;
│ │ │ │ - seconds finished_duration;
│ │ │ │ - seconds seeding_duration;
│ │ │ │ - torrent_flags_t ffllaaggss {};
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ooppeerraattoorr====(()) **********
│ │ │ │ -bool ooppeerraattoorr==== (torrent_status const& st) const;
│ │ │ │ -compares if the torrent status objects come from the same torrent. i.e. only
│ │ │ │ -the _t_o_r_r_e_n_t___h_a_n_d_l_e field is compared.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennuumm ssttaattee__tt **********
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___s_t_a_t_u_s_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|checking_files |1 |The torrent has not started its download yet, and |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_s_ _c_u_r_r_e_n_t_l_y_ _c_h_e_c_k_i_n_g_ _e_x_i_s_t_i_n_g_ _f_i_l_e_s_._ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The torrent is trying to download metadata from |
│ │ │ │ -|downloading_metadata|2 |peers. This implies the ut_metadata extension is |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_ _u_s_e_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The torrent is being downloaded. This is the state|
│ │ │ │ -|downloading |3 |most torrents will be in most of the time. The |
│ │ │ │ -| | |progress meter will tell how much of the files |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_a_t_ _h_a_s_ _b_e_e_n_ _d_o_w_n_l_o_a_d_e_d_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |In this state the torrent has finished downloading|
│ │ │ │ -|finished |4 |but still doesn't have the entire torrent. i.e. |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_o_m_e_ _p_i_e_c_e_s_ _a_r_e_ _f_i_l_t_e_r_e_d_ _a_n_d_ _w_o_n_'_t_ _g_e_t_ _d_o_w_n_l_o_a_d_e_d_.|
│ │ │ │ -|seeding |5 |In this state the torrent has finished downloading|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_n_d_ _i_s_ _a_ _p_u_r_e_ _s_e_e_d_e_r_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |If the torrent was started in full allocation |
│ │ │ │ -| | |mode, this indicates that the (disk) storage for |
│ │ │ │ -| | |the torrent is allocated. The torrent is currently|
│ │ │ │ -|checking_resume_data|7 |checking the fast resume data and comparing it to |
│ │ │ │ -| | |the files on disk. This is typically completed in |
│ │ │ │ -| | |a fraction of a second, but if you add a large |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_n_u_m_b_e_r_ _o_f_ _t_o_r_r_e_n_t_s_ _a_t_ _o_n_c_e_,_ _t_h_e_y_ _w_i_l_l_ _q_u_e_u_e_ _u_p_._ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - handle
│ │ │ │ - a handle to the torrent whose status the object represents.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - errc
│ │ │ │ - may be set to an error code describing why the torrent was paused, in
│ │ │ │ - case it was paused by an error. If the torrent is not paused or if it's
│ │ │ │ - paused but not because of an error, this error_code is not set. if the
│ │ │ │ - error is attributed specifically to a file, error_file is set to the
│ │ │ │ - index of that file in the .torrent file.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - error_file
│ │ │ │ - if the torrent is stopped because of an disk I/O error, this field
│ │ │ │ - contains the index of the file in the torrent that encountered the error.
│ │ │ │ - If the error did not originate in a file in the torrent, there are a few
│ │ │ │ - special values this can be set to: error_file_none, error_file_ssl_ctx,
│ │ │ │ - error_file_exception, error_file_partfile or error_file_metadata;
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - error_file_none
│ │ │ │ - special values for error_file to describe which file or component
│ │ │ │ - encountered the error (errc). the error did not occur on a file
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - error_file_ssl_ctx
│ │ │ │ - the error occurred setting up the SSL context
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - error_file_metadata
│ │ │ │ - the error occurred while loading the metadata for the torrent
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - error_file_exception
│ │ │ │ - there was a serious error reported in this torrent. The error code or a
│ │ │ │ - torrent log _a_l_e_r_t may provide more information.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - error_file_partfile
│ │ │ │ - the error occurred with the partfile
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - save_path
│ │ │ │ - the path to the directory where this torrent's files are stored. It's
│ │ │ │ - typically the path as was given to _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_) or _a_d_d___t_o_r_r_e_n_t_(_)
│ │ │ │ - when this torrent was started. This field is only included if the torrent
│ │ │ │ - status is queried with torrent_handle::query_save_path.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - name
│ │ │ │ - the name of the torrent. Typically this is derived from the .torrent
│ │ │ │ - file. In case the torrent was started without metadata, and hasn't
│ │ │ │ - completely received it yet, it returns the name given to it when added to
│ │ │ │ - the _s_e_s_s_i_o_n. See session::add_torrent. This field is only included if the
│ │ │ │ - torrent status is queried with torrent_handle::query_name.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - torrent_file
│ │ │ │ - set to point to the torrent_info object for this torrent. It's only
│ │ │ │ - included if the torrent status is queried with torrent_handle::
│ │ │ │ - query_torrent_file.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - next_announce
│ │ │ │ - the time until the torrent will announce itself to the tracker.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - current_tracker
│ │ │ │ - the URL of the last working tracker. If no tracker request has been
│ │ │ │ - successful yet, it's set to an empty string.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total_download total_upload
│ │ │ │ - the number of bytes downloaded and uploaded to all peers, accumulated,
│ │ │ │ - tthhiiss sseessssiioonn only. The _s_e_s_s_i_o_n is considered to restart when a torrent is
│ │ │ │ - paused and restarted again. When a torrent is paused, these _c_o_u_n_t_e_r_s are
│ │ │ │ - reset to 0. If you want complete, persistent, stats, see all_time_upload
│ │ │ │ - and all_time_download.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total_payload_download total_payload_upload
│ │ │ │ - counts the amount of bytes send and received this _s_e_s_s_i_o_n, but only the
│ │ │ │ - actual payload data (i.e the interesting data), these _c_o_u_n_t_e_r_s ignore any
│ │ │ │ - protocol overhead. The _s_e_s_s_i_o_n is considered to restart when a torrent is
│ │ │ │ - paused and restarted again. When a torrent is paused, these _c_o_u_n_t_e_r_s are
│ │ │ │ - reset to 0.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total_failed_bytes
│ │ │ │ - the number of bytes that has been downloaded and that has failed the
│ │ │ │ - piece hash test. In other words, this is just how much crap that has been
│ │ │ │ - downloaded since the torrent was last started. If a torrent is paused and
│ │ │ │ - then restarted again, this counter will be reset.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total_redundant_bytes
│ │ │ │ - the number of bytes that has been downloaded even though that data
│ │ │ │ - already was downloaded. The reason for this is that in some situations
│ │ │ │ - the same data can be downloaded by mistake. When libtorrent sends
│ │ │ │ - requests to a peer, and the peer doesn't send a response within a certain
│ │ │ │ - timeout, libtorrent will re-request that block. Another situation when
│ │ │ │ - libtorrent may re-request blocks is when the requests it sends out are
│ │ │ │ - not replied in FIFO-order (it will re-request blocks that are skipped by
│ │ │ │ - an out of order block). This is supposed to be as low as possible. This
│ │ │ │ - only counts bytes since the torrent was last started. If a torrent is
│ │ │ │ - paused and then restarted again, this counter will be reset.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - pieces
│ │ │ │ - a bitmask that represents which pieces we have (set to true) and the
│ │ │ │ - pieces we don't have. It's a pointer and may be set to 0 if the torrent
│ │ │ │ - isn't downloading or seeding.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - verified_pieces
│ │ │ │ - a bitmask representing which pieces has had their hash checked. This only
│ │ │ │ - applies to torrents in sseeeedd mmooddee. If the torrent is not in seed mode,
│ │ │ │ - this bitmask may be empty.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total_done
│ │ │ │ - the total number of bytes of the file(s) that we have. All this does not
│ │ │ │ - necessarily has to be downloaded during this _s_e_s_s_i_o_n (that's
│ │ │ │ - total_payload_download).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total
│ │ │ │ - the total number of bytes to download for this torrent. This may be less
│ │ │ │ - than the size of the torrent in case there are pad files. This number
│ │ │ │ - only counts bytes that will actually be requested from peers.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total_wanted_done
│ │ │ │ - the number of bytes we have downloaded, only counting the pieces that we
│ │ │ │ - actually want to download. i.e. excluding any pieces that we have but
│ │ │ │ - have priority 0 (i.e. not wanted). Once a torrent becomes seed, any
│ │ │ │ - piece- and file priorities are forgotten and all bytes are considered
│ │ │ │ - "wanted".
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total_wanted
│ │ │ │ - The total number of bytes we want to download. This may be smaller than
│ │ │ │ - the total torrent size in case any pieces are prioritized to 0, i.e. not
│ │ │ │ - wanted. Once a torrent becomes seed, any piece- and file priorities are
│ │ │ │ - forgotten and all bytes are considered "wanted".
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - all_time_upload all_time_download
│ │ │ │ - are accumulated upload and download payload byte _c_o_u_n_t_e_r_s. They are saved
│ │ │ │ - in and restored from resume data to keep totals across sessions.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - added_time
│ │ │ │ - the posix-time when this torrent was added. i.e. what time(nullptr)
│ │ │ │ - returned at the time.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - completed_time
│ │ │ │ - the posix-time when this torrent was finished. If the torrent is not yet
│ │ │ │ - finished, this is 0.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - last_seen_complete
│ │ │ │ - the time when we, or one of our peers, last saw a complete copy of this
│ │ │ │ - torrent.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - storage_mode
│ │ │ │ - The allocation mode for the torrent. See _s_t_o_r_a_g_e___m_o_d_e___t for the options.
│ │ │ │ - For more information, see _s_t_o_r_a_g_e_ _a_l_l_o_c_a_t_i_o_n.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - progress
│ │ │ │ - a value in the range [0, 1], that represents the progress of the
│ │ │ │ - torrent's current task. It may be checking files or downloading.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - progress_ppm
│ │ │ │ - progress parts per million (progress * 1000000) when disabling floating
│ │ │ │ - point operations, this is the only option to query progress
│ │ │ │ - reflects the same value as progress, but instead in a range [0, 1000000]
│ │ │ │ - (ppm = parts per million). When floating point operations are disabled,
│ │ │ │ - this is the only alternative to the floating point value in progress.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - queue_position
│ │ │ │ - the position this torrent has in the download queue. If the torrent is a
│ │ │ │ - seed or finished, this is -1.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - download_rate upload_rate
│ │ │ │ - the total rates for all peers for this torrent. These will usually have
│ │ │ │ - better precision than summing the rates from all peers. The rates are
│ │ │ │ - given as the number of bytes per second.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - download_payload_rate upload_payload_rate
│ │ │ │ - the total transfer rate of payload only, not counting protocol chatter.
│ │ │ │ - This might be slightly smaller than the other rates, but if projected
│ │ │ │ - over a long time (e.g. when calculating ETA:s) the difference may be
│ │ │ │ - noticeable.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - num_seeds
│ │ │ │ - the number of peers that are seeding that this client is currently
│ │ │ │ - connected to.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - num_peers
│ │ │ │ - the number of peers this torrent currently is connected to. Peer
│ │ │ │ - connections that are in the half-open state (is attempting to connect) or
│ │ │ │ - are queued for later connection attempt do not count. Although they are
│ │ │ │ - visible in the peer list when you call _g_e_t___p_e_e_r___i_n_f_o_(_).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - num_complete num_incomplete
│ │ │ │ - if the tracker sends scrape info in its announce reply, these fields will
│ │ │ │ - be set to the total number of peers that have the whole file and the
│ │ │ │ - total number of peers that are still downloading. set to -1 if the
│ │ │ │ - tracker did not send any scrape data in its announce reply.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - list_seeds list_peers
│ │ │ │ - the number of seeds in our peer list and the total number of peers
│ │ │ │ - (including seeds). We are not necessarily connected to all the peers in
│ │ │ │ - our peer list. This is the number of peers we know of in total, including
│ │ │ │ - banned peers and peers that we have failed to connect to.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - connect_candidates
│ │ │ │ - the number of peers in this torrent's peer list that is a candidate to be
│ │ │ │ - connected to. i.e. It has fewer connect attempts than the max fail count,
│ │ │ │ - it is not a seed if we are a seed, it is not banned etc. If this is 0, it
│ │ │ │ - means we don't know of any more peers that we can try.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - num_pieces
│ │ │ │ - the number of pieces that has been downloaded. It is equivalent to: std::
│ │ │ │ - accumulate(pieces->begin(), pieces->end()). So you don't have to count
│ │ │ │ - yourself. This can be used to see if anything has updated since last time
│ │ │ │ - if you want to keep a graph of the pieces up to date. Note that these
│ │ │ │ - pieces have not necessarily been written to disk yet, and there is a risk
│ │ │ │ - the write to disk will fail.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - distributed_full_copies
│ │ │ │ - the number of distributed copies of the torrent. Note that one copy may
│ │ │ │ - be spread out among many peers. It tells how many copies there are
│ │ │ │ - currently of the rarest piece(s) among the peers this client is connected
│ │ │ │ - to.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - distributed_fraction
│ │ │ │ - tells the share of pieces that have more copies than the rarest piece(s).
│ │ │ │ - Divide this number by 1000 to get the fraction.
│ │ │ │ - For example, if distributed_full_copies is 2 and distributed_fraction is
│ │ │ │ - 500, it means that the rarest pieces have only 2 copies among the peers
│ │ │ │ - this torrent is connected to, and that 50% of all the pieces have more
│ │ │ │ - than two copies.
│ │ │ │ - If we are a seed, the piece picker is deallocated as an optimization, and
│ │ │ │ - piece availability is no longer tracked. In this case the distributed
│ │ │ │ - copies members are set to -1.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - distributed_copies
│ │ │ │ - the number of distributed copies of the file. note that one copy may be
│ │ │ │ - spread out among many peers. This is a floating point representation of
│ │ │ │ - the distributed copies.
│ │ │ │ - the integer part tells how many copies
│ │ │ │ - there are of the rarest piece(s)
│ │ │ │ - the fractional part tells the fraction of pieces that
│ │ │ │ - have more copies than the rarest piece(s).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - block_size
│ │ │ │ - the size of a block, in bytes. A block is a sub piece, it is the number
│ │ │ │ - of bytes that each piece request asks for and the number of bytes that
│ │ │ │ - each bit in the partial_piece_info's bitset represents, see
│ │ │ │ - _g_e_t___d_o_w_n_l_o_a_d___q_u_e_u_e_(_). This is typically 16 kB, but it may be smaller, if
│ │ │ │ - the pieces are smaller.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - num_uploads
│ │ │ │ - the number of unchoked peers in this torrent.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - num_connections
│ │ │ │ - the number of peer connections this torrent has, including half-open
│ │ │ │ - connections that hasn't completed the bittorrent handshake yet. This is
│ │ │ │ - always >= num_peers.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - uploads_limit
│ │ │ │ - the set limit of upload slots (unchoked peers) for this torrent.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - connections_limit
│ │ │ │ - the set limit of number of connections for this torrent.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - up_bandwidth_queue down_bandwidth_queue
│ │ │ │ - the number of peers in this torrent that are waiting for more bandwidth
│ │ │ │ - quota from the torrent rate limiter. This can determine if the rate you
│ │ │ │ - get from this torrent is bound by the torrents limit or not. If there is
│ │ │ │ - no limit set on this torrent, the peers might still be waiting for
│ │ │ │ - bandwidth quota from the global limiter, but then they are counted in the
│ │ │ │ - session_status object.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - seed_rank
│ │ │ │ - A rank of how important it is to seed the torrent, it is used to
│ │ │ │ - determine which torrents to seed and which to queue. It is based on the
│ │ │ │ - peer to seed ratio from the tracker scrape. For more information, see
│ │ │ │ - _q_u_e_u_i_n_g. Higher value means more important to seed
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - state
│ │ │ │ - the main state the torrent is in. See _t_o_r_r_e_n_t___s_t_a_t_u_s_:_:_s_t_a_t_e___t.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - need_save_resume
│ │ │ │ - true if this torrent has unsaved changes to its download state and
│ │ │ │ - statistics since the last resume data was saved.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - is_seeding
│ │ │ │ - true if all pieces have been downloaded.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - is_finished
│ │ │ │ - true if all pieces that have a priority > 0 are downloaded. There is only
│ │ │ │ - a distinction between finished and seeding if some pieces or files have
│ │ │ │ - been set to priority 0, i.e. are not downloaded.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - has_metadata
│ │ │ │ - true if this torrent has metadata (either it was started from a .torrent
│ │ │ │ - file or the metadata has been downloaded). The only scenario where this
│ │ │ │ - can be false is when the torrent was started torrent-less (i.e. with just
│ │ │ │ - an info-hash and tracker ip, a magnet link for instance).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - has_incoming
│ │ │ │ - true if there has ever been an incoming connection attempt to this
│ │ │ │ - torrent.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - moving_storage
│ │ │ │ - this is true if this torrent's storage is currently being moved from one
│ │ │ │ - location to another. This may potentially be a long operation if a large
│ │ │ │ - file ends up being copied from one drive to another.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - announcing_to_trackers announcing_to_lsd announcing_to_dht
│ │ │ │ - these are set to true if this torrent is allowed to announce to the
│ │ │ │ - respective peer source. Whether they are true or false is determined by
│ │ │ │ - the queue logic/auto manager. Torrents that are not auto managed will
│ │ │ │ - always be allowed to announce to all peer sources.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - info_hashes
│ │ │ │ - the info-hash for this torrent
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - last_upload last_download
│ │ │ │ - the timestamps of the last time this torrent uploaded or downloaded
│ │ │ │ - payload to any peer.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - active_duration finished_duration seeding_duration
│ │ │ │ - these are cumulative _c_o_u_n_t_e_r_s of for how long the torrent has been in
│ │ │ │ - different states. active means not paused and added to _s_e_s_s_i_o_n. Whether
│ │ │ │ - it has found any peers or not is not relevant. finished means all
│ │ │ │ - selected files/pieces were downloaded and available to other peers (this
│ │ │ │ - is always a subset of active time). seeding means all files/pieces were
│ │ │ │ - downloaded and available to peers. Being available to peers does not
│ │ │ │ - imply there are other peers asking for the payload.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - flags
│ │ │ │ - reflects several of the torrent's flags. For more information, see
│ │ │ │ - torrent_handle::flags().
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ wweebb__sseeeedd__eennttrryy ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___i_n_f_o_._h_p_p"
│ │ │ │ -the _w_e_b___s_e_e_d___e_n_t_r_y holds information about a web seed (also known as URL seed
│ │ │ │ -or HTTP seed). It is essentially a URL with some state associated with it. For
│ │ │ │ -more information, see _B_E_P_ _1_7 and _B_E_P_ _1_9.
│ │ │ │ -struct web_seed_entry
│ │ │ │ +************ hhaasshheerr ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_h_a_s_h_e_r_._h_p_p"
│ │ │ │ +this is a SHA-1 hash class.
│ │ │ │ +You use it by first instantiating it, then call update() to feed it with data.
│ │ │ │ +i.e. you don't have to keep the entire buffer of which you want to create the
│ │ │ │ +hash in memory. You can feed the _h_a_s_h_e_r parts of it at a time. When You have
│ │ │ │ +fed the _h_a_s_h_e_r with all the data, you call final() and it will return the sha1-
│ │ │ │ +hash of the data.
│ │ │ │ +The constructor that takes a char const* and an integer will construct the sha1
│ │ │ │ +context and feed it the data passed in.
│ │ │ │ +If you want to reuse the _h_a_s_h_e_r 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
│ │ │ │ {
│ │ │ │ - bool ooppeerraattoorr==== (web_seed_entry const& e) const;
│ │ │ │ - bool ooppeerraattoorr<< (web_seed_entry const& e) const;
│ │ │ │ -
│ │ │ │ - enum type_t
│ │ │ │ - {
│ │ │ │ - url_seed,
│ │ │ │ - http_seed,
│ │ │ │ - };
│ │ │ │ -
│ │ │ │ - std::string url;
│ │ │ │ - std::string auth;
│ │ │ │ - headers_t extra_headers;
│ │ │ │ - std::uint8_t type;
│ │ │ │ + hhaasshheerr ();
│ │ │ │ + hhaasshheerr (char const* data, int len);
│ │ │ │ + explicit hhaasshheerr (span data);
│ │ │ │ + hhaasshheerr (hasher const&);
│ │ │ │ + hasher& ooppeerraattoorr== (hasher const&) &;
│ │ │ │ + hasher& uuppddaattee (char const* data, int len);
│ │ │ │ + hasher& uuppddaattee (span data);
│ │ │ │ + sha1_hash ffiinnaall ();
│ │ │ │ + void rreesseett ();
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ooppeerraattoorr====(()) **********
│ │ │ │ -bool ooppeerraattoorr==== (web_seed_entry const& e) const;
│ │ │ │ -URL and type comparison
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ooppeerraattoorr<<(()) **********
│ │ │ │ -bool ooppeerraattoorr<< (web_seed_entry const& e) const;
│ │ │ │ -URL and type less-than comparison
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennuumm ttyyppee__tt **********
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___i_n_f_o_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_u_r_l___s_e_e_d_ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_h_t_t_p___s_e_e_d_|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - url
│ │ │ │ - The URL of the web seed
│ │ │ │ +********** hhaasshheerr(()) ooppeerraattoorr==(()) **********
│ │ │ │ +hhaasshheerr (char const* data, int len);
│ │ │ │ +explicit hhaasshheerr (span data);
│ │ │ │ +hhaasshheerr (hasher const&);
│ │ │ │ +hasher& ooppeerraattoorr== (hasher const&) &;
│ │ │ │ +this is the same as default constructing followed by a call to update(data,
│ │ │ │ +len).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - auth
│ │ │ │ - Optional authentication. If set, this string is sent verbatim as the
│ │ │ │ - value of the HTTP Authorization header, and it overrides any credentials
│ │ │ │ - embedded in the URL. It is not transformed in any way, so it must be the
│ │ │ │ - complete header value. For HTTP basic authentication that means "Basic "
│ │ │ │ - followed by the base64 encoding of username:password. For security, this
│ │ │ │ - value (as well as any credentials embedded in the URL as "username:
│ │ │ │ - password@host") is only sent to the origin of the web seed URL. If the
│ │ │ │ - web seed responds with a redirect to a different origin (a different
│ │ │ │ - scheme, host or port), it is nnoott forwarded to the new origin.
│ │ │ │ +********** uuppddaattee(()) **********
│ │ │ │ +hasher& uuppddaattee (char const* data, int len);
│ │ │ │ +hasher& uuppddaattee (span data);
│ │ │ │ +append the following bytes to what is being hashed
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - extra_headers
│ │ │ │ - Any extra HTTP headers that need to be passed to the web seed. Warning:
│ │ │ │ - unlike auth, these headers are sent verbatim with every request,
│ │ │ │ - including requests to a different origin that the web seed may redirect
│ │ │ │ - to. Do not put sensitive credentials (such as an Authorization or Cookie
│ │ │ │ - header) here unless you trust every host the web seed might redirect to.
│ │ │ │ +********** ffiinnaall(()) **********
│ │ │ │ +sha1_hash ffiinnaall ();
│ │ │ │ +returns the SHA-1 digest of the buffers previously passed to _u_p_d_a_t_e_(_) and the
│ │ │ │ +_h_a_s_h_e_r constructor.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - type
│ │ │ │ - The type of web seed (see _t_y_p_e___t)
│ │ │ │ +********** rreesseett(()) **********
│ │ │ │ +void rreesseett ();
│ │ │ │ +restore the _h_a_s_h_e_r state to be as if the _h_a_s_h_e_r has just been default
│ │ │ │ +constructed.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ llooaadd__ttoorrrreenntt__lliimmiittss ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___i_n_f_o_._h_p_p"
│ │ │ │ -this object holds configuration options for limits to use when loading
│ │ │ │ -torrents. They are meant to prevent loading potentially malicious torrents that
│ │ │ │ -cause excessive memory allocations.
│ │ │ │ -struct load_torrent_limits
│ │ │ │ +************ hhaasshheerr225566 ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_h_a_s_h_e_r_._h_p_p"
│ │ │ │ +class hasher256
│ │ │ │ {
│ │ │ │ - int mmaaxx__bbuuffffeerr__ssiizzee = 10000000;
│ │ │ │ - int mmaaxx__ppiieecceess = 0x200000;
│ │ │ │ - int mmaaxx__ddeeccooddee__ddeepptthh = 100;
│ │ │ │ - int mmaaxx__ddeeccooddee__ttookkeennss = 3000000;
│ │ │ │ + hhaasshheerr225566 ();
│ │ │ │ + hhaasshheerr225566 (hasher256 const&);
│ │ │ │ + hasher256& ooppeerraattoorr== (hasher256 const&) &;
│ │ │ │ + explicit hhaasshheerr225566 (span data);
│ │ │ │ + hhaasshheerr225566 (char const* data, int len);
│ │ │ │ + hasher256& uuppddaattee (span data);
│ │ │ │ + hasher256& uuppddaattee (char const* data, int len);
│ │ │ │ + sha256_hash ffiinnaall ();
│ │ │ │ + void rreesseett ();
│ │ │ │ + ~~hhaasshheerr225566 ();
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - max_buffer_size
│ │ │ │ - the max size of a .torrent file to load into RAM
│ │ │ │ +********** ooppeerraattoorr==(()) hhaasshheerr225566(()) **********
│ │ │ │ +hhaasshheerr225566 (hasher256 const&);
│ │ │ │ +hasher256& ooppeerraattoorr== (hasher256 const&) &;
│ │ │ │ +explicit hhaasshheerr225566 (span data);
│ │ │ │ +hhaasshheerr225566 (char const* data, int len);
│ │ │ │ +this is the same as default constructing followed by a call to update(data,
│ │ │ │ +len).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - max_pieces
│ │ │ │ - the max number of pieces allowed in the torrent
│ │ │ │ +********** uuppddaattee(()) **********
│ │ │ │ +hasher256& uuppddaattee (span data);
│ │ │ │ +hasher256& uuppddaattee (char const* data, int len);
│ │ │ │ +append the following bytes to what is being hashed
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - max_decode_depth
│ │ │ │ - the max recursion depth in the bdecoded structure
│ │ │ │ +********** ffiinnaall(()) **********
│ │ │ │ +sha256_hash ffiinnaall ();
│ │ │ │ +returns the SHA-1 digest of the buffers previously passed to _u_p_d_a_t_e_(_) and the
│ │ │ │ +_h_a_s_h_e_r constructor.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - max_decode_tokens
│ │ │ │ - the max number of bdecode tokens
│ │ │ │ +********** rreesseett(()) **********
│ │ │ │ +void rreesseett ();
│ │ │ │ +restore the _h_a_s_h_e_r state to be as if the _h_a_s_h_e_r has just been default
│ │ │ │ +constructed.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ttoorrrreenntt__iinnffoo ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___i_n_f_o_._h_p_p"
│ │ │ │ -the _t_o_r_r_e_n_t___i_n_f_o class holds the information found in a .torrent file.
│ │ │ │ -class torrent_info
│ │ │ │ +************ bbiittffiieelldd ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_b_i_t_f_i_e_l_d_._h_p_p"
│ │ │ │ +The _b_i_t_f_i_e_l_d type stores any number of bits as a _b_i_t_f_i_e_l_d in a heap allocated
│ │ │ │ +array.
│ │ │ │ +struct bitfield
│ │ │ │ {
│ │ │ │ - ttoorrrreenntt__iinnffoo (char const* buffer, int size);
│ │ │ │ - ttoorrrreenntt__iinnffoo (std::string const& filename, load_torrent_limits const& cfg);
│ │ │ │ - ttoorrrreenntt__iinnffoo (bdecode_node const& torrent_file, error_code& ec);
│ │ │ │ - ttoorrrreenntt__iinnffoo (span buffer, load_torrent_limits const& cfg,
│ │ │ │ -from_span_t);
│ │ │ │ - ttoorrrreenntt__iinnffoo (std::string const& filename, error_code& ec);
│ │ │ │ - ttoorrrreenntt__iinnffoo (span buffer, error_code& ec, from_span_t);
│ │ │ │ - explicit ttoorrrreenntt__iinnffoo (std::string const& filename);
│ │ │ │ - explicit ttoorrrreenntt__iinnffoo (span buffer, from_span_t);
│ │ │ │ - ttoorrrreenntt__iinnffoo (torrent_info const& t);
│ │ │ │ - ttoorrrreenntt__iinnffoo (char const* buffer, int size, error_code& ec);
│ │ │ │ - explicit ttoorrrreenntt__iinnffoo (bdecode_node const& torrent_file);
│ │ │ │ - ttoorrrreenntt__iinnffoo (bdecode_node const& torrent_file, load_torrent_limits const&
│ │ │ │ -cfg);
│ │ │ │ - explicit ttoorrrreenntt__iinnffoo (info_hash_t const& info_hash);
│ │ │ │ - ~~ttoorrrreenntt__iinnffoo ();
│ │ │ │ - file_storage const& ffiilleess () const;
│ │ │ │ - file_storage const& oorriigg__ffiilleess () const;
│ │ │ │ - void rreennaammee__ffiillee (file_index_t index, std::string const& new_filename);
│ │ │ │ - void rreemmaapp__ffiilleess (file_storage const& f);
│ │ │ │ - std::vector const& ttrraacckkeerrss () const;
│ │ │ │ - void aadddd__ttrraacckkeerr (std::string const& url, int tier = 0);
│ │ │ │ - void cclleeaarr__ttrraacckkeerrss ();
│ │ │ │ - void aadddd__ttrraacckkeerr (std::string const& url, int tier
│ │ │ │ - , announce_entry::tracker_source source);
│ │ │ │ - std::vector ccoolllleeccttiioonnss () const;
│ │ │ │ - std::vector ssiimmiillaarr__ttoorrrreennttss () const;
│ │ │ │ - void aadddd__hhttttpp__sseeeedd (std::string const& url
│ │ │ │ - , std::string const& extern_auth = std::string()
│ │ │ │ - , web_seed_entry::headers_t const& extra_headers = web_seed_entry::
│ │ │ │ -headers_t());
│ │ │ │ - void sseett__wweebb__sseeeeddss (std::vector seeds);
│ │ │ │ - void aadddd__uurrll__sseeeedd (std::string const& url
│ │ │ │ - , std::string const& extern_auth = std::string()
│ │ │ │ - , web_seed_entry::headers_t const& ext_headers = web_seed_entry::
│ │ │ │ -headers_t());
│ │ │ │ - std::vector const& wweebb__sseeeeddss () const;
│ │ │ │ - std::int64_t ttoottaall__ssiizzee () const;
│ │ │ │ - int nnuumm__ppiieecceess () const;
│ │ │ │ - int ppiieeccee__lleennggtthh () const;
│ │ │ │ - int bblloocckkss__ppeerr__ppiieeccee () const;
│ │ │ │ - piece_index_t llaasstt__ppiieeccee () const;
│ │ │ │ - index_range ppiieeccee__rraannggee () const;
│ │ │ │ - piece_index_t eenndd__ppiieeccee () const;
│ │ │ │ - sha1_hash iinnffoo__hhaasshh () const noexcept;
│ │ │ │ - info_hash_t const& iinnffoo__hhaasshheess () const;
│ │ │ │ - bool vv22 () const;
│ │ │ │ - bool vv11 () const;
│ │ │ │ - int nnuumm__ffiilleess () const;
│ │ │ │ - std::vector mmaapp__bblloocckk (piece_index_t const piece
│ │ │ │ - , std::int64_t offset, int size) const;
│ │ │ │ - peer_request mmaapp__ffiillee (file_index_t const file, std::int64_t offset, int
│ │ │ │ -size) const;
│ │ │ │ - string_view ssssll__cceerrtt () const;
│ │ │ │ - bool iiss__vvaalliidd () const;
│ │ │ │ - bool pprriivv () const;
│ │ │ │ - bool iiss__ii22pp () const;
│ │ │ │ - int ppiieeccee__ssiizzee (piece_index_t index) const;
│ │ │ │ - int ppiieeccee__ssiizzee__ffoorr__rreeqq (piece_index_t index) const;
│ │ │ │ - sha1_hash hhaasshh__ffoorr__ppiieeccee (piece_index_t index) const;
│ │ │ │ - char const* hhaasshh__ffoorr__ppiieeccee__ppttrr (piece_index_t const index) const;
│ │ │ │ - bool iiss__llooaaddeedd () const;
│ │ │ │ - const std::string& nnaammee () const;
│ │ │ │ - std::time_t ccrreeaattiioonn__ddaattee () const;
│ │ │ │ - const std::string& ccrreeaattoorr () const;
│ │ │ │ - const std::string& ccoommmmeenntt () const;
│ │ │ │ - std::vector> const& nnooddeess () const;
│ │ │ │ - void aadddd__nnooddee (std::pair const& node);
│ │ │ │ - bool ppaarrssee__iinnffoo__sseeccttiioonn (bdecode_node const& info, error_code& ec, int
│ │ │ │ -max_pieces);
│ │ │ │ - bdecode_node iinnffoo (char const* key) const;
│ │ │ │ - span iinnffoo__sseeccttiioonn () const;
│ │ │ │ - span ppiieeccee__llaayyeerr (file_index_t) const;
│ │ │ │ - void ffrreeee__ppiieeccee__llaayyeerrss ();
│ │ │ │ + explicit bbiittffiieelldd (int bits);
│ │ │ │ + bbiittffiieelldd (char const* b, int bits);
│ │ │ │ + bbiittffiieelldd (bitfield&& rhs) noexcept = default;
│ │ │ │ + bbiittffiieelldd (bitfield const& rhs);
│ │ │ │ + bbiittffiieelldd () noexcept = default;
│ │ │ │ + bbiittffiieelldd (int bits, bool val);
│ │ │ │ + void aassssiiggnn (char const* b, int const bits);
│ │ │ │ + bool ooppeerraattoorr[[]] (int index) const noexcept;
│ │ │ │ + bool ggeett__bbiitt (int index) const noexcept;
│ │ │ │ + void cclleeaarr__bbiitt (int index) noexcept;
│ │ │ │ + void sseett__bbiitt (int index) noexcept;
│ │ │ │ + bool aallll__sseett () const noexcept;
│ │ │ │ + bool nnoonnee__sseett () const noexcept;
│ │ │ │ + int ssiizzee () const noexcept;
│ │ │ │ + int nnuumm__wwoorrddss () const noexcept;
│ │ │ │ + int nnuumm__bbyytteess () const noexcept;
│ │ │ │ + bool eemmppttyy () const noexcept;
│ │ │ │ + char const* ddaattaa () const noexcept;
│ │ │ │ + char* ddaattaa () noexcept;
│ │ │ │ + void sswwaapp (bitfield& rhs) noexcept;
│ │ │ │ + int ccoouunntt () const noexcept;
│ │ │ │ + int ffiinndd__ffiirrsstt__sseett () const noexcept;
│ │ │ │ + int ffiinndd__llaasstt__cclleeaarr () const noexcept;
│ │ │ │ + bool ooppeerraattoorr==== (lt::bitfield const& rhs) const;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttoorrrreenntt__iinnffoo(()) **********
│ │ │ │ -ttoorrrreenntt__iinnffoo (char const* buffer, int size);
│ │ │ │ -ttoorrrreenntt__iinnffoo (std::string const& filename, load_torrent_limits const& cfg);
│ │ │ │ -ttoorrrreenntt__iinnffoo (bdecode_node const& torrent_file, error_code& ec);
│ │ │ │ -ttoorrrreenntt__iinnffoo (span buffer, load_torrent_limits const& cfg,
│ │ │ │ -from_span_t);
│ │ │ │ -ttoorrrreenntt__iinnffoo (std::string const& filename, error_code& ec);
│ │ │ │ -ttoorrrreenntt__iinnffoo (span buffer, error_code& ec, from_span_t);
│ │ │ │ -explicit ttoorrrreenntt__iinnffoo (std::string const& filename);
│ │ │ │ -explicit ttoorrrreenntt__iinnffoo (span buffer, from_span_t);
│ │ │ │ -ttoorrrreenntt__iinnffoo (torrent_info const& t);
│ │ │ │ -ttoorrrreenntt__iinnffoo (char const* buffer, int size, error_code& ec);
│ │ │ │ -explicit ttoorrrreenntt__iinnffoo (bdecode_node const& torrent_file);
│ │ │ │ -ttoorrrreenntt__iinnffoo (bdecode_node const& torrent_file, load_torrent_limits const&
│ │ │ │ -cfg);
│ │ │ │ -explicit ttoorrrreenntt__iinnffoo (info_hash_t const& info_hash);
│ │ │ │ -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 _b_d_e_c_o_d_e___n_o_d_e will create a _t_o_r_r_e_n_t___i_n_f_o object
│ │ │ │ -from the information found in the given torrent_file. The _b_d_e_c_o_d_e___n_o_d_e
│ │ │ │ -represents a tree node in an bencoded file. To load an ordinary .torrent file
│ │ │ │ -into a _b_d_e_c_o_d_e___n_o_d_e, use _b_d_e_c_o_d_e_(_).
│ │ │ │ -The version that takes a buffer pointer and a size will decode it as a .torrent
│ │ │ │ -file and initialize the _t_o_r_r_e_n_t___i_n_f_o object for you.
│ │ │ │ -The version that takes a filename will simply load the torrent file and decode
│ │ │ │ -it inside the constructor, for convenience. This might not be the most suitable
│ │ │ │ -for applications that want to be able to report detailed errors on what might
│ │ │ │ -go wrong.
│ │ │ │ -There is an upper limit on the size of the torrent file that will be loaded by
│ │ │ │ -the overload taking a filename. If it's important that even very large torrent
│ │ │ │ -files are loaded, use one of the other overloads.
│ │ │ │ -The overloads that takes an error_code const& never throws if an error occur,
│ │ │ │ -they will simply set the error code to describe what went wrong and not fully
│ │ │ │ -initialize the _t_o_r_r_e_n_t___i_n_f_o object. The overloads that do not take the extra
│ │ │ │ -error_code parameter will always throw if an error occurs. These overloads are
│ │ │ │ -not available when building without exception support.
│ │ │ │ -The overload that takes a span also needs an extra parameter of type
│ │ │ │ -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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ~~ttoorrrreenntt__iinnffoo(()) **********
│ │ │ │ -~~ttoorrrreenntt__iinnffoo ();
│ │ │ │ -frees all storage associated with this _t_o_r_r_e_n_t___i_n_f_o object
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiilleess(()) oorriigg__ffiilleess(()) **********
│ │ │ │ -file_storage const& ffiilleess () const;
│ │ │ │ -file_storage const& oorriigg__ffiilleess () const;
│ │ │ │ -The _f_i_l_e___s_t_o_r_a_g_e object contains the information on how to map the pieces to
│ │ │ │ -files. It is separated from the _t_o_r_r_e_n_t___i_n_f_o 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
│ │ │ │ -_f_i_l_e___s_t_o_r_a_g_e in order to make its mapping differ from the one in the torrent
│ │ │ │ -file.
│ │ │ │ -orig_files() returns the original (unmodified) file storage for this torrent.
│ │ │ │ -This is used by the web server connection, which needs to request files with
│ │ │ │ -the original names. Filename may be changed using torrent_info::rename_file().
│ │ │ │ -For more information on the _f_i_l_e___s_t_o_r_a_g_e object, see the separate document on
│ │ │ │ -how to create torrents.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreennaammee__ffiillee(()) **********
│ │ │ │ -void rreennaammee__ffiillee (file_index_t index, std::string const& new_filename);
│ │ │ │ -Renames the file with the specified index to the new name. The new filename is
│ │ │ │ -reflected by the file_storage returned by files() but not by the one returned
│ │ │ │ -by orig_files().
│ │ │ │ -If you want to rename the base name of the torrent (for a multi file torrent),
│ │ │ │ -you can copy the file_storage (see _f_i_l_e_s_(_) and _o_r_i_g___f_i_l_e_s_(_) ), change the name,
│ │ │ │ -and then use _r_e_m_a_p___f_i_l_e_s_(_).
│ │ │ │ -The new_filename can both be a relative path, in which case the file name is
│ │ │ │ -relative to the save_path of the torrent. If the new_filename is an absolute
│ │ │ │ -path (i.e. is_complete(new_filename) == true), then the file is detached from
│ │ │ │ -the save_path of the torrent. In this case the file is not moved when
│ │ │ │ -_m_o_v_e___s_t_o_r_a_g_e_(_) is invoked.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreemmaapp__ffiilleess(()) **********
│ │ │ │ -void rreemmaapp__ffiilleess (file_storage const& f);
│ │ │ │ -Warning
│ │ │ │ -Usingremap_files()is discouraged as it's incompatible with v2 torrents. This is
│ │ │ │ -because the piece boundaries and piece hashes in v2 torrents are intimately
│ │ │ │ -tied to the file boundaries. Instead, just rename individual files, or
│ │ │ │ -implement a custom _d_i_s_k___i_n_t_e_r_f_a_c_e to customize how to store files.
│ │ │ │ -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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__ttrraacckkeerr(()) ttrraacckkeerrss(()) cclleeaarr__ttrraacckkeerrss(()) **********
│ │ │ │ -std::vector const& ttrraacckkeerrss () const;
│ │ │ │ -void aadddd__ttrraacckkeerr (std::string const& url, int tier = 0);
│ │ │ │ -void cclleeaarr__ttrraacckkeerrss ();
│ │ │ │ -void aadddd__ttrraacckkeerr (std::string const& url, int tier
│ │ │ │ - , announce_entry::tracker_source source);
│ │ │ │ -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 _a_n_n_o_u_n_c_e___e_n_t_r_y. Each announce _e_n_t_r_y 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 _a_n_n_o_u_n_c_e___e_n_t_r_y.
│ │ │ │ -trackers() returns all entries from announce-list.
│ │ │ │ -clear_trackers() removes all trackers from announce-list.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ssiimmiillaarr__ttoorrrreennttss(()) ccoolllleeccttiioonnss(()) **********
│ │ │ │ -std::vector ccoolllleeccttiioonnss () const;
│ │ │ │ -std::vector ssiimmiillaarr__ttoorrrreennttss () const;
│ │ │ │ -These two functions are related to _B_E_P_ _3_8 (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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__wweebb__sseeeeddss(()) aadddd__hhttttpp__sseeeedd(()) wweebb__sseeeeddss(()) aadddd__uurrll__sseeeedd(()) **********
│ │ │ │ -void aadddd__hhttttpp__sseeeedd (std::string const& url
│ │ │ │ - , std::string const& extern_auth = std::string()
│ │ │ │ - , web_seed_entry::headers_t const& extra_headers = web_seed_entry::
│ │ │ │ -headers_t());
│ │ │ │ -void sseett__wweebb__sseeeeddss (std::vector seeds);
│ │ │ │ -void aadddd__uurrll__sseeeedd (std::string const& url
│ │ │ │ - , std::string const& extern_auth = std::string()
│ │ │ │ - , web_seed_entry::headers_t const& ext_headers = web_seed_entry::
│ │ │ │ -headers_t());
│ │ │ │ -std::vector const& wweebb__sseeeeddss () const;
│ │ │ │ -web_seeds() returns all url seeds and http seeds in the torrent. Each _e_n_t_r_y 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.
│ │ │ │ -set_web_seeds() replaces all web seeds with the ones specified in the seeds
│ │ │ │ -vector.
│ │ │ │ -The extern_auth argument sets the auth field of the _w_e_b___s_e_e_d___e_n_t_r_y. If set, it
│ │ │ │ -overrides any username and password found in the URL itself, and it is sent
│ │ │ │ -verbatim as the value of the HTTP Authorization header (it is not transformed
│ │ │ │ -in any way). For HTTP basic authentication the value must therefore be "Basic "
│ │ │ │ -followed by the base64 encoding of username:password. See _w_e_b___s_e_e_d___e_n_t_r_y for
│ │ │ │ -the security implications of this field across redirects.
│ │ │ │ -The extra_headers argument defaults to an empty list, but can be used to insert
│ │ │ │ -custom HTTP headers in the requests to a specific web seed.
│ │ │ │ -See _h_t_t_p_ _s_e_e_d_i_n_g for more information.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttoottaall__ssiizzee(()) **********
│ │ │ │ -std::int64_t ttoottaall__ssiizzee () const;
│ │ │ │ -total_size() returns the total number of bytes the torrent-file represents.
│ │ │ │ -Note that this is the number of pieces times the piece size (modulo the last
│ │ │ │ -piece possibly being smaller). With pad files, the total size will be larger
│ │ │ │ -than the sum of all (regular) file sizes.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnuumm__ppiieecceess(()) ppiieeccee__lleennggtthh(()) **********
│ │ │ │ -int nnuumm__ppiieecceess () const;
│ │ │ │ -int ppiieeccee__lleennggtthh () 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** bblloocckkss__ppeerr__ppiieeccee(()) **********
│ │ │ │ -int bblloocckkss__ppeerr__ppiieeccee () const;
│ │ │ │ -returns the number of blocks there are in the typical piece. There may be fewer
│ │ │ │ -in the last piece)
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__rraannggee(()) llaasstt__ppiieeccee(()) eenndd__ppiieeccee(()) **********
│ │ │ │ -piece_index_t llaasstt__ppiieeccee () const;
│ │ │ │ -index_range ppiieeccee__rraannggee () const;
│ │ │ │ -piece_index_t eenndd__ppiieeccee () 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
│ │ │ │ -_f_i_l_e___s_t_o_r_a_g_e.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iinnffoo__hhaasshheess(()) iinnffoo__hhaasshh(()) **********
│ │ │ │ -sha1_hash iinnffoo__hhaasshh () const noexcept;
│ │ │ │ -info_hash_t const& iinnffoo__hhaasshheess () const;
│ │ │ │ -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
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** vv22(()) vv11(()) **********
│ │ │ │ -bool vv22 () const;
│ │ │ │ -bool vv11 () 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnuumm__ffiilleess(()) **********
│ │ │ │ -int nnuumm__ffiilleess () const;
│ │ │ │ -If you need index-access to files you can use the num_files() along with the
│ │ │ │ -file_path(), file_size()-family of functions to access files using indices.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** mmaapp__bblloocckk(()) **********
│ │ │ │ -std::vector mmaapp__bblloocckk (piece_index_t const piece
│ │ │ │ - , std::int64_t offset, int size) const;
│ │ │ │ -This function will map a piece index, a byte offset within that piece and a
│ │ │ │ -size (in bytes) into the corresponding files with offsets where that data for
│ │ │ │ -that piece is supposed to be stored. See _f_i_l_e___s_l_i_c_e.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** mmaapp__ffiillee(()) **********
│ │ │ │ -peer_request mmaapp__ffiillee (file_index_t const file, std::int64_t offset, int size)
│ │ │ │ -const;
│ │ │ │ -This function will map a range in a specific file into a range in the torrent.
│ │ │ │ -The file_offset parameter is the offset in the file, given in bytes, where 0 is
│ │ │ │ -the start of the file. See _p_e_e_r___r_e_q_u_e_s_t.
│ │ │ │ -The input range is assumed to be valid within the torrent. file_offset + size
│ │ │ │ -is not allowed to be greater than the file size. file_index must refer to a
│ │ │ │ -valid file, i.e. it cannot be >= num_files().
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ssssll__cceerrtt(()) **********
│ │ │ │ -string_view ssssll__cceerrtt () const;
│ │ │ │ -Returns the SSL root certificate for the torrent, if it is an SSL torrent.
│ │ │ │ -Otherwise returns an empty string. The certificate is the public certificate in
│ │ │ │ -x509 format.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iiss__vvaalliidd(()) **********
│ │ │ │ -bool iiss__vvaalliidd () const;
│ │ │ │ -returns true if this _t_o_r_r_e_n_t___i_n_f_o object has a torrent loaded. This is
│ │ │ │ -primarily used to determine if a magnet link has had its metadata resolved yet
│ │ │ │ -or not.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** pprriivv(()) **********
│ │ │ │ -bool pprriivv () const;
│ │ │ │ -returns true if this torrent is private. i.e., the client should not advertise
│ │ │ │ -itself on the trackerless network (the Kademlia DHT) for this torrent.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iiss__ii22pp(()) **********
│ │ │ │ -bool iiss__ii22pp () const;
│ │ │ │ -returns true if this is an i2p torrent. This is determined by whether or not it
│ │ │ │ -has a tracker whose URL domain name ends with ".i2p". i2p torrents disable the
│ │ │ │ -DHT and local peer discovery as well as talking to peers over anything other
│ │ │ │ -than the i2p network.
│ │ │ │ +********** bbiittffiieelldd(()) **********
│ │ │ │ +explicit bbiittffiieelldd (int bits);
│ │ │ │ +bbiittffiieelldd (char const* b, int bits);
│ │ │ │ +bbiittffiieelldd (bitfield&& rhs) noexcept = default;
│ │ │ │ +bbiittffiieelldd (bitfield const& rhs);
│ │ │ │ +bbiittffiieelldd () noexcept = default;
│ │ │ │ +bbiittffiieelldd (int bits, bool val);
│ │ │ │ +constructs a new _b_i_t_f_i_e_l_d. The default constructor creates an empty _b_i_t_f_i_e_l_d.
│ │ │ │ +bits is the size of the _b_i_t_f_i_e_l_d (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 _b_i_t_f_i_e_l_d from the
│ │ │ │ +specified buffer, and bits number of bits (rounded up to the nearest byte
│ │ │ │ +boundary).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__ssiizzee(()) **********
│ │ │ │ -int ppiieeccee__ssiizzee (piece_index_t index) const;
│ │ │ │ -returns the piece size of file with index. This will be the same as
│ │ │ │ -_p_i_e_c_e___l_e_n_g_t_h_(_), except for the last piece, which may be shorter.
│ │ │ │ +********** aassssiiggnn(()) **********
│ │ │ │ +void aassssiiggnn (char const* b, int const bits);
│ │ │ │ +copy _b_i_t_f_i_e_l_d from buffer b of bits number of bits, rounded up to the nearest
│ │ │ │ +byte boundary.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__ssiizzee__ffoorr__rreeqq(()) **********
│ │ │ │ -int ppiieeccee__ssiizzee__ffoorr__rreeqq (piece_index_t index) const;
│ │ │ │ -returns the piece size appropriate for computing request lengths. for v2-only
│ │ │ │ -torrents, pieces at the end of files may be shorter than the main piece size.
│ │ │ │ -For v1 and hybrid torrents, piece sizes must be full (except for the last
│ │ │ │ -piece) in order to correctly compute the piece hash.
│ │ │ │ +********** ggeett__bbiitt(()) ooppeerraattoorr[[]](()) **********
│ │ │ │ +bool ooppeerraattoorr[[]] (int index) const noexcept;
│ │ │ │ +bool ggeett__bbiitt (int index) const noexcept;
│ │ │ │ +query bit at index. Returns true if bit is 1, otherwise false.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** hhaasshh__ffoorr__ppiieeccee(()) hhaasshh__ffoorr__ppiieeccee__ppttrr(()) **********
│ │ │ │ -sha1_hash hhaasshh__ffoorr__ppiieeccee (piece_index_t index) const;
│ │ │ │ -char const* hhaasshh__ffoorr__ppiieeccee__ppttrr (piece_index_t const 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.
│ │ │ │ +********** sseett__bbiitt(()) cclleeaarr__bbiitt(()) **********
│ │ │ │ +void cclleeaarr__bbiitt (int index) noexcept;
│ │ │ │ +void sseett__bbiitt (int index) noexcept;
│ │ │ │ +set bit at index to 0 (clear_bit) or 1 (set_bit).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnaammee(()) **********
│ │ │ │ -const std::string& nnaammee () const;
│ │ │ │ -name() returns the name of the torrent. name contains UTF-8 encoded string.
│ │ │ │ +********** aallll__sseett(()) **********
│ │ │ │ +bool aallll__sseett () const noexcept;
│ │ │ │ +returns true if all bits in the _b_i_t_f_i_e_l_d are set
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ccrreeaattiioonn__ddaattee(()) **********
│ │ │ │ -std::time_t ccrreeaattiioonn__ddaattee () const;
│ │ │ │ -creation_date() returns the creation date of the torrent as time_t (_p_o_s_i_x
│ │ │ │ -_t_i_m_e). If there's no time stamp in the torrent file, 0 is returned. .. posix
│ │ │ │ -time: _h_t_t_p_:_/_/_w_w_w_._o_p_e_n_g_r_o_u_p_._o_r_g_/_o_n_l_i_n_e_p_u_b_s_/_0_0_9_6_9_5_3_9_9_/_f_u_n_c_t_i_o_n_s_/_t_i_m_e_._h_t_m_l
│ │ │ │ +********** nnoonnee__sseett(()) **********
│ │ │ │ +bool nnoonnee__sseett () const noexcept;
│ │ │ │ +returns true if no bit in the _b_i_t_f_i_e_l_d is set
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ccrreeaattoorr(()) **********
│ │ │ │ -const std::string& ccrreeaattoorr () const;
│ │ │ │ -creator() returns the creator string in the torrent. If there is no creator
│ │ │ │ -string it will return an empty string.
│ │ │ │ +********** ssiizzee(()) **********
│ │ │ │ +int ssiizzee () const noexcept;
│ │ │ │ +returns the size of the _b_i_t_f_i_e_l_d in bits.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ccoommmmeenntt(()) **********
│ │ │ │ -const std::string& ccoommmmeenntt () const;
│ │ │ │ -comment() returns the comment associated with the torrent. If there's no
│ │ │ │ -comment, it will return an empty string. comment contains UTF-8 encoded string.
│ │ │ │ +********** nnuumm__wwoorrddss(()) **********
│ │ │ │ +int nnuumm__wwoorrddss () const noexcept;
│ │ │ │ +returns the number of 32 bit words are needed to represent all bits in this
│ │ │ │ +_b_i_t_f_i_e_l_d.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnooddeess(()) **********
│ │ │ │ -std::vector> const& nnooddeess () const;
│ │ │ │ -If this torrent contains any DHT nodes, they are put in this vector in their
│ │ │ │ -original form (host name and port number).
│ │ │ │ +********** nnuumm__bbyytteess(()) **********
│ │ │ │ +int nnuumm__bbyytteess () const noexcept;
│ │ │ │ +returns the number of bytes needed to represent all bits in this _b_i_t_f_i_e_l_d
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__nnooddee(()) **********
│ │ │ │ -void aadddd__nnooddee (std::pair const& node);
│ │ │ │ -This is used when creating torrent. Use this to add a known DHT node. It may be
│ │ │ │ -used, by the client, to bootstrap into the DHT network.
│ │ │ │ +********** eemmppttyy(()) **********
│ │ │ │ +bool eemmppttyy () const noexcept;
│ │ │ │ +returns true if the _b_i_t_f_i_e_l_d has zero size.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppaarrssee__iinnffoo__sseeccttiioonn(()) **********
│ │ │ │ -bool ppaarrssee__iinnffoo__sseeccttiioonn (bdecode_node const& info, error_code& ec, int
│ │ │ │ -max_pieces);
│ │ │ │ -populates the _t_o_r_r_e_n_t___i_n_f_o by providing just the info-dict buffer. This is used
│ │ │ │ -when loading a torrent from a magnet link for instance, where we only have the
│ │ │ │ -info-dict. The _b_d_e_c_o_d_e___n_o_d_e e points to a parsed info-dictionary. ec returns an
│ │ │ │ -error code if something fails (typically if the info dictionary is malformed).
│ │ │ │ -Themax_piecesparameter allows limiting the amount of memory dedicated to
│ │ │ │ -loading the torrent, and fails for torrents that exceed the limit. To load
│ │ │ │ -large torrents, this limit may also need to be raised in _s_e_t_t_i_n_g_s___p_a_c_k_:_:
│ │ │ │ -_m_a_x___p_i_e_c_e___c_o_u_n_t and in calls to _r_e_a_d___r_e_s_u_m_e___d_a_t_a_(_).
│ │ │ │ +********** ddaattaa(()) **********
│ │ │ │ +char const* ddaattaa () const noexcept;
│ │ │ │ +char* ddaattaa () noexcept;
│ │ │ │ +returns a pointer to the internal buffer of the _b_i_t_f_i_e_l_d, or nullptr if it's
│ │ │ │ +empty.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iinnffoo(()) **********
│ │ │ │ -bdecode_node iinnffoo (char const* key) const;
│ │ │ │ -This function looks up keys from the info-dictionary of the loaded torrent
│ │ │ │ -file. It can be used to access extension values put in the .torrent file. If
│ │ │ │ -the specified key cannot be found, it returns nullptr.
│ │ │ │ +********** sswwaapp(()) **********
│ │ │ │ +void sswwaapp (bitfield& rhs) noexcept;
│ │ │ │ +swaps the bit-fields two variables refer to
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iinnffoo__sseeccttiioonn(()) **********
│ │ │ │ -span iinnffoo__sseeccttiioonn () const;
│ │ │ │ -returns a the raw info section of the torrent file. The underlying buffer is
│ │ │ │ -still owned by the _t_o_r_r_e_n_t___i_n_f_o object
│ │ │ │ +********** ccoouunntt(()) **********
│ │ │ │ +int ccoouunntt () const noexcept;
│ │ │ │ +count the number of bits in the _b_i_t_f_i_e_l_d that are set to 1.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__llaayyeerr(()) **********
│ │ │ │ -span ppiieeccee__llaayyeerr (file_index_t) const;
│ │ │ │ -return the bytes of the piece layer hashes for the specified file. If the file
│ │ │ │ -doesn't have a piece layer, an empty span is returned. The span size is
│ │ │ │ -divisible by 32, the size of a SHA-256 hash. If the size of the file is smaller
│ │ │ │ -than or equal to the piece size, the files "root hash" is the hash of the file
│ │ │ │ -and is not saved separately in the "piece layers" field, but this function
│ │ │ │ -still returns the root hash of the file in that case.
│ │ │ │ +********** ffiinndd__ffiirrsstt__sseett(()) **********
│ │ │ │ +int ffiinndd__ffiirrsstt__sseett () const noexcept;
│ │ │ │ +returns the index of the first set bit in the _b_i_t_f_i_e_l_d, i.e. 1 bit.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffrreeee__ppiieeccee__llaayyeerrss(()) **********
│ │ │ │ -void ffrreeee__ppiieeccee__llaayyeerrss ();
│ │ │ │ -clears the piece layers from the _t_o_r_r_e_n_t___i_n_f_o. This is done by the _s_e_s_s_i_o_n when
│ │ │ │ -a torrent is added, to avoid storing it twice. The piece layer (or other hashes
│ │ │ │ -part of the merkle tree) are stored in the internal torrent object.
│ │ │ │ +********** ffiinndd__llaasstt__cclleeaarr(()) **********
│ │ │ │ +int ffiinndd__llaasstt__cclleeaarr () const noexcept;
│ │ │ │ +returns the index to the last cleared bit in the _b_i_t_f_i_e_l_d, i.e. 0 bit.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ bblloocckk__iinnffoo ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -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
│ │ │ │ +************ ssttaattss__mmeettrriicc ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___s_t_a_t_s_._h_p_p"
│ │ │ │ +describes one statistics metric from the _s_e_s_s_i_o_n. For more information, see the
│ │ │ │ +_s_e_s_s_i_o_n_ _s_t_a_t_i_s_t_i_c_s section.
│ │ │ │ +struct stats_metric
│ │ │ │ {
│ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t ppeeeerr () const;
│ │ │ │ - void sseett__ppeeeerr (tcp::endpoint const& ep);
│ │ │ │ -
│ │ │ │ - enum block_state_t
│ │ │ │ - {
│ │ │ │ - none,
│ │ │ │ - requested,
│ │ │ │ - writing,
│ │ │ │ - finished,
│ │ │ │ - };
│ │ │ │ -
│ │ │ │ - unsigned bytes_progress:15;
│ │ │ │ - unsigned block_size:15;
│ │ │ │ - unsigned state:2;
│ │ │ │ - unsigned num_peers:14;
│ │ │ │ + char const* name;
│ │ │ │ + int value_index;
│ │ │ │ + metric_type_t type;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppeeeerr(()) sseett__ppeeeerr(()) **********
│ │ │ │ -_t_c_p_:_:_e_n_d_p_o_i_n_t ppeeeerr () const;
│ │ │ │ -void sseett__ppeeeerr (tcp::endpoint const& ep);
│ │ │ │ -The peer is the ip address of the peer this block was downloaded from.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennuumm bblloocckk__ssttaattee__tt **********
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___h_a_n_d_l_e_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|none |0 |This block has not been downloaded or requested form any |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_e_e_r_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|requested|1 |The block has been requested, but not completely downloaded|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_y_e_t_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|writing |2 |The block has been downloaded and is currently queued for |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_b_e_i_n_g_ _w_r_i_t_t_e_n_ _t_o_ _d_i_s_k_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_f_i_n_i_s_h_e_d_ _|_3_ _ _ _ _|_T_h_e_ _b_l_o_c_k_ _h_a_s_ _b_e_e_n_ _w_r_i_t_t_e_n_ _t_o_ _d_i_s_k_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - bytes_progress
│ │ │ │ - the number of bytes that have been received for this block
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - block_size
│ │ │ │ - the total number of bytes in this block.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - state
│ │ │ │ - the state this block is in (see _b_l_o_c_k___s_t_a_t_e___t)
│ │ │ │ + name
│ │ │ │ + the name of the counter or gauge
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - num_peers
│ │ │ │ - the number of peers that is currently requesting this block. Typically
│ │ │ │ - this is 0 or 1, but at the end of the torrent blocks may be requested by
│ │ │ │ - more peers in parallel to speed things up.
│ │ │ │ + value_index type
│ │ │ │ + the index into the _s_e_s_s_i_o_n stats array, where the underlying value of
│ │ │ │ + this counter or gauge is found. The _s_e_s_s_i_o_n stats array is part of the
│ │ │ │ + _s_e_s_s_i_o_n___s_t_a_t_s___a_l_e_r_t object.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppaarrttiiaall__ppiieeccee__iinnffoo ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -This class holds information about pieces that have outstanding requests or
│ │ │ │ -outstanding writes
│ │ │ │ -struct partial_piece_info
│ │ │ │ +************ ccoouunntteerrss ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_r_f_o_r_m_a_n_c_e___c_o_u_n_t_e_r_s_._h_p_p"
│ │ │ │ +struct counters
│ │ │ │ {
│ │ │ │ - piece_index_t piece_index;
│ │ │ │ - int blocks_in_piece;
│ │ │ │ - int finished;
│ │ │ │ - int writing;
│ │ │ │ - int requested;
│ │ │ │ - block_info const* blocks;
│ │ │ │ + ccoouunntteerrss () ;
│ │ │ │ + counters& ooppeerraattoorr== (counters const&) & ;
│ │ │ │ + ccoouunntteerrss (counters const&) ;
│ │ │ │ + std::int64_t iinncc__ssttaattss__ccoouunntteerr (int c, std::int64_t value = 1) ;
│ │ │ │ + std::int64_t ooppeerraattoorr[[]] (int i) const ;
│ │ │ │ + void bblleenndd__ssttaattss__ccoouunntteerr (int c, std::int64_t value, int ratio) ;
│ │ │ │ + void sseett__vvaalluuee (int c, std::int64_t value) ;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - piece_index
│ │ │ │ - the index of the piece in question. blocks_in_piece is the number of
│ │ │ │ - blocks in this particular piece. This number will be the same for most
│ │ │ │ - pieces, but the last piece may have fewer blocks than the standard
│ │ │ │ - pieces.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - blocks_in_piece
│ │ │ │ - the number of blocks in this piece
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - finished
│ │ │ │ - the number of blocks that are in the finished state
│ │ │ │ +********** ooppeerraattoorr[[]](()) iinncc__ssttaattss__ccoouunntteerr(()) **********
│ │ │ │ +std::int64_t iinncc__ssttaattss__ccoouunntteerr (int c, std::int64_t value = 1) ;
│ │ │ │ +std::int64_t ooppeerraattoorr[[]] (int i) const ;
│ │ │ │ +returns the new value
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - writing
│ │ │ │ - the number of blocks that are in the writing state
│ │ │ │ +************ sseessssiioonn__ssttaattss__mmeettrriiccss(()) ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___s_t_a_t_s_._h_p_p"
│ │ │ │ +std::vector sseessssiioonn__ssttaattss__mmeettrriiccss ();
│ │ │ │ +This free function returns the list of available metrics exposed by
│ │ │ │ +libtorrent's statistics API. Each metric has a name and a vvaalluuee iinnddeexx. The
│ │ │ │ +value index is the index into the array in _s_e_s_s_i_o_n___s_t_a_t_s___a_l_e_r_t where this
│ │ │ │ +metric's value can be found when the _s_e_s_s_i_o_n stats is sampled (by calling
│ │ │ │ +_p_o_s_t___s_e_s_s_i_o_n___s_t_a_t_s_(_)).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - requested
│ │ │ │ - the number of blocks that are in the requested state
│ │ │ │ +************ ffiinndd__mmeettrriicc__iiddxx(()) ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___s_t_a_t_s_._h_p_p"
│ │ │ │ +int ffiinndd__mmeettrriicc__iiddxx (string_view name);
│ │ │ │ +given a name of a metric, this function returns the counter index of it, or -
│ │ │ │ +1 if it could not be found. The counter index is the index into the values
│ │ │ │ +array returned by _s_e_s_s_i_o_n___s_t_a_t_s___a_l_e_r_t.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - blocks
│ │ │ │ - this is an array of blocks_in_piece number of items. One for each block
│ │ │ │ - in the piece.
│ │ │ │ - Warning
│ │ │ │ - This is a pointer that points to an array that's owned by the _s_e_s_s_i_o_n
│ │ │ │ - object. The next time _g_e_t___d_o_w_n_l_o_a_d___q_u_e_u_e_(_) is called, it will be
│ │ │ │ - invalidated. In the case of _p_i_e_c_e___i_n_f_o___a_l_e_r_t, these pointers point into
│ │ │ │ - the _a_l_e_r_t object itself, and will be invalidated when the _a_l_e_r_t destruct.
│ │ │ │ +************ eennuumm mmeettrriicc__ttyyppee__tt ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___s_t_a_t_s_._h_p_p"
│ │ │ │ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ +|_nn_aa_mm_ee_ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ +|_c_o_u_n_t_e_r_|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_g_a_u_g_e_ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ttoorrrreenntt__hhaannddllee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -You will usually have to store your torrent handles somewhere, since it's the
│ │ │ │ -object through which you retrieve information about the torrent and aborts the
│ │ │ │ -torrent.
│ │ │ │ -Warning
│ │ │ │ -Any member function that returns a value or fills in a value has to be made
│ │ │ │ -synchronously. This means it has to wait for the main thread to complete the
│ │ │ │ -query before it can return. This might potentially be expensive if done from
│ │ │ │ -within a GUI thread that needs to stay responsive. Try to avoid querying for
│ │ │ │ -information you don't need, and try to do it in as few calls as possible. You
│ │ │ │ -can get most of the interesting information about a torrent from the
│ │ │ │ -_t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_s_t_a_t_u_s_(_) call.
│ │ │ │ -The default constructor will initialize the handle to an invalid state. Which
│ │ │ │ -means you cannot perform any operation on it, unless you first assign it a
│ │ │ │ -valid handle. If you try to perform any operation on an uninitialized handle,
│ │ │ │ -it will throw invalid_handle.
│ │ │ │ -Warning
│ │ │ │ -All operations on a _t_o_r_r_e_n_t___h_a_n_d_l_e may throw system_error exception, in case
│ │ │ │ -the handle is no longer referring to a torrent. There is one exception _i_s___v_a_l_i_d
│ │ │ │ -_(_) will never throw. Since the torrents are processed by a background thread,
│ │ │ │ -there is no guarantee that a handle will remain valid between two calls.
│ │ │ │ -struct torrent_handle
│ │ │ │ +************ aannnnoouunnccee__iinnffoohhaasshh ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_a_n_n_o_u_n_c_e___e_n_t_r_y_._h_p_p"
│ │ │ │ +struct announce_infohash
│ │ │ │ {
│ │ │ │ - friend std::size_t hhaasshh__vvaalluuee (torrent_handle const& th);
│ │ │ │ - ttoorrrreenntt__hhaannddllee () noexcept = default;
│ │ │ │ - void aadddd__ppiieeccee (piece_index_t piece, std::vector data,
│ │ │ │ -add_piece_flags_t flags = {}) const;
│ │ │ │ - void aadddd__ppiieeccee (piece_index_t piece, char const* data, add_piece_flags_t
│ │ │ │ -flags = {}) const;
│ │ │ │ - void rreeaadd__ppiieeccee (piece_index_t piece) const;
│ │ │ │ - bool hhaavvee__ppiieeccee (piece_index_t piece) const;
│ │ │ │ - void ggeett__ppeeeerr__iinnffoo (std::vector& v) const;
│ │ │ │ - void ppoosstt__ppeeeerr__iinnffoo () const;
│ │ │ │ - torrent_status ssttaattuuss (status_flags_t flags = status_flags_t::all()) const;
│ │ │ │ - void ppoosstt__ssttaattuuss (status_flags_t flags = status_flags_t::all()) const;
│ │ │ │ - std::vector ggeett__ddoowwnnllooaadd__qquueeuuee () const;
│ │ │ │ - void ppoosstt__ddoowwnnllooaadd__qquueeuuee () const;
│ │ │ │ - void ggeett__ddoowwnnllooaadd__qquueeuuee (std::vector& queue) const;
│ │ │ │ - void rreesseett__ppiieeccee__ddeeaaddlliinnee (piece_index_t index) const;
│ │ │ │ - void cclleeaarr__ppiieeccee__ddeeaaddlliinneess () const;
│ │ │ │ - void sseett__ppiieeccee__ddeeaaddlliinnee (piece_index_t index, int deadline, deadline_flags_t
│ │ │ │ -flags = {}) const;
│ │ │ │ - std::vector ffiillee__pprrooggrreessss (file_progress_flags_t flags = {})
│ │ │ │ -const;
│ │ │ │ - void ppoosstt__ffiillee__pprrooggrreessss (file_progress_flags_t flags) const;
│ │ │ │ - void ffiillee__pprrooggrreessss (std::vector& progress,
│ │ │ │ -file_progress_flags_t flags = {}) const;
│ │ │ │ - std::vector ffiillee__ssttaattuuss () const;
│ │ │ │ - void cclleeaarr__eerrrroorr () const;
│ │ │ │ - void ppoosstt__ttrraacckkeerrss () const;
│ │ │ │ - void rreeppllaaccee__ttrraacckkeerrss (std::vector const&) const;
│ │ │ │ - void aadddd__ttrraacckkeerr (announce_entry const&) const;
│ │ │ │ - std::vector ttrraacckkeerrss () const;
│ │ │ │ - std::set uurrll__sseeeeddss () const;
│ │ │ │ - void aadddd__uurrll__sseeeedd (std::string const& url) const;
│ │ │ │ - void rreemmoovvee__uurrll__sseeeedd (std::string const& url) const;
│ │ │ │ - void aadddd__hhttttpp__sseeeedd (std::string const& url) const;
│ │ │ │ - void rreemmoovvee__hhttttpp__sseeeedd (std::string const& url) const;
│ │ │ │ - std::set hhttttpp__sseeeeddss () const;
│ │ │ │ - void aadddd__eexxtteennssiioonn (
│ │ │ │ - std::function(torrent_handle const&,
│ │ │ │ -client_data_t)> const& ext
│ │ │ │ - , client_data_t userdata = client_data_t{});
│ │ │ │ - bool sseett__mmeettaaddaattaa (span metadata) const;
│ │ │ │ - bool iiss__vvaalliidd () const;
│ │ │ │ - void ppaauussee (pause_flags_t flags = {}) const;
│ │ │ │ - void rreessuummee () const;
│ │ │ │ - torrent_flags_t ffllaaggss () const;
│ │ │ │ - void uunnsseett__ffllaaggss (torrent_flags_t flags) const;
│ │ │ │ - void sseett__ffllaaggss (torrent_flags_t flags, torrent_flags_t mask) const;
│ │ │ │ - void sseett__ffllaaggss (torrent_flags_t flags) const;
│ │ │ │ - void fflluusshh__ccaacchhee () const;
│ │ │ │ - void ffoorrccee__rreecchheecckk () const;
│ │ │ │ - void ssaavvee__rreessuummee__ddaattaa (resume_data_flags_t flags = {}) const;
│ │ │ │ - add_torrent_params ggeett__rreessuummee__ddaattaa (resume_data_flags_t flags = {}) const;
│ │ │ │ - bool nneeeedd__ssaavvee__rreessuummee__ddaattaa (resume_data_flags_t flags) const;
│ │ │ │ - bool nneeeedd__ssaavvee__rreessuummee__ddaattaa () const;
│ │ │ │ - void qquueeuuee__ppoossiittiioonn__ttoopp () const;
│ │ │ │ - void qquueeuuee__ppoossiittiioonn__ddoowwnn () const;
│ │ │ │ - queue_position_t qquueeuuee__ppoossiittiioonn () const;
│ │ │ │ - void qquueeuuee__ppoossiittiioonn__bboottttoomm () const;
│ │ │ │ - void qquueeuuee__ppoossiittiioonn__uupp () const;
│ │ │ │ - void qquueeuuee__ppoossiittiioonn__sseett (queue_position_t p) const;
│ │ │ │ - void sseett__ssssll__cceerrttiiffiiccaattee__bbuuffffeerr (std::string const& certificate
│ │ │ │ - , std::string const& private_key
│ │ │ │ - , std::string const& dh_params);
│ │ │ │ - void sseett__ssssll__cceerrttiiffiiccaattee (std::string const& certificate
│ │ │ │ - , std::string const& private_key
│ │ │ │ - , std::string const& dh_params
│ │ │ │ - , std::string const& passphrase = "");
│ │ │ │ - std::shared_ptr ttoorrrreenntt__ffiillee__wwiitthh__hhaasshheess () const;
│ │ │ │ - std::shared_ptr ttoorrrreenntt__ffiillee () const;
│ │ │ │ - std::vector> ppiieeccee__llaayyeerrss () const;
│ │ │ │ - void ppiieeccee__aavvaaiillaabbiilliittyy (std::vector& avail) const;
│ │ │ │ - void ppoosstt__ppiieeccee__aavvaaiillaabbiilliittyy () const;
│ │ │ │ - void ppiieeccee__pprriioorriittyy (piece_index_t index, download_priority_t priority)
│ │ │ │ -const;
│ │ │ │ - void pprriioorriittiizzee__ppiieecceess (std::vector> const& pieces) const;
│ │ │ │ - void pprriioorriittiizzee__ppiieecceess (std::vector const& pieces)
│ │ │ │ -const;
│ │ │ │ - download_priority_t ppiieeccee__pprriioorriittyy (piece_index_t index) const;
│ │ │ │ - std::vector ggeett__ppiieeccee__pprriioorriittiieess () const;
│ │ │ │ - void pprriioorriittiizzee__ffiilleess (std::vector const& files) const;
│ │ │ │ - std::vector ggeett__ffiillee__pprriioorriittiieess () const;
│ │ │ │ - void ffiillee__pprriioorriittyy (file_index_t index, download_priority_t priority) const;
│ │ │ │ - download_priority_t ffiillee__pprriioorriittyy (file_index_t index) const;
│ │ │ │ - void ffoorrccee__ddhhtt__aannnnoouunnccee () const;
│ │ │ │ - void ffoorrccee__rreeaannnnoouunnccee (int seconds = 0, int idx = -1, reannounce_flags_t =
│ │ │ │ -{}) const;
│ │ │ │ - void ffoorrccee__llssdd__aannnnoouunnccee () const;
│ │ │ │ - void ssccrraappee__ttrraacckkeerr (int idx = -1) const;
│ │ │ │ - int ddoowwnnllooaadd__lliimmiitt () const;
│ │ │ │ - int uuppllooaadd__lliimmiitt () const;
│ │ │ │ - void sseett__uuppllooaadd__lliimmiitt (int limit) const;
│ │ │ │ - void sseett__ddoowwnnllooaadd__lliimmiitt (int limit) const;
│ │ │ │ - void ccoonnnneecctt__ppeeeerr (tcp::endpoint const& adr, peer_source_flags_t source = {}
│ │ │ │ - , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;
│ │ │ │ - void cclleeaarr__ppeeeerrss ();
│ │ │ │ - void sseett__mmaaxx__uuppllooaaddss (int max_uploads) const;
│ │ │ │ - int mmaaxx__uuppllooaaddss () const;
│ │ │ │ - void sseett__mmaaxx__ccoonnnneeccttiioonnss (int max_connections) const;
│ │ │ │ - int mmaaxx__ccoonnnneeccttiioonnss () const;
│ │ │ │ - void mmoovvee__ssttoorraaggee (std::string const& save_path
│ │ │ │ - , move_flags_t flags = move_flags_t::always_replace_files
│ │ │ │ - ) const;
│ │ │ │ - void rreennaammee__ffiillee (file_index_t index, std::string const& new_name) const;
│ │ │ │ - sha1_hash iinnffoo__hhaasshh () const;
│ │ │ │ - info_hash_t iinnffoo__hhaasshheess () const;
│ │ │ │ - bool ooppeerraattoorr<< (const torrent_handle& h) const;
│ │ │ │ - bool ooppeerraattoorr!!== (const torrent_handle& h) const;
│ │ │ │ - bool ooppeerraattoorr==== (const torrent_handle& h) const;
│ │ │ │ - std::uint32_t iidd () const;
│ │ │ │ - std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ - client_data_t uusseerrddaattaa () const;
│ │ │ │ - bool iinn__sseessssiioonn () const;
│ │ │ │ -
│ │ │ │ - static constexpr add_piece_flags_t oovveerrwwrriittee__eexxiissttiinngg = 0_bit;
│ │ │ │ - static constexpr status_flags_t qquueerryy__ddiissttrriibbuutteedd__ccooppiieess = 0_bit;
│ │ │ │ - static constexpr status_flags_t qquueerryy__aaccccuurraattee__ddoowwnnllooaadd__ccoouunntteerrss = 1_bit;
│ │ │ │ - static constexpr status_flags_t qquueerryy__llaasstt__sseeeenn__ccoommpplleettee = 2_bit;
│ │ │ │ - static constexpr status_flags_t qquueerryy__ppiieecceess = 3_bit;
│ │ │ │ - static constexpr status_flags_t qquueerryy__vveerriiffiieedd__ppiieecceess = 4_bit;
│ │ │ │ - static constexpr status_flags_t qquueerryy__ttoorrrreenntt__ffiillee = 5_bit;
│ │ │ │ - static constexpr status_flags_t qquueerryy__nnaammee = 6_bit;
│ │ │ │ - static constexpr status_flags_t qquueerryy__ssaavvee__ppaatthh = 7_bit;
│ │ │ │ - static constexpr deadline_flags_t aalleerrtt__wwhheenn__aavvaaiillaabbllee = 0_bit;
│ │ │ │ - static constexpr file_progress_flags_t ppiieeccee__ggrraannuullaarriittyy = 0_bit;
│ │ │ │ - static constexpr pause_flags_t ggrraacceeffuull__ppaauussee = 0_bit;
│ │ │ │ - static constexpr resume_data_flags_t fflluusshh__ddiisskk__ccaacchhee = 0_bit;
│ │ │ │ - static constexpr resume_data_flags_t ssaavvee__iinnffoo__ddiicctt = 1_bit;
│ │ │ │ - static constexpr resume_data_flags_t oonnllyy__iiff__mmooddiiffiieedd = 2_bit;
│ │ │ │ - static constexpr resume_data_flags_t iiff__ccoouunntteerrss__cchhaannggeedd = 3_bit;
│ │ │ │ - static constexpr resume_data_flags_t iiff__ddoowwnnllooaadd__pprrooggrreessss = 4_bit;
│ │ │ │ - static constexpr resume_data_flags_t iiff__ccoonnffiigg__cchhaannggeedd = 5_bit;
│ │ │ │ - static constexpr resume_data_flags_t iiff__ssttaattee__cchhaannggeedd = 6_bit;
│ │ │ │ - static constexpr resume_data_flags_t iiff__mmeettaaddaattaa__cchhaannggeedd = 7_bit;
│ │ │ │ - static constexpr reannounce_flags_t iiggnnoorree__mmiinn__iinntteerrvvaall = 0_bit;
│ │ │ │ - static constexpr reannounce_flags_t hhiigghh__pprriioorriittyy = 1_bit;
│ │ │ │ + std::string message;
│ │ │ │ + error_code last_error;
│ │ │ │ + int ssccrraappee__iinnccoommpplleettee = -1;
│ │ │ │ + int ssccrraappee__ccoommpplleettee = -1;
│ │ │ │ + int ssccrraappee__ddoowwnnllooaaddeedd = -1;
│ │ │ │ + std::uint8_t fails : 7;
│ │ │ │ + bool updating : 1;
│ │ │ │ + bool start_sent : 1;
│ │ │ │ + bool complete_sent : 1;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttoorrrreenntt__hhaannddllee(()) **********
│ │ │ │ -ttoorrrreenntt__hhaannddllee () noexcept = default;
│ │ │ │ -constructs a torrent handle that does not refer to a torrent. i.e. _i_s___v_a_l_i_d_(_)
│ │ │ │ -will return false.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__ppiieeccee(()) **********
│ │ │ │ -void aadddd__ppiieeccee (piece_index_t piece, std::vector data, add_piece_flags_t
│ │ │ │ -flags = {}) const;
│ │ │ │ -void aadddd__ppiieeccee (piece_index_t piece, char const* data, add_piece_flags_t flags
│ │ │ │ -= {}) const;
│ │ │ │ -This function will write data to the storage as piece piece, as if it had been
│ │ │ │ -downloaded from a peer.
│ │ │ │ -By default, data that's already been downloaded is not overwritten by this
│ │ │ │ -buffer. If you trust this data to be correct (and pass the piece hash check)
│ │ │ │ -you may pass the overwrite_existing flag. This will instruct libtorrent to
│ │ │ │ -overwrite any data that may already have been downloaded with this data.
│ │ │ │ -Since the data is written asynchronously, you may know that is passed or failed
│ │ │ │ -the hash check by waiting for _p_i_e_c_e___f_i_n_i_s_h_e_d___a_l_e_r_t or _h_a_s_h___f_a_i_l_e_d___a_l_e_r_t.
│ │ │ │ -Adding pieces while the torrent is being checked (i.e. in _t_o_r_r_e_n_t___s_t_a_t_u_s_:_:
│ │ │ │ -_c_h_e_c_k_i_n_g___f_i_l_e_s state) is not supported.
│ │ │ │ -The overload taking a raw pointer to the data is a blocking call. It won't
│ │ │ │ -return until the libtorrent thread has copied the data into its disk write
│ │ │ │ -buffer. data is expected to point to a buffer of as many bytes as the size of
│ │ │ │ -the specified piece. For v2-only torrents, pieces at the end of files may not
│ │ │ │ -be full sized.
│ │ │ │ -The data in the buffer is copied and passed on to the disk IO thread to be
│ │ │ │ -written at some later point in time.
│ │ │ │ -The overload taking a std::vector is not blocking, it will send the
│ │ │ │ -buffer to the main thread and return immediately.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreeaadd__ppiieeccee(()) **********
│ │ │ │ -void rreeaadd__ppiieeccee (piece_index_t piece) const;
│ │ │ │ -This function starts an asynchronous read operation of the specified piece from
│ │ │ │ -this torrent. You must have completed the download of the specified piece
│ │ │ │ -before calling this function.
│ │ │ │ -When the read operation is completed, it is passed back through an _a_l_e_r_t,
│ │ │ │ -_r_e_a_d___p_i_e_c_e___a_l_e_r_t. Since this _a_l_e_r_t is a response to an explicit call, it will
│ │ │ │ -always be posted, regardless of the _a_l_e_r_t mask.
│ │ │ │ -Note
│ │ │ │ -that if you read multiple pieces, the read operations are not guaranteed to
│ │ │ │ -finish in the same order as you initiated them.
│ │ │ │ -Note
│ │ │ │ -the size of the buffer passed back in the _a_l_e_r_t is not necessarily _p_i_e_c_e___l_e_n_g_t_h
│ │ │ │ -_(_) long. The last piece or pieces at the end of files (in v2 and hybrid
│ │ │ │ -torrents) are not full size.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** hhaavvee__ppiieeccee(()) **********
│ │ │ │ -bool hhaavvee__ppiieeccee (piece_index_t piece) const;
│ │ │ │ -Returns true if this piece has been completely downloaded and written to disk,
│ │ │ │ -and false otherwise.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppoosstt__ppeeeerr__iinnffoo(()) ggeett__ppeeeerr__iinnffoo(()) **********
│ │ │ │ -void ggeett__ppeeeerr__iinnffoo (std::vector& v) const;
│ │ │ │ -void ppoosstt__ppeeeerr__iinnffoo () const;
│ │ │ │ -Query information about connected peers for this torrent. If the _t_o_r_r_e_n_t___h_a_n_d_l_e
│ │ │ │ -is invalid, it will throw a system_error exception.
│ │ │ │ -post_peer_info() is asynchronous and will trigger the posting of a
│ │ │ │ -_p_e_e_r___i_n_f_o___a_l_e_r_t. The _a_l_e_r_t contain a list of _p_e_e_r___i_n_f_o objects, one for each
│ │ │ │ -connected peer.
│ │ │ │ -get_peer_info() is synchronous and takes a reference to a vector that will be
│ │ │ │ -cleared and filled with one _e_n_t_r_y for each peer connected to this torrent,
│ │ │ │ -given the handle is valid. Each _e_n_t_r_y in the vector contains information about
│ │ │ │ -that particular peer. See _p_e_e_r___i_n_f_o.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ssttaattuuss(()) ppoosstt__ssttaattuuss(()) **********
│ │ │ │ -torrent_status ssttaattuuss (status_flags_t flags = status_flags_t::all()) const;
│ │ │ │ -void ppoosstt__ssttaattuuss (status_flags_t flags = status_flags_t::all()) const;
│ │ │ │ -status() will return a structure with information about the status of this
│ │ │ │ -torrent. If the _t_o_r_r_e_n_t___h_a_n_d_l_e is invalid, it will throw system_error
│ │ │ │ -exception. See _t_o_r_r_e_n_t___s_t_a_t_u_s. The flags argument filters what information is
│ │ │ │ -returned in the _t_o_r_r_e_n_t___s_t_a_t_u_s. 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.
│ │ │ │ -The status() function will block until the internal libtorrent thread responds
│ │ │ │ -with the _t_o_r_r_e_n_t___s_t_a_t_u_s object. To avoid blocking, instead call post_status().
│ │ │ │ -It will trigger posting of a _s_t_a_t_e___u_p_d_a_t_e___a_l_e_r_t with a single _t_o_r_r_e_n_t___s_t_a_t_u_s
│ │ │ │ -object for this torrent.
│ │ │ │ -In order to get regular updates for torrents whose status changes, consider
│ │ │ │ -calling session::post_torrent_updates()`` instead.
│ │ │ │ -By default everything is included. The flags you can use to decide what to
│ │ │ │ -iinncclluuddee are defined in this class.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppoosstt__ddoowwnnllooaadd__qquueeuuee(()) ggeett__ddoowwnnllooaadd__qquueeuuee(()) **********
│ │ │ │ -std::vector ggeett__ddoowwnnllooaadd__qquueeuuee () const;
│ │ │ │ -void ppoosstt__ddoowwnnllooaadd__qquueeuuee () const;
│ │ │ │ -void ggeett__ddoowwnnllooaadd__qquueeuuee (std::vector& queue) const;
│ │ │ │ -post_download_queue() triggers a download_queue_alert to be posted.
│ │ │ │ -get_download_queue() is a synchronous call and returns a vector with
│ │ │ │ -information about pieces that are partially downloaded or not downloaded but
│ │ │ │ -partially requested. See _p_a_r_t_i_a_l___p_i_e_c_e___i_n_f_o for the fields in the returned
│ │ │ │ -vector.
│ │ │ │ -Warning
│ │ │ │ -get_download_queue() is prone to threading errors. The _b_l_o_c_k___i_n_f_o pointers its
│ │ │ │ -return value points to are owned by the _s_e_s_s_i_o_n and will be cleared the next
│ │ │ │ -time get_download_queue() is called. Therefore it's not safe to call this
│ │ │ │ -function from multiple threads. Using post_download_queue() is a safe
│ │ │ │ -alternative.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreesseett__ppiieeccee__ddeeaaddlliinnee(()) cclleeaarr__ppiieeccee__ddeeaaddlliinneess(()) sseett__ppiieeccee__ddeeaaddlliinnee(()) **********
│ │ │ │ -void rreesseett__ppiieeccee__ddeeaaddlliinnee (piece_index_t index) const;
│ │ │ │ -void cclleeaarr__ppiieeccee__ddeeaaddlliinneess () const;
│ │ │ │ -void sseett__ppiieeccee__ddeeaaddlliinnee (piece_index_t index, int deadline, deadline_flags_t
│ │ │ │ -flags = {}) 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,
│ │ │ │ -unless the alert_when_available flag is set, in which case it will have the
│ │ │ │ -same effect as calling _r_e_a_d___p_i_e_c_e_(_) for index.
│ │ │ │ -deadline is the number of milliseconds until this piece should be completed.
│ │ │ │ -reset_piece_deadline removes the deadline from the piece. If it hasn't already
│ │ │ │ -been downloaded, it will no longer be considered a priority.
│ │ │ │ -clear_piece_deadlines() removes deadlines on all pieces in the torrent. As if
│ │ │ │ -_r_e_s_e_t___p_i_e_c_e___d_e_a_d_l_i_n_e_(_) was called on all pieces.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppoosstt__ffiillee__pprrooggrreessss(()) ffiillee__pprrooggrreessss(()) **********
│ │ │ │ -std::vector ffiillee__pprrooggrreessss (file_progress_flags_t flags = {})
│ │ │ │ -const;
│ │ │ │ -void ppoosstt__ffiillee__pprrooggrreessss (file_progress_flags_t flags) const;
│ │ │ │ -void ffiillee__pprrooggrreessss (std::vector& progress, file_progress_flags_t
│ │ │ │ -flags = {}) const;
│ │ │ │ -This function fills in the supplied vector, or returns a vector, with the
│ │ │ │ -number of bytes downloaded of each file in this torrent. The progress values
│ │ │ │ -are ordered the same as the files in the _t_o_r_r_e_n_t___i_n_f_o.
│ │ │ │ -This operation is not very cheap. Its complexity is OO((nn ++ mmjj)). Where nn is the
│ │ │ │ -number of files, mm is the number of currently downloading pieces and jj is the
│ │ │ │ -number of blocks in a piece.
│ │ │ │ -The flags parameter can be used to specify the granularity of the file
│ │ │ │ -progress. If left at the default value of 0, the progress will be as accurate
│ │ │ │ -as possible, but also more expensive to calculate. If torrent_handle::
│ │ │ │ -piece_granularity is specified, the progress will be specified in piece
│ │ │ │ -granularity. i.e. only pieces that have been fully downloaded and passed the
│ │ │ │ -hash check count. When specifying piece granularity, the operation is a lot
│ │ │ │ -cheaper, since libtorrent already keeps track of this internally and no
│ │ │ │ -calculation is required.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__ssttaattuuss(()) **********
│ │ │ │ -std::vector ffiillee__ssttaattuuss () const;
│ │ │ │ -This function returns a vector with status about files that are open for this
│ │ │ │ -torrent. Any file that is not open will not be reported in the vector, i.e.
│ │ │ │ -it's possible that the vector is empty when returning, if none of the files in
│ │ │ │ -the torrent are currently open.
│ │ │ │ -See _o_p_e_n___f_i_l_e___s_t_a_t_e
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** cclleeaarr__eerrrroorr(()) **********
│ │ │ │ -void cclleeaarr__eerrrroorr () 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__ttrraacckkeerr(()) ttrraacckkeerrss(()) ppoosstt__ttrraacckkeerrss(()) rreeppllaaccee__ttrraacckkeerrss(()) **********
│ │ │ │ -void ppoosstt__ttrraacckkeerrss () const;
│ │ │ │ -void rreeppllaaccee__ttrraacckkeerrss (std::vector const&) const;
│ │ │ │ -void aadddd__ttrraacckkeerr (announce_entry const&) const;
│ │ │ │ -std::vector ttrraacckkeerrss () const;
│ │ │ │ -trackers() returns the list of trackers for this torrent. The announce _e_n_t_r_y
│ │ │ │ -contains both a string url which specify the announce url for the tracker as
│ │ │ │ -well as an _i_n_t 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,
│ │ │ │ -you have to call _f_o_r_c_e___r_e_a_n_n_o_u_n_c_e_(_). See _a_n_n_o_u_n_c_e___e_n_t_r_y.
│ │ │ │ -post_trackers() is the asynchronous version of trackers(). It will trigger a
│ │ │ │ -_t_r_a_c_k_e_r___l_i_s_t___a_l_e_r_t to be posted.
│ │ │ │ -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 _a_n_n_o_u_n_c_e___e_n_t_r_y.
│ │ │ │ -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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreemmoovvee__uurrll__sseeeedd(()) uurrll__sseeeeddss(()) aadddd__uurrll__sseeeedd(()) **********
│ │ │ │ -std::set uurrll__sseeeeddss () const;
│ │ │ │ -void aadddd__uurrll__sseeeedd (std::string const& url) const;
│ │ │ │ -void rreemmoovvee__uurrll__sseeeedd (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 _h_t_t_p_ _s_e_e_d_i_n_g for more information.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__hhttttpp__sseeeedd(()) rreemmoovvee__hhttttpp__sseeeedd(()) hhttttpp__sseeeeddss(()) **********
│ │ │ │ -void aadddd__hhttttpp__sseeeedd (std::string const& url) const;
│ │ │ │ -void rreemmoovvee__hhttttpp__sseeeedd (std::string const& url) const;
│ │ │ │ -std::set hhttttpp__sseeeeddss () const;
│ │ │ │ -These functions are identical as the *_url_seed() variants, but they operate on
│ │ │ │ -_B_E_P_ _1_7 web seeds instead of _B_E_P_ _1_9.
│ │ │ │ -See _h_t_t_p_ _s_e_e_d_i_n_g for more information.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__eexxtteennssiioonn(()) **********
│ │ │ │ -void aadddd__eexxtteennssiioonn (
│ │ │ │ - std::function(torrent_handle const&,
│ │ │ │ -client_data_t)> const& ext
│ │ │ │ - , client_data_t userdata = client_data_t{});
│ │ │ │ -add the specified extension to this torrent. The ext argument is a function
│ │ │ │ -that will be called from within libtorrent's context passing in the internal
│ │ │ │ -torrent object and the specified userdata pointer. The function is expected to
│ │ │ │ -return a shared pointer to a _t_o_r_r_e_n_t___p_l_u_g_i_n instance.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__mmeettaaddaattaa(()) **********
│ │ │ │ -bool sseett__mmeettaaddaattaa (span metadata) const;
│ │ │ │ -set_metadata expects the iinnffoo section of metadata. i.e. The buffer passed in
│ │ │ │ -will be hashed and verified against the info-hash. If it fails, a
│ │ │ │ -metadata_failed_alert will be generated. If it passes, a
│ │ │ │ -metadata_received_alert is generated. The function returns true if the metadata
│ │ │ │ -is successfully set on the torrent, and false otherwise. If the torrent already
│ │ │ │ -has metadata, this function will not affect the torrent, and false will be
│ │ │ │ -returned.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iiss__vvaalliidd(()) **********
│ │ │ │ -bool iiss__vvaalliidd () const;
│ │ │ │ -Returns true if this handle refers to a valid torrent and false if it hasn't
│ │ │ │ -been initialized or if the torrent it refers to has been removed from the
│ │ │ │ -_s_e_s_s_i_o_n AND destructed.
│ │ │ │ -To tell if the _t_o_r_r_e_n_t___h_a_n_d_l_e is in the _s_e_s_s_i_o_n, use _t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_i_n___s_e_s_s_i_o_n
│ │ │ │ -_(_). This will return true before _s_e_s_s_i_o_n___h_a_n_d_l_e_:_:_r_e_m_o_v_e___t_o_r_r_e_n_t_(_) is called,
│ │ │ │ -and false afterward.
│ │ │ │ -Clients should only use _i_s___v_a_l_i_d_(_) to determine if the result of session::
│ │ │ │ -find_torrent() was successful.
│ │ │ │ -Unlike other member functions which return a value, _i_s___v_a_l_i_d_(_) completes
│ │ │ │ -immediately, without blocking on a result from the network thread. Also unlike
│ │ │ │ -other functions, it never throws the system_error exception.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppaauussee(()) rreessuummee(()) **********
│ │ │ │ -void ppaauussee (pause_flags_t flags = {}) const;
│ │ │ │ -void rreessuummee () const;
│ │ │ │ -pause(), and resume() will disconnect all peers and reconnect all peers
│ │ │ │ -respectively. When a torrent is paused, it will however remember all share
│ │ │ │ -ratios to all peers and remember all potential (not connected) peers. Torrents
│ │ │ │ -may be paused automatically if there is a file error (e.g. disk full) or
│ │ │ │ -something similar. See _f_i_l_e___e_r_r_o_r___a_l_e_r_t.
│ │ │ │ -For possible values of the flags parameter, see pause_flags_t.
│ │ │ │ -To know if a torrent is paused or not, call torrent_handle::flags() and check
│ │ │ │ -for the torrent_status::paused flag.
│ │ │ │ -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 _s_e_s_s_i_o_n. For more
│ │ │ │ -information, see _q_u_e_u_i_n_g.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** uunnsseett__ffllaaggss(()) ffllaaggss(()) sseett__ffllaaggss(()) **********
│ │ │ │ -torrent_flags_t ffllaaggss () const;
│ │ │ │ -void uunnsseett__ffllaaggss (torrent_flags_t flags) const;
│ │ │ │ -void sseett__ffllaaggss (torrent_flags_t flags, torrent_flags_t mask) const;
│ │ │ │ -void sseett__ffllaaggss (torrent_flags_t flags) const;
│ │ │ │ -sets and gets the torrent state flags. See _t_o_r_r_e_n_t___f_l_a_g_s___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
│ │ │ │ -added, and it can only be set as part of the _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s flags, when
│ │ │ │ -adding the torrent.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** fflluusshh__ccaacchhee(()) **********
│ │ │ │ -void fflluusshh__ccaacchhee () const;
│ │ │ │ -Instructs libtorrent to flush all the disk caches for this torrent and close
│ │ │ │ -all file handles. This is done asynchronously and you will be notified that
│ │ │ │ -it's complete through _c_a_c_h_e___f_l_u_s_h_e_d___a_l_e_r_t.
│ │ │ │ -Note that by the time you get the _a_l_e_r_t, libtorrent may have cached more data
│ │ │ │ -for the torrent, but you are guaranteed that whatever cached data libtorrent
│ │ │ │ -had by the time you called torrent_handle::flush_cache() has been written to
│ │ │ │ -disk.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffoorrccee__rreecchheecckk(()) **********
│ │ │ │ -void ffoorrccee__rreecchheecckk () const;
│ │ │ │ -force_recheck puts the torrent back in a state where it assumes to have no
│ │ │ │ -resume data. All peers will be disconnected and the torrent will stop
│ │ │ │ -announcing to the tracker. The torrent will be added to the checking queue, and
│ │ │ │ -will be checked (all the files will be read and compared to the piece hashes).
│ │ │ │ -Once the check is complete, the torrent will start connecting to peers again,
│ │ │ │ -as normal. The torrent will be placed last in queue, i.e. its queue position
│ │ │ │ -will be the highest of all torrents in the _s_e_s_s_i_o_n.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ssaavvee__rreessuummee__ddaattaa(()) ggeett__rreessuummee__ddaattaa(()) **********
│ │ │ │ -void ssaavvee__rreessuummee__ddaattaa (resume_data_flags_t flags = {}) const;
│ │ │ │ -add_torrent_params ggeett__rreessuummee__ddaattaa (resume_data_flags_t flags = {}) const;
│ │ │ │ -save_resume_data() and get_resume_data() asks libtorrent to generate fast-
│ │ │ │ -resume data for this torrent. The fast resume data (stored in an
│ │ │ │ -_a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s object) can be used to resume a torrent in the next _s_e_s_s_i_o_n
│ │ │ │ -without having to check all files for which pieces have been downloaded. It can
│ │ │ │ -also be used to save a .torrent file for a _t_o_r_r_e_n_t___h_a_n_d_l_e.
│ │ │ │ -`get_resume_data() is synchronous and will block the calling thread until the
│ │ │ │ -resume data is ready and returned from the libtorrent main thread. /
│ │ │ │ -save_resume_data() is asynchronous. It will return immediately and deliver the
│ │ │ │ -resume data is when it's done through a _s_a_v_e___r_e_s_u_m_e___d_a_t_a___a_l_e_r_t.
│ │ │ │ -The operation will fail, and post a _s_a_v_e___r_e_s_u_m_e___d_a_t_a___f_a_i_l_e_d___a_l_e_r_t instead, in
│ │ │ │ -the following cases:
│ │ │ │ - 1. The torrent is in the process of being removed.
│ │ │ │ - 2. No torrent state has changed since the last saving of resume
│ │ │ │ - data, and the only_if_modified flag is set. metadata (see
│ │ │ │ - libtorrent's _m_e_t_a_d_a_t_a_ _f_r_o_m_ _p_e_e_r_s extension)
│ │ │ │ -Note that some _c_o_u_n_t_e_r_s may be outdated by the time you receive the fast resume
│ │ │ │ -data
│ │ │ │ -When saving resume data because of shutting down, make sure not to
│ │ │ │ -_r_e_m_o_v_e___t_o_r_r_e_n_t_(_) before you receive the _s_a_v_e___r_e_s_u_m_e___d_a_t_a___a_l_e_r_t. There's no need
│ │ │ │ -to pause the _s_e_s_s_i_o_n or torrent when saving resume data.
│ │ │ │ -The paused state of a torrent is saved in the resume data, so pausing all
│ │ │ │ -torrents before saving resume data will all torrents be restored in a paused
│ │ │ │ -state.
│ │ │ │ -Note
│ │ │ │ -It is typically a good idea to save resume data whenever a torrent is completed
│ │ │ │ -or paused. If you save resume data for torrents when they are paused, you can
│ │ │ │ -accelerate the shutdown process by not saving resume data again for those
│ │ │ │ -torrents. Completed torrents should have their resume data saved when they
│ │ │ │ -complete and on exit, since their statistics might be updated.
│ │ │ │ -Example code to pause and save resume data for all torrents and wait for the
│ │ │ │ -alerts:
│ │ │ │ -extern int outstanding_resume_data; // global counter of outstanding resume
│ │ │ │ -data
│ │ │ │ -std::vector handles = ses.get_torrents();
│ │ │ │ -for (torrent_handle const& h : handles) try
│ │ │ │ -{
│ │ │ │ - h.save_resume_data(torrent_handle::only_if_modified);
│ │ │ │ - ++outstanding_resume_data;
│ │ │ │ -}
│ │ │ │ -catch (lt::system_error const& e)
│ │ │ │ -{
│ │ │ │ - // the handle was invalid, ignore this one and move to the next
│ │ │ │ -}
│ │ │ │ -
│ │ │ │ -while (outstanding_resume_data > 0)
│ │ │ │ -{
│ │ │ │ - // if we don't get an alert within 30 seconds, abort
│ │ │ │ - if (!ses.wait_for_alert(seconds(30))) break;
│ │ │ │ -
│ │ │ │ - std::vector alerts;
│ │ │ │ - ses.pop_alerts(&alerts);
│ │ │ │ -
│ │ │ │ - for (alert* i : alerts)
│ │ │ │ - {
│ │ │ │ - if (alert_cast(i))
│ │ │ │ - {
│ │ │ │ - process_alert(i);
│ │ │ │ - --outstanding_resume_data;
│ │ │ │ - continue;
│ │ │ │ - }
│ │ │ │ -
│ │ │ │ - save_resume_data_alert const* rd =
│ │ │ │ -alert_cast(i);
│ │ │ │ - if (rd == nullptr)
│ │ │ │ - {
│ │ │ │ - process_alert(i);
│ │ │ │ - continue;
│ │ │ │ - }
│ │ │ │ -
│ │ │ │ - std::ofstream out((rd->params.save_path
│ │ │ │ - + "/" + rd->params.name + ".fastresume").c_str()
│ │ │ │ - , std::ios_base::binary);
│ │ │ │ - std::vector buf = write_resume_data_buf(rd->params);
│ │ │ │ - out.write(buf.data(), buf.size());
│ │ │ │ - --outstanding_resume_data;
│ │ │ │ - }
│ │ │ │ -}
│ │ │ │ -Note
│ │ │ │ -Note how outstanding_resume_data is a global counter in this example. This is
│ │ │ │ -deliberate, otherwise there is a race condition for torrents that was just
│ │ │ │ -asked to save their resume data, they posted the _a_l_e_r_t, but it has not been
│ │ │ │ -received yet. Those torrents would report that they don't need to save resume
│ │ │ │ -data again, and skipped by the initial loop, and thwart the counter otherwise.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nneeeedd__ssaavvee__rreessuummee__ddaattaa(()) **********
│ │ │ │ -bool nneeeedd__ssaavvee__rreessuummee__ddaattaa (resume_data_flags_t flags) const;
│ │ │ │ -bool nneeeedd__ssaavvee__rreessuummee__ddaattaa () const;
│ │ │ │ -This function returns true if anything that is stored in the resume data has
│ │ │ │ -changed since the last time resume data was saved. The overload that takes
│ │ │ │ -flags let you ask if specific categories of properties have changed. These
│ │ │ │ -flags have the same behavior as in the _s_a_v_e___r_e_s_u_m_e___d_a_t_a_(_) call.
│ │ │ │ -This is a bblloocckkiinngg call. It will wait for a response from libtorrent's main
│ │ │ │ -thread. A way to avoid blocking is to instead call _s_a_v_e___r_e_s_u_m_e___d_a_t_a_(_) directly,
│ │ │ │ -specifying the conditions under which resume data should be saved.
│ │ │ │ -Note
│ │ │ │ -A torrent's resume data is considered saved as soon as the
│ │ │ │ -_s_a_v_e___r_e_s_u_m_e___d_a_t_a___a_l_e_r_t is posted. It is important to make sure this _a_l_e_r_t is
│ │ │ │ -received and handled in order for this function to be meaningful.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** qquueeuuee__ppoossiittiioonn__uupp(()) qquueeuuee__ppoossiittiioonn__ddoowwnn(()) qquueeuuee__ppoossiittiioonn(())
│ │ │ │ -qquueeuuee__ppoossiittiioonn__ttoopp(()) qquueeuuee__ppoossiittiioonn__bboottttoomm(()) **********
│ │ │ │ -void qquueeuuee__ppoossiittiioonn__ttoopp () const;
│ │ │ │ -void qquueeuuee__ppoossiittiioonn__ddoowwnn () const;
│ │ │ │ -queue_position_t qquueeuuee__ppoossiittiioonn () const;
│ │ │ │ -void qquueeuuee__ppoossiittiioonn__bboottttoomm () const;
│ │ │ │ -void qquueeuuee__ppoossiittiioonn__uupp () 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
│ │ │ │ -positions have their positions decreased to fill in the space in the sequence.
│ │ │ │ -queue_position() returns the torrent's position in the download queue. The
│ │ │ │ -torrents with the smallest numbers are the ones that are being downloaded. The
│ │ │ │ -smaller number, the closer the torrent is to the front of the line to be
│ │ │ │ -started.
│ │ │ │ -The queue position is also available in the _t_o_r_r_e_n_t___s_t_a_t_u_s.
│ │ │ │ -The queue_position_*() functions adjust the torrents position in the queue. Up
│ │ │ │ -means closer to the front and down means closer to the back of the queue. Top
│ │ │ │ -and bottom refers to the front and the back of the queue respectively.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** qquueeuuee__ppoossiittiioonn__sseett(()) **********
│ │ │ │ -void qquueeuuee__ppoossiittiioonn__sseett (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
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__ssssll__cceerrttiiffiiccaattee(()) sseett__ssssll__cceerrttiiffiiccaattee__bbuuffffeerr(()) **********
│ │ │ │ -void sseett__ssssll__cceerrttiiffiiccaattee__bbuuffffeerr (std::string const& certificate
│ │ │ │ - , std::string const& private_key
│ │ │ │ - , std::string const& dh_params);
│ │ │ │ -void sseett__ssssll__cceerrttiiffiiccaattee (std::string const& certificate
│ │ │ │ - , std::string const& private_key
│ │ │ │ - , std::string const& dh_params
│ │ │ │ - , std::string const& passphrase = "");
│ │ │ │ -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 _s_e_t___s_s_l___c_e_r_t_i_f_i_c_a_t_e___b_u_f_f_e_r_(_) 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.
│ │ │ │ -private_key is a path to the private key for the specified certificate. This
│ │ │ │ -must be in .pem format.
│ │ │ │ -dh_params is a path to the Diffie-Hellman parameter file, which needs to be in
│ │ │ │ -.pem format. You can generate this file using the openssl command like this:
│ │ │ │ -openssl dhparam -outform PEM -out dhparams.pem 512.
│ │ │ │ -passphrase may be specified if the private key is encrypted and requires a
│ │ │ │ -passphrase to be decrypted.
│ │ │ │ -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 _t_o_r_r_e_n_t___n_e_e_d___c_e_r_t___a_l_e_r_t, 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttoorrrreenntt__ffiillee(()) ttoorrrreenntt__ffiillee__wwiitthh__hhaasshheess(()) **********
│ │ │ │ -std::shared_ptr ttoorrrreenntt__ffiillee__wwiitthh__hhaasshheess () const;
│ │ │ │ -std::shared_ptr ttoorrrreenntt__ffiillee () const;
│ │ │ │ -_t_o_r_r_e_n_t___f_i_l_e_(_) returns a pointer to the _t_o_r_r_e_n_t___i_n_f_o object associated with
│ │ │ │ -this torrent. The _t_o_r_r_e_n_t___i_n_f_o 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 _t_o_r_r_e_n_t___i_n_f_o object returned here may be a different instance
│ │ │ │ -than the one added to the _s_e_s_s_i_o_n, with different attributes like piece layers,
│ │ │ │ -dht nodes and trackers. A _t_o_r_r_e_n_t___i_n_f_o object does not round-trip cleanly when
│ │ │ │ -added to a _s_e_s_s_i_o_n.
│ │ │ │ -If you want to save a .torrent file from the _t_o_r_r_e_n_t___h_a_n_d_l_e, instead call
│ │ │ │ -_s_a_v_e___r_e_s_u_m_e___d_a_t_a_(_) and _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_) the _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s object
│ │ │ │ -passed back in the _a_l_e_r_t.
│ │ │ │ -_t_o_r_r_e_n_t___f_i_l_e___w_i_t_h___h_a_s_h_e_s_(_) returns a ccooppyy of the internal _t_o_r_r_e_n_t___i_n_f_o and
│ │ │ │ -piece layer hashes (if it's a v2 torrent). The piece layers will only be
│ │ │ │ -included if they are available. If this torrent was added from a .torrent file
│ │ │ │ -with piece layers or if it's seeding, the piece layers are available. This
│ │ │ │ -function is more expensive than _t_o_r_r_e_n_t___f_i_l_e_(_) since it needs to make copies of
│ │ │ │ -this information.
│ │ │ │ -The _t_o_r_r_e_n_t___f_i_l_e___w_i_t_h___h_a_s_h_e_s_(_) is here for backwards compatibility when
│ │ │ │ -constructing a _c_r_e_a_t_e___t_o_r_r_e_n_t object from a _t_o_r_r_e_n_t___i_n_f_o that's in a _s_e_s_s_i_o_n.
│ │ │ │ -Prefer _s_a_v_e___r_e_s_u_m_e___d_a_t_a_(_) + _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_).
│ │ │ │ -Note that a torrent added from a magnet link may not have the full merkle trees
│ │ │ │ -for all files, and hence not have the complete piece layers. In that state, you
│ │ │ │ -cannot create a .torrent file even from the _t_o_r_r_e_n_t___i_n_f_o returned from
│ │ │ │ -_t_o_r_r_e_n_t___f_i_l_e___w_i_t_h___h_a_s_h_e_s_(_). Once the torrent completes downloading all files,
│ │ │ │ -becoming a seed, you can make a .torrent file from it.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__llaayyeerrss(()) **********
│ │ │ │ -std::vector> ppiieeccee__llaayyeerrss () const;
│ │ │ │ -returns the piece layers for all files in the torrent. If this is a v1 torrent
│ │ │ │ -(and doesn't have any piece layers) it returns an empty vector. This is a
│ │ │ │ -blocking call that will synchronize with the libtorrent network thread.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__aavvaaiillaabbiilliittyy(()) ppoosstt__ppiieeccee__aavvaaiillaabbiilliittyy(()) **********
│ │ │ │ -void ppiieeccee__aavvaaiillaabbiilliittyy (std::vector& avail) const;
│ │ │ │ -void ppoosstt__ppiieeccee__aavvaaiillaabbiilliittyy () const;
│ │ │ │ -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.
│ │ │ │ -post_piece_availability() will trigger a _p_i_e_c_e___a_v_a_i_l_a_b_i_l_i_t_y___a_l_e_r_t to be posted.
│ │ │ │ -piece_availability() fills the specified std::vector with the availability
│ │ │ │ -for each piece in 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__pprriioorriittyy(()) ggeett__ppiieeccee__pprriioorriittiieess(()) pprriioorriittiizzee__ppiieecceess(()) **********
│ │ │ │ -void ppiieeccee__pprriioorriittyy (piece_index_t index, download_priority_t priority) const;
│ │ │ │ -void pprriioorriittiizzee__ppiieecceess (std::vector> const& pieces) const;
│ │ │ │ -void pprriioorriittiizzee__ppiieecceess (std::vector const& pieces) const;
│ │ │ │ -download_priority_t ppiieeccee__pprriioorriittyy (piece_index_t index) const;
│ │ │ │ -std::vector ggeett__ppiieeccee__pprriioorriittiieess () 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
│ │ │ │ -piece with priority 7 will be attempted to be picked before a priority 6 piece
│ │ │ │ -and so on.
│ │ │ │ -The default priority of pieces is 4.
│ │ │ │ -Piece priorities can not be changed for torrents that have not downloaded the
│ │ │ │ -metadata yet. Magnet links won't have metadata immediately. see the
│ │ │ │ -_m_e_t_a_d_a_t_a___r_e_c_e_i_v_e_d___a_l_e_r_t.
│ │ │ │ -piece_priority sets or gets the priority for an individual piece, specified by
│ │ │ │ -index.
│ │ │ │ -prioritize_pieces takes a vector of integers, one integer per piece in the
│ │ │ │ -torrent. All the piece priorities will be updated with the priorities in the
│ │ │ │ -vector. The second overload of prioritize_pieces that takes a vector of pairs
│ │ │ │ -will update the priorities of only select pieces, and leave all other
│ │ │ │ -unaffected. Each pair is (piece, priority). That is, the first item is the
│ │ │ │ -piece index and the second item is the priority of that piece. Invalid entries,
│ │ │ │ -where the piece index or priority is out of range, are not allowed.
│ │ │ │ -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 ffiillee priorities by setting the priorities
│ │ │ │ -for the affected pieces. Care has to be taken when mixing usage of file- and
│ │ │ │ -piece priorities.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett__ffiillee__pprriioorriittiieess(()) pprriioorriittiizzee__ffiilleess(()) ffiillee__pprriioorriittyy(()) **********
│ │ │ │ -void pprriioorriittiizzee__ffiilleess (std::vector const& files) const;
│ │ │ │ -std::vector ggeett__ffiillee__pprriioorriittiieess () const;
│ │ │ │ -void ffiillee__pprriioorriittyy (file_index_t index, download_priority_t priority) const;
│ │ │ │ -download_priority_t ffiillee__pprriioorriittyy (file_index_t index) 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 _e_n_t_r_y 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 _p_i_e_c_e___p_r_i_o_r_i_t_y_(_). See
│ │ │ │ -_d_o_w_n_l_o_a_d___p_r_i_o_r_i_t_y___t.
│ │ │ │ -Whenever a file priority is changed, all other piece priorities are reset to
│ │ │ │ -match the file priorities. In order to maintain special priorities for
│ │ │ │ -particular pieces, _p_i_e_c_e___p_r_i_o_r_i_t_y_(_) has to be called again for those pieces.
│ │ │ │ -You cannot set the file priorities on a torrent that does not yet have metadata
│ │ │ │ -or a torrent that is a seed. file_priority(int, int) and _p_r_i_o_r_i_t_i_z_e___f_i_l_e_s_(_) are
│ │ │ │ -both no-ops for such torrents.
│ │ │ │ -Since changing file priorities may involve disk operations (of moving files in-
│ │ │ │ -and out of the part file), the internal accounting of file priorities happen
│ │ │ │ -asynchronously. i.e. setting file priorities and then immediately querying them
│ │ │ │ -may not yield the same priorities just set. To synchronize with the priorities
│ │ │ │ -taking effect, wait for the _f_i_l_e___p_r_i_o___a_l_e_r_t.
│ │ │ │ -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 aafftteerr it has already been created, it will not
│ │ │ │ -be moved into the partfile.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffoorrccee__rreeaannnnoouunnccee(()) ffoorrccee__llssdd__aannnnoouunnccee(()) ffoorrccee__ddhhtt__aannnnoouunnccee(()) **********
│ │ │ │ -void ffoorrccee__ddhhtt__aannnnoouunnccee () const;
│ │ │ │ -void ffoorrccee__rreeaannnnoouunnccee (int seconds = 0, int idx = -1, reannounce_flags_t = {})
│ │ │ │ -const;
│ │ │ │ -void ffoorrccee__llssdd__aannnnoouunnccee () 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 -
│ │ │ │ -1 (which is the default), all trackers are re-announce.
│ │ │ │ -The flags argument can be used to affect the re-announce. See
│ │ │ │ -ignore_min_interval and high_priority.
│ │ │ │ -force_dht_announce will announce the torrent to the DHT immediately.
│ │ │ │ -force_lsd_announce will announce the torrent on LSD immediately.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ssccrraappee__ttrraacckkeerr(()) **********
│ │ │ │ -void ssccrraappee__ttrraacckkeerr (int idx = -1) const;
│ │ │ │ -scrape_tracker() will send a scrape request to a tracker. By default (idx = -1)
│ │ │ │ -it will scrape the last working tracker. If idx is >= 0, the tracker with the
│ │ │ │ -specified index will scraped.
│ │ │ │ -A scrape request queries the tracker for statistics such as total number of
│ │ │ │ -incomplete peers, complete peers, number of downloads etc.
│ │ │ │ -This request will specifically update the num_complete and num_incomplete
│ │ │ │ -fields in the _t_o_r_r_e_n_t___s_t_a_t_u_s struct once it completes. When it completes, it
│ │ │ │ -will generate a _s_c_r_a_p_e___r_e_p_l_y___a_l_e_r_t. If it fails, it will generate a
│ │ │ │ -_s_c_r_a_p_e___f_a_i_l_e_d___a_l_e_r_t.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** uuppllooaadd__lliimmiitt(()) ddoowwnnllooaadd__lliimmiitt(()) sseett__uuppllooaadd__lliimmiitt(()) sseett__ddoowwnnllooaadd__lliimmiitt(())
│ │ │ │ -**********
│ │ │ │ -int ddoowwnnllooaadd__lliimmiitt () const;
│ │ │ │ -int uuppllooaadd__lliimmiitt () const;
│ │ │ │ -void sseett__uuppllooaadd__lliimmiitt (int limit) const;
│ │ │ │ -void sseett__ddoowwnnllooaadd__lliimmiitt (int 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.
│ │ │ │ -upload_limit and download_limit will return the current limit setting, for
│ │ │ │ -upload and download, respectively.
│ │ │ │ -Local peers are not rate limited by default. see _p_e_e_r_ _c_l_a_s_s_e_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ccoonnnneecctt__ppeeeerr(()) **********
│ │ │ │ -void ccoonnnneecctt__ppeeeerr (tcp::endpoint const& adr, peer_source_flags_t source = {}
│ │ │ │ - , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;
│ │ │ │ -connect_peer() is a way to manually connect to peers that one believe is a part
│ │ │ │ -of the torrent. If the peer does not respond, or is not a member of this
│ │ │ │ -torrent, it will simply be disconnected. No harm can be done by using this
│ │ │ │ -other than an unnecessary connection attempt is made. If the torrent is
│ │ │ │ -uninitialized or in queued or checking mode, this will throw system_error. The
│ │ │ │ -second (optional) argument will be bitwise ORed into the source mask of this
│ │ │ │ -peer. Typically this is one of the source flags in _p_e_e_r___i_n_f_o. i.e. tracker,
│ │ │ │ -pex, dht etc.
│ │ │ │ -For possible values of flags, see _p_e_x___f_l_a_g_s___t.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** cclleeaarr__ppeeeerrss(()) **********
│ │ │ │ -void cclleeaarr__ppeeeerrss ();
│ │ │ │ -This will disconnect all peers and clear the peer list for this torrent. New
│ │ │ │ -peers will have to be acquired before resuming, from trackers, DHT or local
│ │ │ │ -service discovery, for example.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** mmaaxx__uuppllooaaddss(()) sseett__mmaaxx__uuppllooaaddss(()) **********
│ │ │ │ -void sseett__mmaaxx__uuppllooaaddss (int max_uploads) const;
│ │ │ │ -int mmaaxx__uuppllooaaddss () 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 _s_e_t_t_i_n_g_s___p_a_c_k.
│ │ │ │ -max_uploads() returns the current settings.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** mmaaxx__ccoonnnneeccttiioonnss(()) sseett__mmaaxx__ccoonnnneeccttiioonnss(()) **********
│ │ │ │ -void sseett__mmaaxx__ccoonnnneeccttiioonnss (int max_connections) const;
│ │ │ │ -int mmaaxx__ccoonnnneeccttiioonnss () 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
│ │ │ │ -connections_limit in _s_e_t_t_i_n_g_s___p_a_c_k.
│ │ │ │ -max_connections() returns the current settings.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** mmoovvee__ssttoorraaggee(()) **********
│ │ │ │ -void mmoovvee__ssttoorraaggee (std::string const& save_path
│ │ │ │ - , move_flags_t flags = move_flags_t::always_replace_files
│ │ │ │ - ) const;
│ │ │ │ -Moves the file(s) that this torrent are currently seeding from or downloading
│ │ │ │ -to. If the given save_path is not located on the same drive as the original
│ │ │ │ -save path, the files will be copied to the new drive and removed from their
│ │ │ │ -original location. This will block all other disk IO, and other torrents
│ │ │ │ -download and upload rates may drop while copying the file.
│ │ │ │ -Since disk IO is performed in a separate thread, this operation is also
│ │ │ │ -asynchronous. Once the operation completes, the storage_moved_alert is
│ │ │ │ -generated, with the new path as the message. If the move fails for some reason,
│ │ │ │ -storage_moved_failed_alert is generated instead, containing the error message.
│ │ │ │ -The flags argument determines the behavior of the copying/moving of the files
│ │ │ │ -in the torrent. see _m_o_v_e___f_l_a_g_s___t.
│ │ │ │ -always_replace_files is the default and replaces any file that exist in both
│ │ │ │ -the source directory and the target directory.
│ │ │ │ -fail_if_exist first check to see that none of the copy operations would cause
│ │ │ │ -an overwrite. If it would, it will fail. Otherwise it will proceed as if it was
│ │ │ │ -in always_replace_files mode. Note that there is an inherent race condition
│ │ │ │ -here. If the files in the target directory appear after the check but before
│ │ │ │ -the copy or move completes, they will be overwritten. When failing because of
│ │ │ │ -files already existing in the target path, the error of
│ │ │ │ -move_storage_failed_alert is set to boost::system::errc::file_exists.
│ │ │ │ -The intention is that a client may use this as a probe, and if it fails, ask
│ │ │ │ -the user which mode to use. The client may then re-issue the move_storage call
│ │ │ │ -with one of the other modes.
│ │ │ │ -dont_replace always keeps the existing file in the target directory, if there
│ │ │ │ -is one. The source files will still be removed in that case. Note that it won't
│ │ │ │ -automatically re-check files. If an incomplete torrent is moved into a
│ │ │ │ -directory with the complete files, pause, move, force-recheck and resume.
│ │ │ │ -Without the re-checking, the torrent will keep downloading and files in the new
│ │ │ │ -download directory will be overwritten.
│ │ │ │ -Files that have been renamed to have absolute paths are not moved by this
│ │ │ │ -function. Keep in mind that files that don't belong to the torrent but are
│ │ │ │ -stored in the torrent's directory may be moved as well. This goes for files
│ │ │ │ -that have been renamed to absolute paths that still end up inside the save
│ │ │ │ -path.
│ │ │ │ -When copying files, sparse regions are not likely to be preserved. This makes
│ │ │ │ -it proportionally more expensive to move a large torrent when only few pieces
│ │ │ │ -have been downloaded, since the files are then allocated with zeros in the
│ │ │ │ -destination directory.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreennaammee__ffiillee(()) **********
│ │ │ │ -void rreennaammee__ffiillee (file_index_t index, std::string const& new_name) const;
│ │ │ │ -Renames the file with the given index asynchronously. The rename operation is
│ │ │ │ -complete when either a _f_i_l_e___r_e_n_a_m_e_d___a_l_e_r_t or _f_i_l_e___r_e_n_a_m_e___f_a_i_l_e_d___a_l_e_r_t is
│ │ │ │ -posted.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iinnffoo__hhaasshheess(()) iinnffoo__hhaasshh(()) **********
│ │ │ │ -sha1_hash iinnffoo__hhaasshh () const;
│ │ │ │ -info_hash_t iinnffoo__hhaasshheess () 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ooppeerraattoorr<<(()) ooppeerraattoorr====(()) ooppeerraattoorr!!==(()) **********
│ │ │ │ -bool ooppeerraattoorr<< (const torrent_handle& h) const;
│ │ │ │ -bool ooppeerraattoorr!!== (const torrent_handle& h) const;
│ │ │ │ -bool ooppeerraattoorr==== (const torrent_handle& h) const;
│ │ │ │ -comparison operators. The order of the torrents is unspecified but stable.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iidd(()) **********
│ │ │ │ -std::uint32_t iidd () const;
│ │ │ │ -returns a unique identifier for this torrent. It's not a dense index. It's not
│ │ │ │ -preserved across sessions.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnaattiivvee__hhaannddllee(()) **********
│ │ │ │ -std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ -This function is intended only for use by plugins and the _a_l_e_r_t dispatch
│ │ │ │ -function. This type does not have a stable ABI and should be relied on as
│ │ │ │ -little as possible. Accessing the handle returned by this function is not
│ │ │ │ -thread safe outside of libtorrent's internal thread (which is used to invoke
│ │ │ │ -_p_l_u_g_i_n callbacks). The torrent class is not only eligible for changing ABI
│ │ │ │ -across minor versions of libtorrent, its layout is also dependent on build
│ │ │ │ -configuration. This adds additional requirements on a client to be built with
│ │ │ │ -the exact same build configuration as libtorrent itself. i.e. the TORRENT_
│ │ │ │ -macros must match between libtorrent and the client builds.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** uusseerrddaattaa(()) **********
│ │ │ │ -client_data_t uusseerrddaattaa () const;
│ │ │ │ -returns the userdata pointer as set in _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iinn__sseessssiioonn(()) **********
│ │ │ │ -bool iinn__sseessssiioonn () const;
│ │ │ │ -Returns true if the torrent is in the _s_e_s_s_i_o_n. It returns true before session::
│ │ │ │ -remove_torrent() is called, and false afterward.
│ │ │ │ -Note that this is a blocking function, unlike _t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_i_s___v_a_l_i_d_(_) which
│ │ │ │ -returns immediately.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - overwrite_existing
│ │ │ │ - instruct libtorrent to overwrite any data that may already have been
│ │ │ │ - downloaded with the data of the new piece being added. Using this flag
│ │ │ │ - when adding a piece that is actively being downloaded from other peers
│ │ │ │ - may have some unexpected consequences, as blocks currently being
│ │ │ │ - downloaded from peers may not be replaced.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - query_distributed_copies
│ │ │ │ - calculates distributed_copies, distributed_full_copies and
│ │ │ │ - distributed_fraction.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - query_accurate_download_counters
│ │ │ │ - includes partial downloaded blocks in total_done and total_wanted_done.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - query_last_seen_complete
│ │ │ │ - includes last_seen_complete.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - query_pieces
│ │ │ │ - populate the pieces field in _t_o_r_r_e_n_t___s_t_a_t_u_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - query_verified_pieces
│ │ │ │ - includes verified_pieces (only applies to torrents in sseeeedd mmooddee).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - query_torrent_file
│ │ │ │ - includes torrent_file, which is all the static information from the
│ │ │ │ - .torrent file.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - query_name
│ │ │ │ - includes name, the name of the torrent. This is either derived from the
│ │ │ │ - .torrent file, or from the &dn= magnet link argument or possibly some
│ │ │ │ - other source. If the name of the torrent is not known, this is an empty
│ │ │ │ - string.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - query_save_path
│ │ │ │ - includes save_path, the path to the directory the files of the torrent
│ │ │ │ - are saved to.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - alert_when_available
│ │ │ │ - used to ask libtorrent to send an _a_l_e_r_t once the piece has been
│ │ │ │ - downloaded, by passing alert_when_available. When set, the
│ │ │ │ - _r_e_a_d___p_i_e_c_e___a_l_e_r_t _a_l_e_r_t will be delivered, with the piece data, when it's
│ │ │ │ - downloaded.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - piece_granularity
│ │ │ │ - only calculate file progress at piece granularity. This makes the
│ │ │ │ - _f_i_l_e___p_r_o_g_r_e_s_s_(_) call cheaper and also only takes bytes that have passed
│ │ │ │ - the hash check into account, so progress cannot regress in this mode.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - graceful_pause
│ │ │ │ - will delay the disconnect of peers that we're still downloading
│ │ │ │ - outstanding requests from. The torrent will not accept any more requests
│ │ │ │ - and will disconnect all idle peers. As soon as a peer is done
│ │ │ │ - transferring the blocks that were requested from it, it is disconnected.
│ │ │ │ - This is a graceful shut down of the torrent in the sense that no
│ │ │ │ - downloaded bytes are wasted.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - flush_disk_cache
│ │ │ │ - the disk cache will be flushed before creating the resume data. This
│ │ │ │ - avoids a problem with file timestamps in the resume data in case the
│ │ │ │ - cache hasn't been flushed yet.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - save_info_dict
│ │ │ │ - the resume data will contain the metadata from the torrent file as well.
│ │ │ │ - This is useful for clients that don't keep .torrent files around
│ │ │ │ - separately, or for torrents that were added via a magnet link.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - only_if_modified
│ │ │ │ - this flag has the same behavior as the combination of:
│ │ │ │ - if_counters_changed | if_download_progress | if_config_changed |
│ │ │ │ - if_state_changed | if_metadata_changed
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - if_counters_changed
│ │ │ │ - save resume data if any _c_o_u_n_t_e_r_s has changed since the last time resume
│ │ │ │ - data was saved. This includes upload/download _c_o_u_n_t_e_r_s, active time
│ │ │ │ - _c_o_u_n_t_e_r_s and scrape data. A torrent that is not paused will have its
│ │ │ │ - active time _c_o_u_n_t_e_r_s incremented continuously.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - if_download_progress
│ │ │ │ - save the resume data if any blocks have been downloaded since the last
│ │ │ │ - time resume data was saved. This includes: * checking existing files on
│ │ │ │ - disk * downloading a block from a peer
│ │ │ │ + message
│ │ │ │ + if this tracker has returned an error or warning message that message is
│ │ │ │ + stored here
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - if_config_changed
│ │ │ │ - save the resume data if configuration options changed since last time the
│ │ │ │ - resume data was saved. This includes: * file- or piece priorities *
│ │ │ │ - upload- and download rate limits * change max-uploads (unchoke slots) *
│ │ │ │ - change max connection limit * enable/disable peer-exchange, local service
│ │ │ │ - discovery or DHT * enable/disable apply IP-filter * enable/disable auto-
│ │ │ │ - managed * enable/disable share-mode * enable/disable sequential-mode *
│ │ │ │ - files renamed * storage moved (save_path changed)
│ │ │ │ + last_error
│ │ │ │ + if this tracker failed the last time it was contacted this error code
│ │ │ │ + specifies what error occurred
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - if_state_changed
│ │ │ │ - save the resume data if torrent state has changed since last time the
│ │ │ │ - resume data was saved. This includes: * upload mode * paused state *
│ │ │ │ - super-seeding * seed-mode
│ │ │ │ + scrape_incomplete scrape_complete scrape_downloaded
│ │ │ │ + if this tracker has returned scrape data, these fields are filled in with
│ │ │ │ + valid numbers. Otherwise they are set to -1. incomplete counts the number
│ │ │ │ + of current downloaders. complete counts the number of current peers
│ │ │ │ + completed the download, or "seeds". downloaded is the cumulative number
│ │ │ │ + of completed downloads.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - if_metadata_changed
│ │ │ │ - save the resume data if any mmeettaaddaattaa changed since the last time resume
│ │ │ │ - data was saved. This includes: * add/remove web seeds * add/remove
│ │ │ │ - trackers * receiving metadata for a magnet link
│ │ │ │ + fails
│ │ │ │ + the number of times in a row we have failed to announce to this tracker.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - ignore_min_interval
│ │ │ │ - by default, force-reannounce will still honor the min-interval published
│ │ │ │ - by the tracker. If this flag is set, it will be ignored and the tracker
│ │ │ │ - is announced immediately.
│ │ │ │ + updating
│ │ │ │ + true while we're waiting for a response from the tracker.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - high_priority
│ │ │ │ - by default, force-reannounce will queue the announce normally. If this
│ │ │ │ - flag is set, the announce will be put at the front of the tracker queue
│ │ │ │ - for immediate processing.
│ │ │ │ + start_sent
│ │ │ │ + set to true when we get a valid response from an announce with
│ │ │ │ + event=started. If it is set, we won't send start in the subsequent
│ │ │ │ + announces.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ hhaasshh__vvaalluuee(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -std::size_t hhaasshh__vvaalluuee (torrent_handle const& h);
│ │ │ │ -for std::hash (and to support using this type in unordered_map etc.)
│ │ │ │ + complete_sent
│ │ │ │ + set to true when we send a event=completed.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ssttoorraaggee__ppaarraammss ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_t_o_r_a_g_e___d_e_f_s_._h_p_p"
│ │ │ │ -a parameter pack used to construct the storage for a torrent, used in
│ │ │ │ -_d_i_s_k___i_n_t_e_r_f_a_c_e
│ │ │ │ -struct storage_params
│ │ │ │ +************ aannnnoouunnccee__eennddppooiinntt ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_a_n_n_o_u_n_c_e___e_n_t_r_y_._h_p_p"
│ │ │ │ +announces are sent to each tracker using every listen socket this class holds
│ │ │ │ +information about one listen socket for one tracker
│ │ │ │ +struct announce_endpoint
│ │ │ │ {
│ │ │ │ - ssttoorraaggee__ppaarraammss (file_storage const& f, file_storage const* mf
│ │ │ │ - , std::string const& sp, storage_mode_t const sm
│ │ │ │ - , aux::vector const& prio
│ │ │ │ - , sha1_hash const& ih);
│ │ │ │ + aannnnoouunnccee__eennddppooiinntt ();
│ │ │ │
│ │ │ │ - file_storage const& files;
│ │ │ │ - file_storage const* mmaappppeedd__ffiilleess = nullptr;
│ │ │ │ - std::string const& path;
│ │ │ │ - storage_mode_t mmooddee {storage_mode_sparse};
│ │ │ │ - aux::vector const& priorities;
│ │ │ │ - sha1_hash info_hash;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ffiillee__sslliiccee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_f_i_l_e___s_t_o_r_a_g_e_._h_p_p"
│ │ │ │ -represents a window of a file in a torrent.
│ │ │ │ -The file_index refers to the index of the file (in the _t_o_r_r_e_n_t___i_n_f_o). To get
│ │ │ │ -the path and filename, use file_path() and give the file_index as argument. The
│ │ │ │ -offset is the byte offset in the file where the range starts, and size is the
│ │ │ │ -number of bytes this range is. The size + offset will never be greater than the
│ │ │ │ -file size.
│ │ │ │ -struct file_slice
│ │ │ │ -{
│ │ │ │ - file_index_t file_index;
│ │ │ │ - std::int64_t offset;
│ │ │ │ - std::int64_t size;
│ │ │ │ + _t_c_p_:_:_e_n_d_p_o_i_n_t local_endpoint;
│ │ │ │ + aux::array info_hashes;
│ │ │ │ + bool eennaabblleedd = true;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - file_index
│ │ │ │ - the index of the file
│ │ │ │ + local_endpoint
│ │ │ │ + the local endpoint of the listen interface associated with this endpoint
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - offset
│ │ │ │ - the offset from the start of the file, in bytes
│ │ │ │ + info_hashes
│ │ │ │ + info_hashes[0] is the v1 info hash (SHA1) info_hashes[1] is the v2 info
│ │ │ │ + hash (truncated SHA-256)
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - size
│ │ │ │ - the size of the window, in bytes
│ │ │ │ + enabled
│ │ │ │ + set to false to not announce from this endpoint
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ffiillee__ssttoorraaggee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_f_i_l_e___s_t_o_r_a_g_e_._h_p_p"
│ │ │ │ -The file_storage class represents a file list and the piece size. Everything
│ │ │ │ -necessary to interpret a regular bittorrent storage file structure.
│ │ │ │ -class file_storage
│ │ │ │ +************ aannnnoouunnccee__eennttrryy ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_a_n_n_o_u_n_c_e___e_n_t_r_y_._h_p_p"
│ │ │ │ +this class holds information about one bittorrent tracker, as it relates to a
│ │ │ │ +specific torrent.
│ │ │ │ +struct announce_entry
│ │ │ │ {
│ │ │ │ - bool iiss__vvaalliidd () const;
│ │ │ │ - void rreesseerrvvee (int num_files);
│ │ │ │ - void aadddd__ffiillee__bboorrrrooww (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 aadddd__ffiillee (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 aadddd__ffiillee (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 aadddd__ffiillee__bboorrrrooww (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 rreennaammee__ffiillee (file_index_t index, std::string const& new_filename);
│ │ │ │ - std::vector mmaapp__bblloocckk (piece_index_t piece, std::int64_t offset
│ │ │ │ - , std::int64_t size) const;
│ │ │ │ - peer_request mmaapp__ffiillee (file_index_t file, std::int64_t offset, int size)
│ │ │ │ -const;
│ │ │ │ - int nnuumm__ffiilleess () const noexcept;
│ │ │ │ - file_index_t eenndd__ffiillee () const noexcept;
│ │ │ │ - index_range ffiillee__rraannggee () const noexcept;
│ │ │ │ - std::int64_t ttoottaall__ssiizzee () const;
│ │ │ │ - void sseett__nnuumm__ppiieecceess (int n);
│ │ │ │ - int nnuumm__ppiieecceess () const;
│ │ │ │ - piece_index_t eenndd__ppiieeccee () const;
│ │ │ │ - piece_index_t llaasstt__ppiieeccee () const;
│ │ │ │ - index_range ppiieeccee__rraannggee () const noexcept;
│ │ │ │ - int ppiieeccee__lleennggtthh () const;
│ │ │ │ - void sseett__ppiieeccee__lleennggtthh (int l);
│ │ │ │ - int ppiieeccee__ssiizzee (piece_index_t index) const;
│ │ │ │ - int ppiieeccee__ssiizzee22 (piece_index_t index) const;
│ │ │ │ - int bblloocckkss__iinn__ppiieeccee22 (piece_index_t index) const;
│ │ │ │ - int bblloocckkss__ppeerr__ppiieeccee () const;
│ │ │ │ - void sseett__nnaammee (std::string const& n);
│ │ │ │ - std::string const& nnaammee () const;
│ │ │ │ - void sswwaapp (file_storage& ti) noexcept;
│ │ │ │ - void ccaannoonniiccaalliizzee ();
│ │ │ │ - char const* rroooott__ppttrr (file_index_t const index) const;
│ │ │ │ - std::string ssyymmlliinnkk (file_index_t index) const;
│ │ │ │ - std::string ffiillee__ppaatthh (file_index_t index, std::string const& save_path =
│ │ │ │ -"") const;
│ │ │ │ - sha256_hash rroooott (file_index_t index) const;
│ │ │ │ - bool ppaadd__ffiillee__aatt (file_index_t index) const;
│ │ │ │ - std::time_t mmttiimmee (file_index_t index) const;
│ │ │ │ - std::int64_t ffiillee__ooffffsseett (file_index_t index) const;
│ │ │ │ - string_view ffiillee__nnaammee (file_index_t index) const;
│ │ │ │ - sha1_hash hhaasshh (file_index_t index) const;
│ │ │ │ - std::int64_t ffiillee__ssiizzee (file_index_t index) const;
│ │ │ │ - index_range ffiillee__ppiieeccee__rraannggee (file_index_t) const;
│ │ │ │ - int ffiillee__nnuumm__bblloocckkss (file_index_t index) const;
│ │ │ │ - int ffiillee__nnuumm__ppiieecceess (file_index_t index) const;
│ │ │ │ - int ffiillee__ffiirrsstt__bblloocckk__nnooddee (file_index_t index) const;
│ │ │ │ - int ffiillee__ffiirrsstt__ppiieeccee__nnooddee (file_index_t index) const;
│ │ │ │ - std::uint32_t ffiillee__ppaatthh__hhaasshh (file_index_t index, std::string const&
│ │ │ │ -save_path) const;
│ │ │ │ - void aallll__ppaatthh__hhaasshheess (std::unordered_set& table) const;
│ │ │ │ - file_flags_t ffiillee__ffllaaggss (file_index_t index) const;
│ │ │ │ - bool ffiillee__aabbssoolluuttee__ppaatthh (file_index_t index) const;
│ │ │ │ - file_index_t ffiillee__iinnddeexx__aatt__ppiieeccee (piece_index_t piece) const;
│ │ │ │ - file_index_t ffiillee__iinnddeexx__aatt__ooffffsseett (std::int64_t offset) const;
│ │ │ │ - file_index_t ffiillee__iinnddeexx__ffoorr__rroooott (sha256_hash const& root_hash) const;
│ │ │ │ - piece_index_t ppiieeccee__iinnddeexx__aatt__ffiillee (file_index_t f) const;
│ │ │ │ - void ssaanniittiizzee__ssyymmlliinnkkss ();
│ │ │ │ - bool vv22 () const;
│ │ │ │ + aannnnoouunnccee__eennttrryy ();
│ │ │ │ + explicit aannnnoouunnccee__eennttrryy (string_view u);
│ │ │ │ + aannnnoouunnccee__eennttrryy (announce_entry const&);
│ │ │ │ + ~~aannnnoouunnccee__eennttrryy ();
│ │ │ │ + announce_entry& ooppeerraattoorr== (announce_entry const&) &;
│ │ │ │
│ │ │ │ - static constexpr file_flags_t ffllaagg__ppaadd__ffiillee = 0_bit;
│ │ │ │ - static constexpr file_flags_t ffllaagg__hhiiddddeenn = 1_bit;
│ │ │ │ - static constexpr file_flags_t ffllaagg__eexxeeccuuttaabbllee = 2_bit;
│ │ │ │ - static constexpr file_flags_t ffllaagg__ssyymmlliinnkk = 3_bit;
│ │ │ │ + enum tracker_source
│ │ │ │ + {
│ │ │ │ + source_torrent,
│ │ │ │ + source_client,
│ │ │ │ + source_magnet_link,
│ │ │ │ + source_tex,
│ │ │ │ + };
│ │ │ │ +
│ │ │ │ + std::string url;
│ │ │ │ + std::string trackerid;
│ │ │ │ + std::vector endpoints;
│ │ │ │ + std::uint8_t ttiieerr = 0;
│ │ │ │ + std::uint8_t ffaaiill__lliimmiitt = 0;
│ │ │ │ + std::uint8_t source:4;
│ │ │ │ + bool verified:1;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iiss__vvaalliidd(()) **********
│ │ │ │ -bool iiss__vvaalliidd () const;
│ │ │ │ -returns true if the piece length has been initialized on the _f_i_l_e___s_t_o_r_a_g_e. This
│ │ │ │ -is typically taken as a proxy of whether the _f_i_l_e___s_t_o_r_a_g_e as a whole is
│ │ │ │ -initialized or not.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreesseerrvvee(()) **********
│ │ │ │ -void rreesseerrvvee (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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__ffiillee__bboorrrrooww(()) aadddd__ffiillee(()) **********
│ │ │ │ -void aadddd__ffiillee__bboorrrrooww (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 aadddd__ffiillee (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 aadddd__ffiillee (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 aadddd__ffiillee__bboorrrrooww (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 bboorrrroowweedd, i.e. it is the caller's responsibility to make sure it
│ │ │ │ -stays valid throughout the lifetime of this _f_i_l_e___s_t_o_r_a_g_e 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.
│ │ │ │ -The path argument is the full path (in the torrent file) to the file to add.
│ │ │ │ -Note that this is not supposed to be an absolute path, but it is expected to
│ │ │ │ -include the name of the torrent as the first path element.
│ │ │ │ -file_size is the size of the file in bytes.
│ │ │ │ -The file_flags argument sets attributes on the file. The file attributes is an
│ │ │ │ -extension and may not work in all bittorrent clients.
│ │ │ │ -For possible file attributes, see file_storage::flags_t.
│ │ │ │ -The mtime argument is optional and can be set to 0. If non-zero, it is the
│ │ │ │ -posix time of the last modification time of this file.
│ │ │ │ -symlink_path is the path the file is a symlink to. To make this a symlink you
│ │ │ │ -also need to set the _f_i_l_e___s_t_o_r_a_g_e_:_:_f_l_a_g___s_y_m_l_i_n_k file flag.
│ │ │ │ -root_hash is an optional pointer to a 32 byte SHA-256 hash, being the merkle
│ │ │ │ -tree root hash for this file. This is only used for v2 torrents. If the root
│ │ │ │ -hash is specified for one file, it has to be specified for all, otherwise this
│ │ │ │ -function will fail. Note that the buffer root_hash points to must out-live the
│ │ │ │ -_f_i_l_e___s_t_o_r_a_g_e object, it will not be copied. This parameter is only used when
│ │ │ │ -llooaaddiinngg torrents, that already have their file hashes computed. When creating
│ │ │ │ -torrents, the file hashes will be computed by the piece hashes.
│ │ │ │ -If more files than one are added, certain restrictions to their paths apply. In
│ │ │ │ -a multi-file file storage (torrent), all files must share the same root
│ │ │ │ -directory.
│ │ │ │ -That is, the first path element of all files must be the same. This shared path
│ │ │ │ -element is also set to the name of the torrent. It can be changed by calling
│ │ │ │ -set_name.
│ │ │ │ -The overloads that take anerror_codereference will report failures via that
│ │ │ │ -variable, otherwisesystem_erroris thrown.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreennaammee__ffiillee(()) **********
│ │ │ │ -void rreennaammee__ffiillee (file_index_t index, std::string const& new_filename);
│ │ │ │ -renames the file at index to new_filename. Keep in mind that filenames are
│ │ │ │ -expected to be UTF-8 encoded.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** mmaapp__bblloocckk(()) **********
│ │ │ │ -std::vector mmaapp__bblloocckk (piece_index_t piece, std::int64_t offset
│ │ │ │ - , std::int64_t size) const;
│ │ │ │ -returns a list of _f_i_l_e___s_l_i_c_e objects representing the portions of files the
│ │ │ │ -specified piece index, byte offset and size range overlaps. this is the inverse
│ │ │ │ -mapping of _m_a_p___f_i_l_e_(_).
│ │ │ │ -Preconditions of this function is that the input range is within the torrents
│ │ │ │ -address space. piece may not be negative and
│ │ │ │ - piece * piece_size + offset + size
│ │ │ │ -may not exceed the total size of the torrent.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** mmaapp__ffiillee(()) **********
│ │ │ │ -peer_request mmaapp__ffiillee (file_index_t file, std::int64_t offset, int size) const;
│ │ │ │ -returns a _p_e_e_r___r_e_q_u_e_s_t representing the piece index, byte offset and size the
│ │ │ │ -specified file range overlaps. This is the inverse mapping over _m_a_p___b_l_o_c_k_(_).
│ │ │ │ -Note that the peer_request return type is meant to hold bittorrent block
│ │ │ │ -requests, which may not be larger than 16 kiB. Mapping a range larger than that
│ │ │ │ -may return an overflown integer.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnuumm__ffiilleess(()) **********
│ │ │ │ -int nnuumm__ffiilleess () const noexcept;
│ │ │ │ -returns the number of files in the _f_i_l_e___s_t_o_r_a_g_e
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eenndd__ffiillee(()) **********
│ │ │ │ -file_index_t eenndd__ffiillee () const noexcept;
│ │ │ │ -returns the index of the one-past-end file in the file storage
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__rraannggee(()) **********
│ │ │ │ -index_range ffiillee__rraannggee () 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 files in the
│ │ │ │ -_f_i_l_e___s_t_o_r_a_g_e.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttoottaall__ssiizzee(()) **********
│ │ │ │ -std::int64_t ttoottaall__ssiizzee () const;
│ │ │ │ -returns the total number of bytes all the files in this torrent spans
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnuumm__ppiieecceess(()) sseett__nnuumm__ppiieecceess(()) **********
│ │ │ │ -void sseett__nnuumm__ppiieecceess (int n);
│ │ │ │ -int nnuumm__ppiieecceess () const;
│ │ │ │ -set and get the number of pieces in the torrent
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eenndd__ppiieeccee(()) **********
│ │ │ │ -piece_index_t eenndd__ppiieeccee () const;
│ │ │ │ -returns the index of the one-past-end piece in the file storage
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** llaasstt__ppiieeccee(()) **********
│ │ │ │ -piece_index_t llaasstt__ppiieeccee () const;
│ │ │ │ -returns the index of the last piece in the torrent. The last piece is special
│ │ │ │ -in that it may be smaller than the other pieces (and the other pieces are all
│ │ │ │ -the same size).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__rraannggee(()) **********
│ │ │ │ -index_range ppiieeccee__rraannggee () 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
│ │ │ │ -_f_i_l_e___s_t_o_r_a_g_e.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__ppiieeccee__lleennggtthh(()) ppiieeccee__lleennggtthh(()) **********
│ │ │ │ -int ppiieeccee__lleennggtthh () const;
│ │ │ │ -void sseett__ppiieeccee__lleennggtthh (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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__ssiizzee(()) **********
│ │ │ │ -int ppiieeccee__ssiizzee (piece_index_t index) const;
│ │ │ │ -returns the piece size of index. This will be the same as _p_i_e_c_e___l_e_n_g_t_h_(_),
│ │ │ │ -except for the last piece, which may be shorter.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__ssiizzee22(()) **********
│ │ │ │ -int ppiieeccee__ssiizzee22 (piece_index_t index) const;
│ │ │ │ -Returns the size of the given piece. If the piece spans multiple files, only
│ │ │ │ -the first file is considered part of the piece. This is used for v2 torrents,
│ │ │ │ -where all files are piece aligned and padded. i.e. The pad files are not
│ │ │ │ -considered part of the piece for this purpose.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** bblloocckkss__iinn__ppiieeccee22(()) **********
│ │ │ │ -int bblloocckkss__iinn__ppiieeccee22 (piece_index_t index) const;
│ │ │ │ -returns the number of blocks in the specified piece, for v2 torrents.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** bblloocckkss__ppeerr__ppiieeccee(()) **********
│ │ │ │ -int bblloocckkss__ppeerr__ppiieeccee () const;
│ │ │ │ -returns the number of blocks there are in the typical piece. There may be fewer
│ │ │ │ -in the last piece)
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__nnaammee(()) nnaammee(()) **********
│ │ │ │ -void sseett__nnaammee (std::string const& n);
│ │ │ │ -std::string const& nnaammee () const;
│ │ │ │ -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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sswwaapp(()) **********
│ │ │ │ -void sswwaapp (file_storage& ti) noexcept;
│ │ │ │ -swap all content of tthhiiss with ttii.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ccaannoonniiccaalliizzee(()) **********
│ │ │ │ -void ccaannoonniiccaalliizzee ();
│ │ │ │ -arrange files and padding to match the canonical form required by BEP 52
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppaadd__ffiillee__aatt(()) ssyymmlliinnkk(()) rroooott__ppttrr(()) mmttiimmee(()) ffiillee__ssiizzee(()) ffiillee__ooffffsseett(()) rroooott
│ │ │ │ -(()) ffiillee__nnaammee(()) ffiillee__ppaatthh(()) hhaasshh(()) **********
│ │ │ │ -char const* rroooott__ppttrr (file_index_t const index) const;
│ │ │ │ -std::string ssyymmlliinnkk (file_index_t index) const;
│ │ │ │ -std::string ffiillee__ppaatthh (file_index_t index, std::string const& save_path = "")
│ │ │ │ -const;
│ │ │ │ -sha256_hash rroooott (file_index_t index) const;
│ │ │ │ -bool ppaadd__ffiillee__aatt (file_index_t index) const;
│ │ │ │ -std::time_t mmttiimmee (file_index_t index) const;
│ │ │ │ -std::int64_t ffiillee__ooffffsseett (file_index_t index) const;
│ │ │ │ -string_view ffiillee__nnaammee (file_index_t index) const;
│ │ │ │ -sha1_hash hhaasshh (file_index_t index) const;
│ │ │ │ -std::int64_t ffiillee__ssiizzee (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
│ │ │ │ -SHA-256 merkle tree root hash for the specified file. The pointer points into
│ │ │ │ -storage referred to when the file was added, it is not owned by this object.
│ │ │ │ -Torrents that are not v2 torrents return nullptr.
│ │ │ │ -The mtime() is the modification time is the posix time when a file was last
│ │ │ │ -modified when the torrent was created, or 0 if it was not included in the
│ │ │ │ -torrent file.
│ │ │ │ -file_path() returns the full path to a file.
│ │ │ │ -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 jjuusstt 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).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__nnuumm__bblloocckkss(()) ffiillee__nnuumm__ppiieecceess(()) ffiillee__ppiieeccee__rraannggee(()) **********
│ │ │ │ -index_range ffiillee__ppiieeccee__rraannggee (file_index_t) const;
│ │ │ │ -int ffiillee__nnuumm__bblloocckkss (file_index_t index) const;
│ │ │ │ -int ffiillee__nnuumm__ppiieecceess (file_index_t index) 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__ffiirrsstt__bblloocckk__nnooddee(()) ffiillee__ffiirrsstt__ppiieeccee__nnooddee(()) **********
│ │ │ │ -int ffiillee__ffiirrsstt__bblloocckk__nnooddee (file_index_t index) const;
│ │ │ │ -int ffiillee__ffiirrsstt__ppiieeccee__nnooddee (file_index_t index) const;
│ │ │ │ -index of first piece node in the merkle tree
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__ppaatthh__hhaasshh(()) **********
│ │ │ │ -std::uint32_t ffiillee__ppaatthh__hhaasshh (file_index_t index, std::string const& save_path)
│ │ │ │ -const;
│ │ │ │ -returns the crc32 hash of file_path(index)
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aallll__ppaatthh__hhaasshheess(()) **********
│ │ │ │ -void aallll__ppaatthh__hhaasshheess (std::unordered_set& table) const;
│ │ │ │ -this will add the CRC32 hash of all directory entries to the table. No filename
│ │ │ │ -will be included, just directories. Every depth of directories are added
│ │ │ │ -separately to allow test for collisions with files at all levels. i.e. if one
│ │ │ │ -path in the torrent is foo/bar/baz, the CRC32 hashes for foo, foo/bar and foo/
│ │ │ │ -bar/baz will be added to the set.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__ffllaaggss(()) **********
│ │ │ │ -file_flags_t ffiillee__ffllaaggss (file_index_t index) const;
│ │ │ │ -returns a bitmask of flags from file_flags_t that apply to file at index.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__aabbssoolluuttee__ppaatthh(()) **********
│ │ │ │ -bool ffiillee__aabbssoolluuttee__ppaatthh (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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__iinnddeexx__aatt__ooffffsseett(()) ffiillee__iinnddeexx__aatt__ppiieeccee(()) **********
│ │ │ │ -file_index_t ffiillee__iinnddeexx__aatt__ppiieeccee (piece_index_t piece) const;
│ │ │ │ -file_index_t ffiillee__iinnddeexx__aatt__ooffffsseett (std::int64_t offset) const;
│ │ │ │ -returns the index of the file at the given offset in the torrent
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee__iinnddeexx__ffoorr__rroooott(()) **********
│ │ │ │ -file_index_t ffiillee__iinnddeexx__ffoorr__rroooott (sha256_hash const& root_hash) const;
│ │ │ │ -finds the file with the given root hash and returns its index if there is no
│ │ │ │ -file with the root hash, file_index_t{-1} is returned
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppiieeccee__iinnddeexx__aatt__ffiillee(()) **********
│ │ │ │ -piece_index_t ppiieeccee__iinnddeexx__aatt__ffiillee (file_index_t f) const;
│ │ │ │ -returns the piece index the given file starts at
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ssaanniittiizzee__ssyymmlliinnkkss(()) **********
│ │ │ │ -void ssaanniittiizzee__ssyymmlliinnkkss ();
│ │ │ │ -validate any symlinks, to ensure they all point to other files or directories
│ │ │ │ -inside this storage. Any invalid symlinks are updated to point to themselves.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** vv22(()) **********
│ │ │ │ -bool vv22 () const;
│ │ │ │ -returns true if this torrent contains v2 metadata.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - flag_pad_file
│ │ │ │ - the file is a pad file. It's required to contain zeros at it will not be
│ │ │ │ - saved to disk. Its purpose is to make the following file start on a piece
│ │ │ │ - boundary.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - flag_hidden
│ │ │ │ - this file has the hidden attribute set. This is primarily a windows
│ │ │ │ - attribute
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - flag_executable
│ │ │ │ - this file has the executable attribute set.
│ │ │ │ +********** ooppeerraattoorr==(()) ~~aannnnoouunnccee__eennttrryy(()) aannnnoouunnccee__eennttrryy(()) **********
│ │ │ │ +aannnnoouunnccee__eennttrryy ();
│ │ │ │ +explicit aannnnoouunnccee__eennttrryy (string_view u);
│ │ │ │ +aannnnoouunnccee__eennttrryy (announce_entry const&);
│ │ │ │ +~~aannnnoouunnccee__eennttrryy ();
│ │ │ │ +announce_entry& ooppeerraattoorr== (announce_entry const&) &;
│ │ │ │ +constructs a tracker announce _e_n_t_r_y with u as the URL.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - flag_symlink
│ │ │ │ - this file is a symbolic link. It should have a link target string
│ │ │ │ - associated with it.
│ │ │ │ +********** eennuumm ttrraacckkeerr__ssoouurrccee **********
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_a_n_n_o_u_n_c_e___e_n_t_r_y_._h_p_p"
│ │ │ │ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ +|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_s_o_u_r_c_e___t_o_r_r_e_n_t_ _ _ _ _|_1_ _ _ _ _|_t_h_e_ _t_r_a_c_k_e_r_ _w_a_s_ _p_a_r_t_ _o_f_ _t_h_e_ _._t_o_r_r_e_n_t_ _f_i_l_e_ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|source_client |2 |the tracker was added programmatically via the |
│ │ │ │ +|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_d_d___t_r_a_c_k_e_r_(_)_ _f_u_n_c_t_i_o_n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_s_o_u_r_c_e___m_a_g_n_e_t___l_i_n_k_|_4_ _ _ _ _|_t_h_e_ _t_r_a_c_k_e_r_ _w_a_s_ _p_a_r_t_ _o_f_ _a_ _m_a_g_n_e_t_ _l_i_n_k_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|source_tex |8 |the tracker was received from the swarm via tracker|
│ │ │ │ +|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_e_x_c_h_a_n_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ddeeffaauulltt__ddiisskk__iioo__ccoonnssttrruuccttoorr(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n_._h_p_p"
│ │ │ │ -std::unique_ptr ddeeffaauulltt__ddiisskk__iioo__ccoonnssttrruuccttoorr (
│ │ │ │ - io_context& ios, settings_interface const&, counters& cnt);
│ │ │ │ -the constructor function for the default storage. On systems that support
│ │ │ │ -memory mapped files (and a 64 bit address space) the memory mapped storage will
│ │ │ │ -be constructed, otherwise the portable posix storage.
│ │ │ │ + url
│ │ │ │ + tracker URL as it appeared in the torrent file
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppoossiixx__ddiisskk__iioo__ccoonnssttrruuccttoorr(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_o_s_i_x___d_i_s_k___i_o_._h_p_p"
│ │ │ │ -std::unique_ptr ppoossiixx__ddiisskk__iioo__ccoonnssttrruuccttoorr (
│ │ │ │ - io_context& ios, settings_interface const&, counters& cnt);
│ │ │ │ -this is a simple posix disk I/O back-end, used for systems that don't have a 64
│ │ │ │ -bit virtual address space or don't support memory mapped files. It's
│ │ │ │ -implemented using portable C file functions and is single-threaded.
│ │ │ │ + trackerid
│ │ │ │ + the current &trackerid= argument passed to the tracker. this is optional
│ │ │ │ + and is normally empty (in which case no trackerid is sent).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ mmmmaapp__ddiisskk__iioo__ccoonnssttrruuccttoorr(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_m_m_a_p___d_i_s_k___i_o_._h_p_p"
│ │ │ │ -std::unique_ptr mmmmaapp__ddiisskk__iioo__ccoonnssttrruuccttoorr (
│ │ │ │ - io_context& ios, settings_interface const&, counters& cnt);
│ │ │ │ -constructs a memory mapped file disk I/O object.
│ │ │ │ + endpoints
│ │ │ │ + each local listen socket (endpoint) will announce to the tracker. This
│ │ │ │ + list contains state per endpoint.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ddiissaabblleedd__ddiisskk__iioo__ccoonnssttrruuccttoorr(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_a_b_l_e_d___d_i_s_k___i_o_._h_p_p"
│ │ │ │ -std::unique_ptr ddiissaabblleedd__ddiisskk__iioo__ccoonnssttrruuccttoorr (
│ │ │ │ - io_context& ios, settings_interface const&, counters& cnt);
│ │ │ │ -creates a disk io object that discards all data written to it, and only returns
│ │ │ │ -zero-buffers when read from. May be useful for testing and benchmarking.
│ │ │ │ + tier
│ │ │ │ + the tier this tracker belongs to
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm ssttoorraaggee__mmooddee__tt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_t_o_r_a_g_e___d_e_f_s_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |All pieces will be written to their final |
│ │ │ │ -| | |position, all files will be allocated in full |
│ │ │ │ -|storage_mode_allocate|0 |when the torrent is first started. This mode |
│ │ │ │ -| | |minimizes fragmentation but could be a costly |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_p_e_r_a_t_i_o_n_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |All pieces will be written to the place where |
│ │ │ │ -|storage_mode_sparse |1 |they belong and sparse files will be used. This|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_s_ _t_h_e_ _r_e_c_o_m_m_e_n_d_e_d_,_ _a_n_d_ _d_e_f_a_u_l_t_ _m_o_d_e_._ _ _ _ _ _ _ _ _ _ |
│ │ │ │ + fail_limit
│ │ │ │ + the max number of failures to announce to this tracker in a row, before
│ │ │ │ + this tracker is not used anymore. 0 means unlimited
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm ssttaattuuss__tt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_t_o_r_a_g_e___d_e_f_s_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___e_r_r_o_r_ _ _ _ _ _ _ _ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_f_a_t_a_l___d_i_s_k___e_r_r_o_r_|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_e_e_d___f_u_l_l___c_h_e_c_k_ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_f_i_l_e___e_x_i_s_t_ _ _ _ _ _ _|_3_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |this is not an enum value, but a flag that can be set|
│ │ │ │ -| | |in the return from async_check_files, in case an |
│ │ │ │ -|oversized_file |16 |existing file was found larger than specified in the |
│ │ │ │ -| | |torrent. i.e. it has garbage at the end the _s_t_a_t_u_s___t |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_f_i_e_l_d_ _i_s_ _u_s_e_d_ _f_o_r_ _t_h_i_s_ _t_o_ _p_r_e_s_e_r_v_e_ _A_B_I_._ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ + source
│ │ │ │ + a bitmask specifying which sources we got this tracker from.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm mmoovvee__ffllaaggss__tt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_t_o_r_a_g_e___d_e_f_s_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|always_replace_files |0 |replace any files in the destination when |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_p_y_i_n_g_ _o_r_ _m_o_v_i_n_g_ _t_h_e_ _s_t_o_r_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |if any files that we want to copy exist in |
│ │ │ │ -| | |the destination exist, fail the whole |
│ │ │ │ -| | |operation and don't perform any copy or move.|
│ │ │ │ -| | |There is an inherent race condition in this |
│ │ │ │ -|fail_if_exist |1 |mode. The files are checked for existence |
│ │ │ │ -| | |before the operation starts. In between the |
│ │ │ │ -| | |check and performing the copy, the |
│ │ │ │ -| | |destination files may be created, in which |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_a_s_e_ _t_h_e_y_ _a_r_e_ _r_e_p_l_a_c_e_d_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |if any file exist in the target, take those |
│ │ │ │ -|dont_replace |2 |files instead of the ones we may have in the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_o_u_r_c_e_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |don't move any source files, just forget |
│ │ │ │ -|reset_save_path |3 |about them and begin checking files at new |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_a_v_e_ _p_a_t_h_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|reset_save_path_unchecked|4 |don't move any source files, just change save|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_a_t_h_ _a_n_d_ _c_o_n_t_i_n_u_e_ _w_o_r_k_i_n_g_ _w_i_t_h_o_u_t_ _a_n_y_ _c_h_e_c_k_s_ |
│ │ │ │ + verified
│ │ │ │ + set to true the first time we receive a valid response from this tracker.
│ │ │ │ The disk I/O can be customized in libtorrent. In previous versions, the
│ │ │ │ customization was at the level of each torrent. Now, the customization point is
│ │ │ │ at the _s_e_s_s_i_o_n level. All torrents added to a _s_e_s_s_i_o_n will use the same disk I/
│ │ │ │ O subsystem, as determined by the disk_io_constructor (in _s_e_s_s_i_o_n___p_a_r_a_m_s).
│ │ │ │ This allows the disk subsystem to also customize threading and disk job
│ │ │ │ management.
│ │ │ │ To customize the disk subsystem, implement _d_i_s_k___i_n_t_e_r_f_a_c_e and provide a factory
│ │ │ │ @@ -3449,35 +1326,23 @@
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ sseettttiinnggss__iinntteerrffaaccee ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_t_t_i_n_g_s___p_a_c_k_._h_p_p"
│ │ │ │ the common interface to _s_e_t_t_i_n_g_s___p_a_c_k and the internal representation of
│ │ │ │ settings.
│ │ │ │ struct settings_interface
│ │ │ │ {
│ │ │ │ - virtual bool hhaass__vvaall (int name) const = 0;
│ │ │ │ - virtual void sseett__ssttrr (int name, std::string val) = 0;
│ │ │ │ virtual void sseett__bbooooll (int name, bool val) = 0;
│ │ │ │ virtual void sseett__iinntt (int name, int val) = 0;
│ │ │ │ + virtual void sseett__ssttrr (int name, std::string val) = 0;
│ │ │ │ + virtual bool hhaass__vvaall (int name) const = 0;
│ │ │ │ virtual int ggeett__iinntt (int name) const = 0;
│ │ │ │ - virtual std::string const& ggeett__ssttrr (int name) const = 0;
│ │ │ │ virtual bool ggeett__bbooooll (int name) const = 0;
│ │ │ │ + virtual std::string const& ggeett__ssttrr (int name) const = 0;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ddiisskk__oobbsseerrvveerr ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___o_b_s_e_r_v_e_r_._h_p_p"
│ │ │ │ -struct disk_observer
│ │ │ │ -{
│ │ │ │ - virtual void oonn__ddiisskk () = 0;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ddiisskk(()) **********
│ │ │ │ -virtual void oonn__ddiisskk () = 0;
│ │ │ │ -called when the disk cache size has dropped below the low watermark again and
│ │ │ │ -we can resume downloading from peers
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ ooppeenn__ffiillee__ssttaattee ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___i_n_t_e_r_f_a_c_e_._h_p_p"
│ │ │ │ this contains information about a file that's currently open by the libtorrent
│ │ │ │ disk I/O subsystem. It's associated with a single torrent.
│ │ │ │ struct open_file_state
│ │ │ │ {
│ │ │ │ file_index_t file_index;
│ │ │ │ @@ -3784,26 +1649,38 @@
│ │ │ │ a unique, owning, reference to the storage of a torrent in a disk io subsystem
│ │ │ │ (class that implements _d_i_s_k___i_n_t_e_r_f_a_c_e). This is held by the internal libtorrent
│ │ │ │ torrent object to tie the storage object allocated for a torrent to the
│ │ │ │ lifetime of the internal torrent object. When a torrent is removed from the
│ │ │ │ _s_e_s_s_i_o_n, this holder is destructed and will inform the disk object.
│ │ │ │ struct storage_holder
│ │ │ │ {
│ │ │ │ - ssttoorraaggee__hhoollddeerr (storage_index_t idx, disk_interface& disk_io);
│ │ │ │ ~~ssttoorraaggee__hhoollddeerr ();
│ │ │ │ + ssttoorraaggee__hhoollddeerr (storage_index_t idx, disk_interface& disk_io);
│ │ │ │ ssttoorraaggee__hhoollddeerr () = default;
│ │ │ │ explicit operator bbooooll () const;
│ │ │ │ operator ssttoorraaggee__iinnddeexx__tt () const;
│ │ │ │ void rreesseett ();
│ │ │ │ - storage_holder& ooppeerraattoorr== (storage_holder const&) = delete;
│ │ │ │ ssttoorraaggee__hhoollddeerr (storage_holder const&) = delete;
│ │ │ │ + storage_holder& ooppeerraattoorr== (storage_holder const&) = delete;
│ │ │ │ ssttoorraaggee__hhoollddeerr (storage_holder&& rhs) noexcept;
│ │ │ │ storage_holder& ooppeerraattoorr== (storage_holder&& rhs) noexcept;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ +************ ddiisskk__oobbsseerrvveerr ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___o_b_s_e_r_v_e_r_._h_p_p"
│ │ │ │ +struct disk_observer
│ │ │ │ +{
│ │ │ │ + virtual void oonn__ddiisskk () = 0;
│ │ │ │ +};
│ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ +********** oonn__ddiisskk(()) **********
│ │ │ │ +virtual void oonn__ddiisskk () = 0;
│ │ │ │ +called when the disk cache size has dropped below the low watermark again and
│ │ │ │ +we can resume downloading from peers
│ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ bbuuffffeerr__aallllooccaattoorr__iinntteerrffaaccee ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r_._h_p_p"
│ │ │ │ the interface for freeing disk buffers, used by the _d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r. when
│ │ │ │ implementing _d_i_s_k___i_n_t_e_r_f_a_c_e, this must also be implemented in order to return
│ │ │ │ disk buffers back to libtorrent
│ │ │ │ struct buffer_allocator_interface
│ │ │ │ {
│ │ │ │ @@ -3814,16 +1691,16 @@
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_i_s_k___b_u_f_f_e_r___h_o_l_d_e_r_._h_p_p"
│ │ │ │ The disk buffer holder acts like a unique_ptr that frees a disk buffer when
│ │ │ │ it's destructed
│ │ │ │ If this buffer holder is moved-from, default constructed or reset, data() will
│ │ │ │ return nullptr.
│ │ │ │ struct disk_buffer_holder
│ │ │ │ {
│ │ │ │ - disk_buffer_holder& ooppeerraattoorr== (disk_buffer_holder&&) & noexcept;
│ │ │ │ ddiisskk__bbuuffffeerr__hhoollddeerr (disk_buffer_holder&&) noexcept;
│ │ │ │ + disk_buffer_holder& ooppeerraattoorr== (disk_buffer_holder&&) & noexcept;
│ │ │ │ ddiisskk__bbuuffffeerr__hhoollddeerr (disk_buffer_holder const&) = delete;
│ │ │ │ disk_buffer_holder& ooppeerraattoorr== (disk_buffer_holder const&) = delete;
│ │ │ │ ddiisskk__bbuuffffeerr__hhoollddeerr (buffer_allocator_interface& alloc
│ │ │ │ , char* buf, int sz) noexcept;
│ │ │ │ ddiisskk__bbuuffffeerr__hhoollddeerr () noexcept = default;
│ │ │ │ ~~ddiisskk__bbuuffffeerr__hhoollddeerr ();
│ │ │ │ char* ddaattaa () const noexcept;
│ │ │ │ @@ -5358,22 +3235,22 @@
│ │ │ │ The life time of NAT-PMP and PCP port-mappings, specified in seconds.
│ │ │ │ struct settings_pack final : settings_interface
│ │ │ │ {
│ │ │ │ friend void aappppllyy__ppaacckk__iimmppll (settings_pack const*
│ │ │ │ , aux::session_settings_single_thread&
│ │ │ │ , std::vector*);
│ │ │ │ void sseett__iinntt (int name, flags::bitfield_flag const val);
│ │ │ │ - void sseett__bbooooll (int name, bool val) override;
│ │ │ │ void sseett__iinntt (int name, int val) override;
│ │ │ │ + void sseett__bbooooll (int name, bool val) override;
│ │ │ │ void sseett__ssttrr (int name, std::string val) override;
│ │ │ │ bool hhaass__vvaall (int name) const override;
│ │ │ │ void cclleeaarr ();
│ │ │ │ void cclleeaarr (int name);
│ │ │ │ - bool ggeett__bbooooll (int name) const override;
│ │ │ │ int ggeett__iinntt (int name) const override;
│ │ │ │ + bool ggeett__bbooooll (int name) const override;
│ │ │ │ std::string const& ggeett__ssttrr (int name) const override;
│ │ │ │
│ │ │ │ enum type_bases
│ │ │ │ {
│ │ │ │ string_type_base,
│ │ │ │ int_type_base,
│ │ │ │ bool_type_base,
│ │ │ │ @@ -5445,16 +3322,16 @@
│ │ │ │ http,
│ │ │ │ http_pw,
│ │ │ │ };
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** sseett__iinntt(()) sseett__ssttrr(()) sseett__bbooooll(()) **********
│ │ │ │ void sseett__iinntt (int name, flags::bitfield_flag const val);
│ │ │ │ -void sseett__bbooooll (int name, bool val) override;
│ │ │ │ void sseett__iinntt (int name, int val) override;
│ │ │ │ +void sseett__bbooooll (int name, bool val) override;
│ │ │ │ void sseett__ssttrr (int name, std::string val) override;
│ │ │ │ set a configuration option in the _s_e_t_t_i_n_g_s___p_a_c_k. 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.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** hhaass__vvaall(()) **********
│ │ │ │ bool hhaass__vvaall (int name) const override;
│ │ │ │ @@ -5466,17 +3343,17 @@
│ │ │ │ void cclleeaarr ();
│ │ │ │ clear the settings pack from all settings
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** cclleeaarr(()) **********
│ │ │ │ void cclleeaarr (int name);
│ │ │ │ clear a specific setting from the pack
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett__bbooooll(()) ggeett__iinntt(()) ggeett__ssttrr(()) **********
│ │ │ │ -bool ggeett__bbooooll (int name) const override;
│ │ │ │ +********** ggeett__ssttrr(()) ggeett__iinntt(()) ggeett__bbooooll(()) **********
│ │ │ │ int ggeett__iinntt (int name) const override;
│ │ │ │ +bool ggeett__bbooooll (int name) const override;
│ │ │ │ std::string const& ggeett__ssttrr (int name) const override;
│ │ │ │ queries the current configuration option from the _s_e_t_t_i_n_g_s___p_a_c_k. 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.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** eennuumm ttyyppee__bbaasseess **********
│ │ │ │ @@ -5606,16 +3483,16 @@
│ │ │ │ |_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_b_e_ _u_s_e_d_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ | | |The server is assumed to be an HTTP proxy that requires user |
│ │ │ │ |http_pw |5 |authorization. The username and password will be sent to the |
│ │ │ │ |_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_r_o_x_y_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ nnaammee__ffoorr__sseettttiinngg(()) sseettttiinngg__bbyy__nnaammee(()) ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_t_t_i_n_g_s___p_a_c_k_._h_p_p"
│ │ │ │ -char const* nnaammee__ffoorr__sseettttiinngg (int s);
│ │ │ │ int sseettttiinngg__bbyy__nnaammee (string_view name);
│ │ │ │ +char const* nnaammee__ffoorr__sseettttiinngg (int s);
│ │ │ │ converts a setting integer (from the enums string_types, int_types or
│ │ │ │ bool_types) to a string, and vice versa.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ ddeeffaauulltt__sseettttiinnggss(()) ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_t_t_i_n_g_s___p_a_c_k_._h_p_p"
│ │ │ │ settings_pack ddeeffaauulltt__sseettttiinnggss ();
│ │ │ │ returns a _s_e_t_t_i_n_g_s___p_a_c_k with every setting set to its default value
│ │ │ │ @@ -5665,1129 +3542,301 @@
│ │ │ │ |_D_E_ _ _ _ _ _ _|_D_e_l_u_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_A_Z_ _ _ _ _ _ _|_A_z_u_r_e_u_s_ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_T_L_ _ _ _ _ _ _|_T_r_i_b_l_e_r_ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ There's an informal directory of client id's _h_e_r_e.
│ │ │ │ The major, minor, revision and tag parameters are used to identify the version
│ │ │ │ of your client.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ssttaattss__mmeettrriicc ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___s_t_a_t_s_._h_p_p"
│ │ │ │ -describes one statistics metric from the _s_e_s_s_i_o_n. For more information, see the
│ │ │ │ -_s_e_s_s_i_o_n_ _s_t_a_t_i_s_t_i_c_s section.
│ │ │ │ -struct stats_metric
│ │ │ │ +************ ppiieeccee__bblloocckk ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_i_e_c_e___b_l_o_c_k_._h_p_p"
│ │ │ │ +struct piece_block
│ │ │ │ {
│ │ │ │ - char const* name;
│ │ │ │ - int value_index;
│ │ │ │ - metric_type_t type;
│ │ │ │ + ppiieeccee__bblloocckk () = default;
│ │ │ │ + ppiieeccee__bblloocckk (piece_index_t p_index, int b_index);
│ │ │ │ + bool ooppeerraattoorr<< (piece_block const& b) const;
│ │ │ │ + bool ooppeerraattoorr==== (piece_block const& b) const;
│ │ │ │ + bool ooppeerraattoorr!!== (piece_block const& b) const;
│ │ │ │ +
│ │ │ │ + static const piece_block invalid;
│ │ │ │ + piece_index_t piece_index {0};
│ │ │ │ + int bblloocckk__iinnddeexx = 0;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - name
│ │ │ │ - the name of the counter or gauge
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - value_index type
│ │ │ │ - the index into the _s_e_s_s_i_o_n stats array, where the underlying value of
│ │ │ │ - this counter or gauge is found. The _s_e_s_s_i_o_n stats array is part of the
│ │ │ │ - _s_e_s_s_i_o_n___s_t_a_t_s___a_l_e_r_t object.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ccoouunntteerrss ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_r_f_o_r_m_a_n_c_e___c_o_u_n_t_e_r_s_._h_p_p"
│ │ │ │ -struct counters
│ │ │ │ +************ iinnffoo__hhaasshh__tt ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_n_f_o___h_a_s_h_._h_p_p"
│ │ │ │ +class holding the info-hash of a torrent. It can hold a v1 info-hash (SHA-1) or
│ │ │ │ +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
│ │ │ │ {
│ │ │ │ - ccoouunntteerrss () ;
│ │ │ │ - counters& ooppeerraattoorr== (counters const&) & ;
│ │ │ │ - ccoouunntteerrss (counters const&) ;
│ │ │ │ - std::int64_t iinncc__ssttaattss__ccoouunntteerr (int c, std::int64_t value = 1) ;
│ │ │ │ - std::int64_t ooppeerraattoorr[[]] (int i) const ;
│ │ │ │ - void bblleenndd__ssttaattss__ccoouunntteerr (int c, std::int64_t value, int ratio) ;
│ │ │ │ - void sseett__vvaalluuee (int c, std::int64_t value) ;
│ │ │ │ + iinnffoo__hhaasshh__tt () noexcept = default;
│ │ │ │ + explicit iinnffoo__hhaasshh__tt (sha256_hash h2) noexcept;
│ │ │ │ + iinnffoo__hhaasshh__tt (sha1_hash h1, sha256_hash h2) noexcept;
│ │ │ │ + explicit iinnffoo__hhaasshh__tt (sha1_hash h1) noexcept;
│ │ │ │ + bool hhaass__vv11 () const;
│ │ │ │ + bool hhaass (protocol_version v) const;
│ │ │ │ + bool hhaass__vv22 () const;
│ │ │ │ + sha1_hash ggeett (protocol_version v) const;
│ │ │ │ + sha1_hash ggeett__bbeesstt () const;
│ │ │ │ + friend bool ooppeerraattoorr!!== (info_hash_t const& lhs, info_hash_t const& rhs);
│ │ │ │ + friend bool ooppeerraattoorr==== (info_hash_t const& lhs, info_hash_t const& rhs)
│ │ │ │ +noexcept;
│ │ │ │ + bool ooppeerraattoorr<< (info_hash_t const& o) const;
│ │ │ │ + friend std::ostream& ooppeerraattoorr<<<< (std::ostream& os, info_hash_t const& ih);
│ │ │ │ +
│ │ │ │ + sha1_hash v1;
│ │ │ │ + sha256_hash v2;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ooppeerraattoorr[[]](()) iinncc__ssttaattss__ccoouunntteerr(()) **********
│ │ │ │ -std::int64_t iinncc__ssttaattss__ccoouunntteerr (int c, std::int64_t value = 1) ;
│ │ │ │ -std::int64_t ooppeerraattoorr[[]] (int i) const ;
│ │ │ │ -returns the new value
│ │ │ │ +********** iinnffoo__hhaasshh__tt(()) **********
│ │ │ │ +iinnffoo__hhaasshh__tt () noexcept = default;
│ │ │ │ +explicit iinnffoo__hhaasshh__tt (sha256_hash h2) noexcept;
│ │ │ │ +iinnffoo__hhaasshh__tt (sha1_hash h1, sha256_hash h2) noexcept;
│ │ │ │ +explicit iinnffoo__hhaasshh__tt (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 iimmpplliicciitt conversion from a v1 hash, but the
│ │ │ │ +implicitness is deprecated.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ sseessssiioonn__ssttaattss__mmeettrriiccss(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___s_t_a_t_s_._h_p_p"
│ │ │ │ -std::vector sseessssiioonn__ssttaattss__mmeettrriiccss ();
│ │ │ │ -This free function returns the list of available metrics exposed by
│ │ │ │ -libtorrent's statistics API. Each metric has a name and a vvaalluuee iinnddeexx. The
│ │ │ │ -value index is the index into the array in _s_e_s_s_i_o_n___s_t_a_t_s___a_l_e_r_t where this
│ │ │ │ -metric's value can be found when the _s_e_s_s_i_o_n stats is sampled (by calling
│ │ │ │ -_p_o_s_t___s_e_s_s_i_o_n___s_t_a_t_s_(_)).
│ │ │ │ +********** hhaass__vv11(()) hhaass(()) hhaass__vv22(()) **********
│ │ │ │ +bool hhaass__vv11 () const;
│ │ │ │ +bool hhaass (protocol_version v) const;
│ │ │ │ +bool hhaass__vv22 () const;
│ │ │ │ +returns true if the corresponding info hash is present in this object.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ffiinndd__mmeettrriicc__iiddxx(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___s_t_a_t_s_._h_p_p"
│ │ │ │ -int ffiinndd__mmeettrriicc__iiddxx (string_view name);
│ │ │ │ -given a name of a metric, this function returns the counter index of it, or -
│ │ │ │ -1 if it could not be found. The counter index is the index into the values
│ │ │ │ -array returned by _s_e_s_s_i_o_n___s_t_a_t_s___a_l_e_r_t.
│ │ │ │ +********** ggeett(()) **********
│ │ │ │ +sha1_hash ggeett (protocol_version v) const;
│ │ │ │ +returns the has for the specified protocol version
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm mmeettrriicc__ttyyppee__tt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___s_t_a_t_s_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_c_o_u_n_t_e_r_|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_g_a_u_g_e_ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +********** ggeett__bbeesstt(()) **********
│ │ │ │ +sha1_hash ggeett__bbeesstt () const;
│ │ │ │ +returns the v2 (truncated) info-hash, if there is one, otherwise returns the v1
│ │ │ │ +info-hash
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ sseessssiioonn__ppaarraammss ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___p_a_r_a_m_s_._h_p_p"
│ │ │ │ -The _s_e_s_s_i_o_n___p_a_r_a_m_s is a parameters pack for configuring the _s_e_s_s_i_o_n before it's
│ │ │ │ -started.
│ │ │ │ -struct session_params
│ │ │ │ +************ ppeeeerr__rreeqquueesstt ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___r_e_q_u_e_s_t_._h_p_p"
│ │ │ │ +represents a byte range within a piece. Internally this is is used for incoming
│ │ │ │ +piece requests.
│ │ │ │ +struct peer_request
│ │ │ │ {
│ │ │ │ - sseessssiioonn__ppaarraammss (settings_pack&& sp);
│ │ │ │ - sseessssiioonn__ppaarraammss ();
│ │ │ │ - sseessssiioonn__ppaarraammss (settings_pack const& sp);
│ │ │ │ - sseessssiioonn__ppaarraammss (settings_pack&& sp
│ │ │ │ - , std::vector> exts);
│ │ │ │ - sseessssiioonn__ppaarraammss (settings_pack const& sp
│ │ │ │ - , std::vector> exts);
│ │ │ │ + bool ooppeerraattoorr==== (peer_request const& r) const;
│ │ │ │
│ │ │ │ - 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;
│ │ │ │ - libtorrent::ip_filter ip_filter;
│ │ │ │ + piece_index_t piece;
│ │ │ │ + int start;
│ │ │ │ + int length;
│ │ │ │ };
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseessssiioonn__ppaarraammss(()) **********
│ │ │ │ -sseessssiioonn__ppaarraammss (settings_pack&& sp);
│ │ │ │ -sseessssiioonn__ppaarraammss ();
│ │ │ │ -sseessssiioonn__ppaarraammss (settings_pack const& sp);
│ │ │ │ -This constructor can be used to start with the default plugins (ut_metadata,
│ │ │ │ -ut_pex and smart_ban). Pass a _s_e_t_t_i_n_g_s___p_a_c_k to set the initial settings when
│ │ │ │ -the _s_e_s_s_i_o_n starts.
│ │ │ │ +********** ooppeerraattoorr====(()) **********
│ │ │ │ +bool ooppeerraattoorr==== (peer_request const& r) const;
│ │ │ │ +returns true if the right hand side _p_e_e_r___r_e_q_u_e_s_t refers to the same range as
│ │ │ │ +this does.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseessssiioonn__ppaarraammss(()) **********
│ │ │ │ -sseessssiioonn__ppaarraammss (settings_pack&& sp
│ │ │ │ - , std::vector> exts);
│ │ │ │ -sseessssiioonn__ppaarraammss (settings_pack const& sp
│ │ │ │ - , std::vector> exts);
│ │ │ │ -This constructor helps to configure the set of initial plugins to be added to
│ │ │ │ -the _s_e_s_s_i_o_n before it's started.
│ │ │ │ + piece
│ │ │ │ + The index of the piece in which the range starts.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - settings
│ │ │ │ - The settings to configure the _s_e_s_s_i_o_n with
│ │ │ │ + start
│ │ │ │ + The byte offset within that piece where the range starts.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - extensions
│ │ │ │ - the plugins to add to the _s_e_s_s_i_o_n as it is constructed
│ │ │ │ + length
│ │ │ │ + The size of the range, in bytes.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - dht_state
│ │ │ │ - DHT node ID and node addresses to bootstrap the DHT with.
│ │ │ │ +************ ppeeeerr__iinnffoo ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___i_n_f_o_._h_p_p"
│ │ │ │ +holds information and statistics about one peer that libtorrent is connected to
│ │ │ │ +struct peer_info
│ │ │ │ +{
│ │ │ │ + sha256_hash ii22pp__ddeessttiinnaattiioonn () const;
│ │ │ │ +
│ │ │ │ + std::string client;
│ │ │ │ + typed_bitfield pieces;
│ │ │ │ + std::int64_t total_download;
│ │ │ │ + std::int64_t total_upload;
│ │ │ │ + time_duration last_request;
│ │ │ │ + time_duration last_active;
│ │ │ │ + time_duration download_queue_time;
│ │ │ │ + static constexpr peer_flags_t iinntteerreessttiinngg = 0_bit;
│ │ │ │ + static constexpr peer_flags_t cchhookkeedd = 1_bit;
│ │ │ │ + static constexpr peer_flags_t rreemmoottee__iinntteerreesstteedd = 2_bit;
│ │ │ │ + static constexpr peer_flags_t rreemmoottee__cchhookkeedd = 3_bit;
│ │ │ │ + static constexpr peer_flags_t ssuuppppoorrttss__eexxtteennssiioonnss = 4_bit;
│ │ │ │ + static constexpr peer_flags_t oouuttggooiinngg__ccoonnnneeccttiioonn = 5_bit;
│ │ │ │ + static constexpr peer_flags_t llooccaall__ccoonnnneeccttiioonn = 5_bit;
│ │ │ │ + static constexpr peer_flags_t hhaannddsshhaakkee = 6_bit;
│ │ │ │ + static constexpr peer_flags_t ccoonnnneeccttiinngg = 7_bit;
│ │ │ │ + static constexpr peer_flags_t oonn__ppaarroollee = 9_bit;
│ │ │ │ + static constexpr peer_flags_t sseeeedd = 10_bit;
│ │ │ │ + static constexpr peer_flags_t ooppttiimmiissttiicc__uunncchhookkee = 11_bit;
│ │ │ │ + static constexpr peer_flags_t ssnnuubbbbeedd = 12_bit;
│ │ │ │ + static constexpr peer_flags_t uuppllooaadd__oonnllyy = 13_bit;
│ │ │ │ + static constexpr peer_flags_t eennddggaammee__mmooddee = 14_bit;
│ │ │ │ + static constexpr peer_flags_t hhoolleeppuunncchheedd = 15_bit;
│ │ │ │ + static constexpr peer_flags_t ii22pp__ssoocckkeett = 16_bit;
│ │ │ │ + static constexpr peer_flags_t uuttpp__ssoocckkeett = 17_bit;
│ │ │ │ + static constexpr peer_flags_t ssssll__ssoocckkeett = 18_bit;
│ │ │ │ + static constexpr peer_flags_t rrcc44__eennccrryypptteedd = 19_bit;
│ │ │ │ + static constexpr peer_flags_t ppllaaiinntteexxtt__eennccrryypptteedd = 20_bit;
│ │ │ │ + peer_flags_t flags;
│ │ │ │ + static constexpr peer_source_flags_t ttrraacckkeerr = 0_bit;
│ │ │ │ + static constexpr peer_source_flags_t ddhhtt = 1_bit;
│ │ │ │ + static constexpr peer_source_flags_t ppeexx = 2_bit;
│ │ │ │ + static constexpr peer_source_flags_t llssdd = 3_bit;
│ │ │ │ + static constexpr peer_source_flags_t rreessuummee__ddaattaa = 4_bit;
│ │ │ │ + static constexpr peer_source_flags_t iinnccoommiinngg = 5_bit;
│ │ │ │ + peer_source_flags_t source;
│ │ │ │ + int up_speed;
│ │ │ │ + int down_speed;
│ │ │ │ + int payload_up_speed;
│ │ │ │ + int payload_down_speed;
│ │ │ │ + peer_id pid;
│ │ │ │ + int queue_bytes;
│ │ │ │ + int request_timeout;
│ │ │ │ + int send_buffer_size;
│ │ │ │ + int used_send_buffer;
│ │ │ │ + int receive_buffer_size;
│ │ │ │ + int used_receive_buffer;
│ │ │ │ + int receive_buffer_watermark;
│ │ │ │ + int num_hashfails;
│ │ │ │ + int download_queue_length;
│ │ │ │ + int timed_out_requests;
│ │ │ │ + int busy_requests;
│ │ │ │ + int requests_in_buffer;
│ │ │ │ + int target_dl_queue_length;
│ │ │ │ + int upload_queue_length;
│ │ │ │ + int failcount;
│ │ │ │ + piece_index_t downloading_piece_index;
│ │ │ │ + int downloading_block_index;
│ │ │ │ + int downloading_progress;
│ │ │ │ + int downloading_total;
│ │ │ │ + static constexpr connection_type_t ssttaannddaarrdd__bbiittttoorrrreenntt = 0_bit;
│ │ │ │ + static constexpr connection_type_t wweebb__sseeeedd = 1_bit;
│ │ │ │ + static constexpr connection_type_t hhttttpp__sseeeedd = 2_bit;
│ │ │ │ + connection_type_t connection_type;
│ │ │ │ + int pending_disk_bytes;
│ │ │ │ + int pending_disk_read_bytes;
│ │ │ │ + int send_quota;
│ │ │ │ + int receive_quota;
│ │ │ │ + int rtt;
│ │ │ │ + int num_pieces;
│ │ │ │ + int download_rate_peak;
│ │ │ │ + int upload_rate_peak;
│ │ │ │ + float progress;
│ │ │ │ + int progress_ppm;
│ │ │ │ + _t_c_p_:_:_e_n_d_p_o_i_n_t ip;
│ │ │ │ + _t_c_p_:_:_e_n_d_p_o_i_n_t local_endpoint;
│ │ │ │ + static constexpr bandwidth_state_flags_t bbww__iiddllee = 0_bit;
│ │ │ │ + static constexpr bandwidth_state_flags_t bbww__lliimmiitt = 1_bit;
│ │ │ │ + static constexpr bandwidth_state_flags_t bbww__nneettwwoorrkk = 2_bit;
│ │ │ │ + static constexpr bandwidth_state_flags_t bbww__ddiisskk = 4_bit;
│ │ │ │ + bandwidth_state_flags_t read_state;
│ │ │ │ + bandwidth_state_flags_t write_state;
│ │ │ │ +};
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - dht_storage_constructor
│ │ │ │ - function object to construct the storage object for DHT items.
│ │ │ │ +********** ii22pp__ddeessttiinnaattiioonn(()) **********
│ │ │ │ +sha256_hash ii22pp__ddeessttiinnaattiioonn () const;
│ │ │ │ +If this peer is an i2p peer, this function returns the destination address of
│ │ │ │ +the peer
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - disk_io_constructor
│ │ │ │ - function object to create the disk I/O subsystem. Defaults to
│ │ │ │ - default_disk_io_constructor.
│ │ │ │ + client
│ │ │ │ + A human readable string describing the software at the other end of the
│ │ │ │ + connection. In some cases this information is not available, then it will
│ │ │ │ + contain a string that may give away something about which software is
│ │ │ │ + running in the other end. In the case of a web seed, the server type and
│ │ │ │ + version will be a part of this string. This is UTF-8 encoded.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - ext_state
│ │ │ │ - this container can be used by extensions/plugins to store settings. It's
│ │ │ │ - primarily here to make it convenient to save and restore state across
│ │ │ │ - sessions, using _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_) and _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_).
│ │ │ │ + pieces
│ │ │ │ + a _b_i_t_f_i_e_l_d, with one bit per piece in the torrent. Each bit tells you if
│ │ │ │ + the peer has that piece (if it's set to 1) or if the peer miss that piece
│ │ │ │ + (set to 0).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - ip_filter
│ │ │ │ - the IP filter to use for the _s_e_s_s_i_o_n. This restricts which peers are
│ │ │ │ - allowed to connect. As if passed to _s_e_t___i_p___f_i_l_t_e_r_(_).
│ │ │ │ + total_download total_upload
│ │ │ │ + the total number of bytes downloaded from and uploaded to this peer.
│ │ │ │ + These numbers do not include the protocol chatter, but only the payload
│ │ │ │ + data.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ sseessssiioonn__hhaannddllee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -this class provides a non-owning handle to a _s_e_s_s_i_o_n and a subset of the
│ │ │ │ -interface of the _s_e_s_s_i_o_n class. If the underlying _s_e_s_s_i_o_n is destructed any
│ │ │ │ -handle to it will no longer be valid. _i_s___v_a_l_i_d_(_) will return false and any
│ │ │ │ -operation on it will throw a system_error exception, with error code
│ │ │ │ -invalid_session_handle.
│ │ │ │ -struct session_handle
│ │ │ │ -{
│ │ │ │ - bool iiss__vvaalliidd () const;
│ │ │ │ - session_params sseessssiioonn__ssttaattee (save_state_flags_t flags =
│ │ │ │ -save_state_flags_t::all()) const;
│ │ │ │ - std::vector ggeett__ttoorrrreenntt__ssttaattuuss (
│ │ │ │ - std::function const& pred
│ │ │ │ - , status_flags_t flags = {}) const;
│ │ │ │ - void rreeffrreesshh__ttoorrrreenntt__ssttaattuuss (std::vector* ret
│ │ │ │ - , status_flags_t flags = {}) const;
│ │ │ │ - void ppoosstt__ttoorrrreenntt__uuppddaatteess (status_flags_t flags = status_flags_t::all());
│ │ │ │ - void ppoosstt__sseessssiioonn__ssttaattss ();
│ │ │ │ - void ppoosstt__ddhhtt__ssttaattss ();
│ │ │ │ - void sseett__ddhhtt__ssttaattee (dht::dht_state&& st);
│ │ │ │ - void sseett__ddhhtt__ssttaattee (dht::dht_state const& st);
│ │ │ │ - torrent_handle ffiinndd__ttoorrrreenntt (sha1_hash const& info_hash) const;
│ │ │ │ - std::vector ggeett__ttoorrrreennttss () const;
│ │ │ │ - torrent_handle ffiinndd__ttoorrrreenntt (sha256_hash const& info_hash) const;
│ │ │ │ - torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params, error_code&
│ │ │ │ -ec);
│ │ │ │ - void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ - torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ - void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ - torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params, error_code& ec);
│ │ │ │ - torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ - void ppaauussee ();
│ │ │ │ - void rreessuummee ();
│ │ │ │ - bool iiss__ppaauusseedd () const;
│ │ │ │ - bool iiss__ddhhtt__rruunnnniinngg () const;
│ │ │ │ - void sseett__ddhhtt__ssttoorraaggee (dht::dht_storage_constructor_type sc);
│ │ │ │ - void aadddd__ddhhtt__nnooddee (std::pair const& node);
│ │ │ │ - void ddhhtt__ggeett__iitteemm (sha1_hash const& target);
│ │ │ │ - void ddhhtt__ggeett__iitteemm (std::array key
│ │ │ │ - , std::string salt = std::string());
│ │ │ │ - sha1_hash ddhhtt__ppuutt__iitteemm (entry data);
│ │ │ │ - void ddhhtt__ppuutt__iitteemm (std::array key
│ │ │ │ - , std::function&
│ │ │ │ - , std::int64_t&, std::string const&)> cb
│ │ │ │ - , std::string salt = std::string());
│ │ │ │ - void ddhhtt__aannnnoouunnccee (sha1_hash const& info_hash, int port = 0, dht::
│ │ │ │ -announce_flags_t flags = {});
│ │ │ │ - void ddhhtt__ggeett__ppeeeerrss (sha1_hash const& info_hash);
│ │ │ │ - void ddhhtt__lliivvee__nnooddeess (sha1_hash const& nid);
│ │ │ │ - void ddhhtt__ssaammppllee__iinnffoohhaasshheess (udp::endpoint const& ep, sha1_hash const&
│ │ │ │ -target);
│ │ │ │ - void ddhhtt__ddiirreecctt__rreeqquueesstt (udp::endpoint const& ep, entry const& e,
│ │ │ │ -client_data_t userdata = {});
│ │ │ │ - void aadddd__eexxtteennssiioonn (std::shared_ptr ext);
│ │ │ │ - void aadddd__eexxtteennssiioonn (std::function(
│ │ │ │ - torrent_handle const&, client_data_t)> ext);
│ │ │ │ - ip_filter ggeett__iipp__ffiilltteerr () const;
│ │ │ │ - void sseett__iipp__ffiilltteerr (ip_filter f);
│ │ │ │ - void sseett__ppoorrtt__ffiilltteerr (port_filter const& f);
│ │ │ │ - unsigned short lliisstteenn__ppoorrtt () const;
│ │ │ │ - bool iiss__lliisstteenniinngg () const;
│ │ │ │ - unsigned short ssssll__lliisstteenn__ppoorrtt () const;
│ │ │ │ - void sseett__ppeeeerr__ccllaassss__ffiilltteerr (ip_filter const& f);
│ │ │ │ - ip_filter ggeett__ppeeeerr__ccllaassss__ffiilltteerr () const;
│ │ │ │ - peer_class_type_filter ggeett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr () const;
│ │ │ │ - void sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr (peer_class_type_filter const& f);
│ │ │ │ - peer_class_t ccrreeaattee__ppeeeerr__ccllaassss (char const* name);
│ │ │ │ - void ddeelleettee__ppeeeerr__ccllaassss (peer_class_t cid);
│ │ │ │ - void sseett__ppeeeerr__ccllaassss (peer_class_t cid, peer_class_info const& pci);
│ │ │ │ - peer_class_info ggeett__ppeeeerr__ccllaassss (peer_class_t cid) const;
│ │ │ │ - void rreemmoovvee__ttoorrrreenntt (const torrent_handle&, remove_flags_t = {});
│ │ │ │ - void aappppllyy__sseettttiinnggss (settings_pack&&);
│ │ │ │ - settings_pack ggeett__sseettttiinnggss () const;
│ │ │ │ - void aappppllyy__sseettttiinnggss (settings_pack const&);
│ │ │ │ - alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait);
│ │ │ │ - void sseett__aalleerrtt__nnoottiiffyy (std::function const& fun);
│ │ │ │ - void ppoopp__aalleerrttss (std::vector* alerts);
│ │ │ │ - void ddeelleettee__ppoorrtt__mmaappppiinngg (port_mapping_t handle);
│ │ │ │ - std::vector aadddd__ppoorrtt__mmaappppiinngg (portmap_protocol t, int
│ │ │ │ -external_port, int local_port);
│ │ │ │ - void rreeooppeenn__nneettwwoorrkk__ssoocckkeettss (reopen_network_flags_t options =
│ │ │ │ -reopen_map_ports);
│ │ │ │ - std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ -
│ │ │ │ - static constexpr save_state_flags_t ssaavvee__sseettttiinnggss = 0_bit;
│ │ │ │ - static constexpr save_state_flags_t ssaavvee__ddhhtt__ssttaattee = 2_bit;
│ │ │ │ - static constexpr save_state_flags_t ssaavvee__eexxtteennssiioonn__ssttaattee = 11_bit;
│ │ │ │ - static constexpr save_state_flags_t ssaavvee__iipp__ffiilltteerr = 12_bit;
│ │ │ │ - static constexpr peer_class_t gglloobbaall__ppeeeerr__ccllaassss__iidd {0};
│ │ │ │ - static constexpr peer_class_t ttccpp__ppeeeerr__ccllaassss__iidd {1};
│ │ │ │ - static constexpr peer_class_t llooccaall__ppeeeerr__ccllaassss__iidd {2};
│ │ │ │ - static constexpr remove_flags_t ddeelleettee__ffiilleess = 0_bit;
│ │ │ │ - static constexpr remove_flags_t ddeelleettee__ppaarrttffiillee = 1_bit;
│ │ │ │ - static constexpr session_flags_t ppaauusseedd = 2_bit;
│ │ │ │ - static constexpr portmap_protocol uuddpp = portmap_protocol::udp;
│ │ │ │ - static constexpr portmap_protocol ttccpp = portmap_protocol::tcp;
│ │ │ │ - static constexpr reopen_network_flags_t rreeooppeenn__mmaapp__ppoorrttss = 0_bit;
│ │ │ │ -};
│ │ │ │ + last_request last_active
│ │ │ │ + the time since we last sent a request to this peer and since any transfer
│ │ │ │ + occurred with this peer
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iiss__vvaalliidd(()) **********
│ │ │ │ -bool iiss__vvaalliidd () const;
│ │ │ │ -returns true if this handle refers to a valid _s_e_s_s_i_o_n object. If the _s_e_s_s_i_o_n
│ │ │ │ -has been destroyed, all _s_e_s_s_i_o_n___h_a_n_d_l_e objects will expire and not be valid.
│ │ │ │ + download_queue_time
│ │ │ │ + the time until all blocks in the request queue will be downloaded
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseessssiioonn__ssttaattee(()) **********
│ │ │ │ -session_params sseessssiioonn__ssttaattee (save_state_flags_t flags = save_state_flags_t::
│ │ │ │ -all()) const;
│ │ │ │ -returns the current _s_e_s_s_i_o_n state. This can be passed to _w_r_i_t_e___s_e_s_s_i_o_n___p_a_r_a_m_s_(_)
│ │ │ │ -to save the state to disk and restored using _r_e_a_d___s_e_s_s_i_o_n___p_a_r_a_m_s_(_) when
│ │ │ │ -constructing a new _s_e_s_s_i_o_n. The kind of state that's included is all settings,
│ │ │ │ -the DHT routing table, possibly plugin-specific state. the flags parameter can
│ │ │ │ -be used to only save certain parts of the _s_e_s_s_i_o_n state
│ │ │ │ + interesting
│ │ │ │ + wwee are interested in pieces from this peer.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett__ttoorrrreenntt__ssttaattuuss(()) rreeffrreesshh__ttoorrrreenntt__ssttaattuuss(()) **********
│ │ │ │ -std::vector ggeett__ttoorrrreenntt__ssttaattuuss (
│ │ │ │ - std::function const& pred
│ │ │ │ - , status_flags_t flags = {}) const;
│ │ │ │ -void rreeffrreesshh__ttoorrrreenntt__ssttaattuuss (std::vector* ret
│ │ │ │ - , status_flags_t flags = {}) const;
│ │ │ │ -Note
│ │ │ │ -these calls are potentially expensive and won't scale well with lots of
│ │ │ │ -torrents. If you're concerned about performance, consider using
│ │ │ │ -post_torrent_updates() instead.
│ │ │ │ -get_torrent_status returns a vector of the _t_o_r_r_e_n_t___s_t_a_t_u_s 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
│ │ │ │ -should be included and false means excluded. The flags argument is the same as
│ │ │ │ -to _t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_s_t_a_t_u_s_(_). Since pred is guaranteed to be called for every
│ │ │ │ -torrent, it may be used to count the number of torrents of different categories
│ │ │ │ -as well.
│ │ │ │ -refresh_torrent_status takes a vector of _t_o_r_r_e_n_t___s_t_a_t_u_s structs (for instance
│ │ │ │ -the same vector that was returned by _g_e_t___t_o_r_r_e_n_t___s_t_a_t_u_s_(_) ) and refreshes the
│ │ │ │ -status based on the handle member. It is possible to use this function by first
│ │ │ │ -setting up a vector of default constructed torrent_status objects, only
│ │ │ │ -initializing the handle member, in order to request the torrent status for
│ │ │ │ -multiple torrents in a single call. This can save a significant amount of time
│ │ │ │ -if you have a lot of torrents.
│ │ │ │ -Any _t_o_r_r_e_n_t___s_t_a_t_u_s object whose handle member is not referring to a valid
│ │ │ │ -torrent are ignored.
│ │ │ │ -The intended use of these functions is to start off by calling
│ │ │ │ -get_torrent_status() to get a list of all torrents that match your criteria.
│ │ │ │ -Then call refresh_torrent_status() on that list. This will only refresh the
│ │ │ │ -status for the torrents in your list, and thus ignore all other torrents you
│ │ │ │ -might be running. This may save a significant amount of time, especially if the
│ │ │ │ -number of torrents you're interested in is small. In order to keep your list of
│ │ │ │ -interested torrents up to date, you can either call get_torrent_status() from
│ │ │ │ -time to time, to include torrents you might have become interested in since the
│ │ │ │ -last time. In order to stop refreshing a certain torrent, simply remove it from
│ │ │ │ -the list.
│ │ │ │ + choked
│ │ │ │ + wwee have choked this peer.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppoosstt__ttoorrrreenntt__uuppddaatteess(()) **********
│ │ │ │ -void ppoosstt__ttoorrrreenntt__uuppddaatteess (status_flags_t flags = status_flags_t::all());
│ │ │ │ -This functions instructs the _s_e_s_s_i_o_n to post the _s_t_a_t_e___u_p_d_a_t_e___a_l_e_r_t, containing
│ │ │ │ -the status of all torrents whose state changed since the last time this
│ │ │ │ -function was called.
│ │ │ │ -Only torrents who has the state subscription flag set will be included. This
│ │ │ │ -flag is on by default. See _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s. the flags argument is the same
│ │ │ │ -as for _t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_s_t_a_t_u_s_(_). see status_flags_t in _t_o_r_r_e_n_t___h_a_n_d_l_e.
│ │ │ │ + remote_interested
│ │ │ │ + the peer is interested in uuss
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppoosstt__sseessssiioonn__ssttaattss(()) **********
│ │ │ │ -void ppoosstt__sseessssiioonn__ssttaattss ();
│ │ │ │ -This function will post a _s_e_s_s_i_o_n___s_t_a_t_s___a_l_e_r_t object, containing a snapshot of
│ │ │ │ -the performance _c_o_u_n_t_e_r_s from the internals of libtorrent. To interpret these
│ │ │ │ -_c_o_u_n_t_e_r_s, query the _s_e_s_s_i_o_n via _s_e_s_s_i_o_n___s_t_a_t_s___m_e_t_r_i_c_s_(_).
│ │ │ │ -For more information, see the _s_e_s_s_i_o_n_ _s_t_a_t_i_s_t_i_c_s section.
│ │ │ │ + remote_choked
│ │ │ │ + the peer has choked uuss.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppoosstt__ddhhtt__ssttaattss(()) **********
│ │ │ │ -void ppoosstt__ddhhtt__ssttaattss ();
│ │ │ │ -This will cause a _d_h_t___s_t_a_t_s___a_l_e_r_t to be posted.
│ │ │ │ + supports_extensions
│ │ │ │ + means that this peer supports the _e_x_t_e_n_s_i_o_n_ _p_r_o_t_o_c_o_l.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__ddhhtt__ssttaattee(()) **********
│ │ │ │ -void sseett__ddhhtt__ssttaattee (dht::dht_state&& st);
│ │ │ │ -void sseett__ddhhtt__ssttaattee (dht::dht_state const& st);
│ │ │ │ -set the DHT state for the _s_e_s_s_i_o_n. This will be taken into account the next
│ │ │ │ -time the DHT is started, as if it had been passed in via the _s_e_s_s_i_o_n___p_a_r_a_m_s on
│ │ │ │ -startup.
│ │ │ │ + outgoing_connection
│ │ │ │ + The connection was initiated by us, the peer has a listen port open, and
│ │ │ │ + that port is the same as in the address of this peer. If this flag is not
│ │ │ │ + set, this peer connection was opened by this peer connecting to us.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiinndd__ttoorrrreenntt(()) ggeett__ttoorrrreennttss(()) **********
│ │ │ │ -torrent_handle ffiinndd__ttoorrrreenntt (sha1_hash const& info_hash) const;
│ │ │ │ -std::vector ggeett__ttoorrrreennttss () const;
│ │ │ │ -torrent_handle ffiinndd__ttoorrrreenntt (sha256_hash const& info_hash) const;
│ │ │ │ -find_torrent() looks for a torrent with the given info-hash. In case there is
│ │ │ │ -such a torrent in the _s_e_s_s_i_o_n, a _t_o_r_r_e_n_t___h_a_n_d_l_e to that torrent is returned. In
│ │ │ │ -case the torrent cannot be found, an invalid _t_o_r_r_e_n_t___h_a_n_d_l_e is returned.
│ │ │ │ -See torrent_handle::is_valid() to know if the torrent was found or not.
│ │ │ │ -get_torrents() returns a vector of torrent_handles to all the torrents
│ │ │ │ -currently in the _s_e_s_s_i_o_n.
│ │ │ │ + local_connection
│ │ │ │ + deprecated synonym for outgoing_connection
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__ttoorrrreenntt(()) aassyynncc__aadddd__ttoorrrreenntt(()) **********
│ │ │ │ -torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params, error_code& ec);
│ │ │ │ -void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ -torrent_handle aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ -void aassyynncc__aadddd__ttoorrrreenntt (add_torrent_params const& params);
│ │ │ │ -torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params, error_code& ec);
│ │ │ │ -torrent_handle aadddd__ttoorrrreenntt (add_torrent_params&& params);
│ │ │ │ -You add torrents through the _a_d_d___t_o_r_r_e_n_t_(_) function where you give an object
│ │ │ │ -with all the parameters. The _a_d_d___t_o_r_r_e_n_t_(_) overloads will block until the
│ │ │ │ -torrent has been added (or failed to be added) and returns an error code and a
│ │ │ │ -_t_o_r_r_e_n_t___h_a_n_d_l_e. In order to add torrents more efficiently, consider using
│ │ │ │ -_a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_) which returns immediately, without waiting for the torrent
│ │ │ │ -to add. Notification of the torrent being added is sent as _a_d_d___t_o_r_r_e_n_t___a_l_e_r_t.
│ │ │ │ -The save_path field in _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s must be set to a valid path where the
│ │ │ │ -files for the torrent will be saved. Even when using a custom storage, this
│ │ │ │ -needs to be set to something. If the save_path is empty, the call to
│ │ │ │ -_a_d_d___t_o_r_r_e_n_t_(_) will throw a system_error exception.
│ │ │ │ -The overload that does not take an error_code throws an exception on error and
│ │ │ │ -is not available when building without exception support. The _t_o_r_r_e_n_t___h_a_n_d_l_e
│ │ │ │ -returned by _a_d_d___t_o_r_r_e_n_t_(_) can be used to retrieve information about the
│ │ │ │ -torrent's progress, its peers etc. It is also used to abort a torrent.
│ │ │ │ -If the torrent you are trying to add already exists in the _s_e_s_s_i_o_n (is either
│ │ │ │ -queued for checking, being checked or downloading) add_torrent() will throw
│ │ │ │ -system_error which derives from std::exception unless duplicate_is_error is set
│ │ │ │ -to false. In that case, _a_d_d___t_o_r_r_e_n_t_(_) will return the handle to the existing
│ │ │ │ -torrent.
│ │ │ │ -The _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s class has a flags field. It can be used to control what
│ │ │ │ -state the new torrent will be added in. Common flags to want to control are
│ │ │ │ -torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet
│ │ │ │ -link that will just download the metadata, but no payload, set the
│ │ │ │ -torrent_flags::upload_mode flag.
│ │ │ │ -Special consideration has to be taken when adding hybrid torrents (i.e.
│ │ │ │ -torrents that are BitTorrent v2 torrents that are backwards compatible with
│ │ │ │ -v1). For more details, see _B_i_t_T_o_r_r_e_n_t_ _v_2_ _t_o_r_r_e_n_t_s.
│ │ │ │ + handshake
│ │ │ │ + The connection is opened, and waiting for the handshake. Until the
│ │ │ │ + handshake is done, the peer cannot be identified.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ppaauussee(()) iiss__ppaauusseedd(()) rreessuummee(()) **********
│ │ │ │ -void ppaauussee ();
│ │ │ │ -void rreessuummee ();
│ │ │ │ -bool iiss__ppaauusseedd () const;
│ │ │ │ -Pausing the _s_e_s_s_i_o_n has the same effect as pausing every torrent in it, except
│ │ │ │ -that torrents will not be resumed by the auto-manage mechanism. Resuming will
│ │ │ │ -restore the torrents to their previous paused state. i.e. the _s_e_s_s_i_o_n pause
│ │ │ │ -state is separate from the torrent pause state. A torrent is inactive if it is
│ │ │ │ -paused or if the _s_e_s_s_i_o_n is paused.
│ │ │ │ + connecting
│ │ │ │ + The connection is in a half-open state (i.e. it is being connected).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iiss__ddhhtt__rruunnnniinngg(()) **********
│ │ │ │ -bool iiss__ddhhtt__rruunnnniinngg () const;
│ │ │ │ -is_dht_running() returns true if the DHT support has been started and false
│ │ │ │ -otherwise.
│ │ │ │ + on_parole
│ │ │ │ + The peer has participated in a piece that failed the hash check, and is
│ │ │ │ + now "on parole", which means we're only requesting whole pieces from this
│ │ │ │ + peer until it either fails that piece or proves that it doesn't send bad
│ │ │ │ + data.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__ddhhtt__ssttoorraaggee(()) **********
│ │ │ │ -void sseett__ddhhtt__ssttoorraaggee (dht::dht_storage_constructor_type sc);
│ │ │ │ -set_dht_storage set a dht custom storage constructor function to be used
│ │ │ │ -internally when the dht is created.
│ │ │ │ -Since the dht storage is a critical component for the dht behavior, this
│ │ │ │ -function will only be effective the next time the dht is started. If you never
│ │ │ │ -touch this feature, a default map-memory based storage is used.
│ │ │ │ -If you want to make sure the dht is initially created with your custom storage,
│ │ │ │ -create a _s_e_s_s_i_o_n with the setting settings_pack::enable_dht to false, set your
│ │ │ │ -constructor function and call apply_settings with settings_pack::enable_dht to
│ │ │ │ -true.
│ │ │ │ + seed
│ │ │ │ + This peer is a seed (it has all the pieces).
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__ddhhtt__nnooddee(()) **********
│ │ │ │ -void aadddd__ddhhtt__nnooddee (std::pair const& node);
│ │ │ │ -add_dht_node takes a host name and port pair. That endpoint will be pinged, and
│ │ │ │ -if a valid DHT reply is received, the node will be added to the routing table.
│ │ │ │ + optimistic_unchoke
│ │ │ │ + This peer is subject to an optimistic unchoke. It has been unchoked for a
│ │ │ │ + while to see if it might unchoke us in return an earn an upload/unchoke
│ │ │ │ + slot. If it doesn't within some period of time, it will be choked and
│ │ │ │ + another peer will be optimistically unchoked.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__ggeett__iitteemm(()) **********
│ │ │ │ -void ddhhtt__ggeett__iitteemm (sha1_hash const& target);
│ │ │ │ -query the DHT for an immutable item at the target hash. the result is posted as
│ │ │ │ -a _d_h_t___i_m_m_u_t_a_b_l_e___i_t_e_m___a_l_e_r_t.
│ │ │ │ + snubbed
│ │ │ │ + This peer has recently failed to send a block within the request timeout
│ │ │ │ + from when the request was sent. We're currently picking one block at a
│ │ │ │ + time from this peer.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__ggeett__iitteemm(()) **********
│ │ │ │ -void ddhhtt__ggeett__iitteemm (std::array key
│ │ │ │ - , std::string salt = std::string());
│ │ │ │ -query the DHT for a mutable item under the public key key. this is an ed25519
│ │ │ │ -key. salt is optional and may be left as an empty string if no salt is to be
│ │ │ │ -used. if the item is found in the DHT, a _d_h_t___m_u_t_a_b_l_e___i_t_e_m___a_l_e_r_t is posted.
│ │ │ │ + upload_only
│ │ │ │ + This peer has either explicitly (with an extension) or implicitly (by
│ │ │ │ + becoming a seed) told us that it will not downloading anything more,
│ │ │ │ + regardless of which pieces we have.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__ppuutt__iitteemm(()) **********
│ │ │ │ -sha1_hash ddhhtt__ppuutt__iitteemm (entry data);
│ │ │ │ -store the given bencoded data as an immutable item in the DHT. the returned
│ │ │ │ -hash is the key that is to be used to look the item up again. It's just the
│ │ │ │ -SHA-1 hash of the bencoded form of the structure.
│ │ │ │ + endgame_mode
│ │ │ │ + This means the last time this peer picket a piece, it could not pick as
│ │ │ │ + many as it wanted because there were not enough free ones. i.e. all
│ │ │ │ + pieces this peer has were already requested from other peers.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__ppuutt__iitteemm(()) **********
│ │ │ │ -void ddhhtt__ppuutt__iitteemm (std::array key
│ │ │ │ - , std::function&
│ │ │ │ - , std::int64_t&, std::string const&)> cb
│ │ │ │ - , std::string salt = std::string());
│ │ │ │ -store a mutable item. The key is the public key the blob is to be stored under.
│ │ │ │ -The optional salt argument is a string that is to be mixed in with the key when
│ │ │ │ -determining where in the DHT the value is to be stored. The callback function
│ │ │ │ -is called from within the libtorrent network thread once we've found where to
│ │ │ │ -store the blob, possibly with the current value stored under the key. The
│ │ │ │ -values passed to the callback functions are:
│ │ │ │ - entry& value
│ │ │ │ - the current value stored under the key (may be empty). Also expected to
│ │ │ │ - be set to the value to be stored by the function.
│ │ │ │ - std::array& signature
│ │ │ │ - the signature authenticating the current value. This may be zeros if
│ │ │ │ - there is currently no value stored. The function is expected to fill in
│ │ │ │ - this buffer with the signature of the new value to store. To generate the
│ │ │ │ - signature, you may want to use the sign_mutable_item function.
│ │ │ │ - std::int64_t& seq
│ │ │ │ - current sequence number. May be zero if there is no current value. The
│ │ │ │ - function is expected to set this to the new sequence number of the value
│ │ │ │ - that is to be stored. Sequence numbers must be monotonically increasing.
│ │ │ │ - Attempting to overwrite a value with a lower or equal sequence number
│ │ │ │ - will fail, even if the signature is correct.
│ │ │ │ - std::string const& salt
│ │ │ │ - this is the salt that was used for this put call.
│ │ │ │ -Since the callback function cb is called from within libtorrent, it is critical
│ │ │ │ -to not perform any blocking operations. Ideally not even locking a mutex. Pass
│ │ │ │ -any data required for this function along with the function object's context
│ │ │ │ -and make the function entirely self-contained. The only reason data blob's
│ │ │ │ -value is computed via a function instead of just passing in the new value is to
│ │ │ │ -avoid race conditions. If you want to uuppddaattee the value in the DHT, you must
│ │ │ │ -first retrieve it, then modify it, then write it back. The way the DHT works,
│ │ │ │ -it is natural to always do a lookup before storing and calling the callback in
│ │ │ │ -between is convenient.
│ │ │ │ + holepunched
│ │ │ │ + This flag is set if the peer was in holepunch mode when the connection
│ │ │ │ + succeeded. This typically only happens if both peers are behind a NAT and
│ │ │ │ + the peers connect via the NAT holepunch mechanism.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__ggeett__ppeeeerrss(()) ddhhtt__aannnnoouunnccee(()) **********
│ │ │ │ -void ddhhtt__aannnnoouunnccee (sha1_hash const& info_hash, int port = 0, dht::
│ │ │ │ -announce_flags_t flags = {});
│ │ │ │ -void ddhhtt__ggeett__ppeeeerrss (sha1_hash const& info_hash);
│ │ │ │ -dht_get_peers() will issue a DHT get_peer request to the DHT for the specified
│ │ │ │ -info-hash. The response (the peers) will be posted back in a
│ │ │ │ -_d_h_t___g_e_t___p_e_e_r_s___r_e_p_l_y___a_l_e_r_t.
│ │ │ │ -dht_announce() will issue a DHT announce request to the DHT to the specified
│ │ │ │ -info-hash, advertising the specified port. If the port is left at its default,
│ │ │ │ -0, the port will be implied by the DHT message's source port (which may improve
│ │ │ │ -connectivity through a NAT). dht_announce() is not affected by the
│ │ │ │ -announce_port override setting.
│ │ │ │ -Both these functions are exposed for advanced custom use of the DHT. All
│ │ │ │ -torrents eligible to be announce to the DHT will be automatically, by
│ │ │ │ -libtorrent.
│ │ │ │ -For possible flags, see _a_n_n_o_u_n_c_e___f_l_a_g_s___t.
│ │ │ │ + i2p_socket
│ │ │ │ + indicates that this socket is running on top of the I2P transport.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__lliivvee__nnooddeess(()) **********
│ │ │ │ -void ddhhtt__lliivvee__nnooddeess (sha1_hash const& nid);
│ │ │ │ -Retrieve all the live DHT (identified by nid) nodes. All the nodes id and
│ │ │ │ -endpoint will be returned in the list of nodes in the _a_l_e_r_t
│ │ │ │ -dht_live_nodes_alert. Since this _a_l_e_r_t is a response to an explicit call, it
│ │ │ │ -will always be posted, regardless of the _a_l_e_r_t mask.
│ │ │ │ + utp_socket
│ │ │ │ + indicates that this socket is a uTP socket
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__ssaammppllee__iinnffoohhaasshheess(()) **********
│ │ │ │ -void ddhhtt__ssaammppllee__iinnffoohhaasshheess (udp::endpoint const& ep, sha1_hash const& target);
│ │ │ │ -Query the DHT node specified by ep to retrieve a sample of the info-hashes that
│ │ │ │ -the node currently have in their storage. The target is included for iterative
│ │ │ │ -lookups so that indexing nodes can perform a key space traversal with a single
│ │ │ │ -RPC per node by adjusting the target value for each RPC. It has no effect on
│ │ │ │ -the returned sample value. The result is posted as a
│ │ │ │ -dht_sample_infohashes_alert.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddhhtt__ddiirreecctt__rreeqquueesstt(()) **********
│ │ │ │ -void ddhhtt__ddiirreecctt__rreeqquueesstt (udp::endpoint const& ep, entry const& e, client_data_t
│ │ │ │ -userdata = {});
│ │ │ │ -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 _d_h_t___d_i_r_e_c_t___r_e_s_p_o_n_s_e___a_l_e_r_t will be posted with the response (if
│ │ │ │ -any) and the userdata pointer passed in here. Since this _a_l_e_r_t is a response to
│ │ │ │ -an explicit call, it will always be posted, regardless of the _a_l_e_r_t mask.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__eexxtteennssiioonn(()) **********
│ │ │ │ -void aadddd__eexxtteennssiioonn (std::shared_ptr ext);
│ │ │ │ -void aadddd__eexxtteennssiioonn (std::function(
│ │ │ │ - torrent_handle const&, client_data_t)> ext);
│ │ │ │ -This function adds an extension to this _s_e_s_s_i_o_n. 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 _l_i_b_t_o_r_r_e_n_t_ _p_l_u_g_i_n_s.
│ │ │ │ -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
│ │ │ │ - directly. Makes it possible to join a swarm with just a tracker and info-
│ │ │ │ - hash.
│ │ │ │ -#include
│ │ │ │ -ses.add_extension(<::create_ut_metadata_plugin);
│ │ │ │ - uTorrent peer exchange
│ │ │ │ - Exchanges peers between clients.
│ │ │ │ -#include
│ │ │ │ -ses.add_extension(<::create_ut_pex_plugin);
│ │ │ │ - smart ban _p_l_u_g_i_n
│ │ │ │ - A _p_l_u_g_i_n that, with a small overhead, can ban peers that sends bad data
│ │ │ │ - with very high accuracy. Should eliminate most problems on poisoned
│ │ │ │ - torrents.
│ │ │ │ -#include
│ │ │ │ -ses.add_extension(<::create_smart_ban_plugin);
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__iipp__ffiilltteerr(()) ggeett__iipp__ffiilltteerr(()) **********
│ │ │ │ -ip_filter ggeett__iipp__ffiilltteerr () const;
│ │ │ │ -void sseett__iipp__ffiilltteerr (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 _i_p___f_i_l_t_e_r.
│ │ │ │ -Each time a peer is blocked because of the IP filter, a _p_e_e_r___b_l_o_c_k_e_d___a_l_e_r_t is
│ │ │ │ -generated. get_ip_filter() Returns the _i_p___f_i_l_t_e_r currently in the _s_e_s_s_i_o_n. See
│ │ │ │ -_i_p___f_i_l_t_e_r.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__ppoorrtt__ffiilltteerr(()) **********
│ │ │ │ -void sseett__ppoorrtt__ffiilltteerr (port_filter const& f);
│ │ │ │ -apply _p_o_r_t___f_i_l_t_e_r f to incoming and outgoing peers. a port filter will reject
│ │ │ │ -making outgoing peer connections to certain remote ports. The main intention is
│ │ │ │ -to be able to avoid triggering certain anti-virus software by connecting to
│ │ │ │ -SMTP, FTP ports.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iiss__lliisstteenniinngg(()) lliisstteenn__ppoorrtt(()) ssssll__lliisstteenn__ppoorrtt(()) **********
│ │ │ │ -unsigned short lliisstteenn__ppoorrtt () const;
│ │ │ │ -bool iiss__lliisstteenniinngg () const;
│ │ │ │ -unsigned short ssssll__lliisstteenn__ppoorrtt () const;
│ │ │ │ -is_listening() will tell you whether or not the _s_e_s_s_i_o_n has successfully opened
│ │ │ │ -a listening port. If it hasn't, this function will return false, and then you
│ │ │ │ -can set a new _s_e_t_t_i_n_g_s___p_a_c_k_:_:_l_i_s_t_e_n___i_n_t_e_r_f_a_c_e_s to try another interface and
│ │ │ │ -port to bind to.
│ │ │ │ -listen_port() returns the port we ended up listening on.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__ppeeeerr__ccllaassss__ffiilltteerr(()) ggeett__ppeeeerr__ccllaassss__ffiilltteerr(()) **********
│ │ │ │ -void sseett__ppeeeerr__ccllaassss__ffiilltteerr (ip_filter const& f);
│ │ │ │ -ip_filter ggeett__ppeeeerr__ccllaassss__ffiilltteerr () const;
│ │ │ │ -Sets the peer class filter for this _s_e_s_s_i_o_n. All new peer connections will take
│ │ │ │ -this into account and be added to the peer classes specified by this filter,
│ │ │ │ -based on the peer's IP address.
│ │ │ │ -The ip-filter essentially maps an IP -> uint32. Each bit in that 32 bit integer
│ │ │ │ -represents a peer class. The least significant bit represents class 0, the next
│ │ │ │ -bit class 1 and so on.
│ │ │ │ -For more info, see _i_p___f_i_l_t_e_r.
│ │ │ │ -For example, to make all peers in the range 200.1.1.0 - 200.1.255.255 belong to
│ │ │ │ -their own peer class, apply the following filter:
│ │ │ │ -ip_filter f = ses.get_peer_class_filter();
│ │ │ │ -peer_class_t my_class = ses.create_peer_class("200.1.x.x IP range");
│ │ │ │ -f.add_rule(make_address("200.1.1.0"), make_address("200.1.255.255")
│ │ │ │ - , 1 << static_cast(my_class));
│ │ │ │ -ses.set_peer_class_filter(f);
│ │ │ │ -This setting only applies to new connections, it won't affect existing peer
│ │ │ │ -connections.
│ │ │ │ -This function is limited to only peer class 0-31, since there are only 32 bits
│ │ │ │ -in the IP range mapping. Only the set bits matter; no peer class will be
│ │ │ │ -removed from a peer as a result of this call, peer classes are only added.
│ │ │ │ -The peer_class argument cannot be greater than 31. The bitmasks representing
│ │ │ │ -peer classes in the peer_class_filter are 32 bits.
│ │ │ │ -The get_peer_class_filter() function returns the current filter.
│ │ │ │ -For more information, see _p_e_e_r_ _c_l_a_s_s_e_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr(()) ggeett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr(()) **********
│ │ │ │ -peer_class_type_filter ggeett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr () const;
│ │ │ │ -void sseett__ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr (peer_class_type_filter const& f);
│ │ │ │ -Sets and gets the ppeeeerr ccllaassss ttyyppee ffiilltteerr. This is controls automatic peer class
│ │ │ │ -assignments to peers based on what kind of socket it is.
│ │ │ │ -It does not only support assigning peer classes, it also supports removing peer
│ │ │ │ -classes based on socket type.
│ │ │ │ -The order of these rules being applied are:
│ │ │ │ - 1. peer-class IP filter
│ │ │ │ - 2. peer-class type filter, removing classes
│ │ │ │ - 3. peer-class type filter, adding classes
│ │ │ │ -For more information, see _p_e_e_r_ _c_l_a_s_s_e_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ccrreeaattee__ppeeeerr__ccllaassss(()) **********
│ │ │ │ -peer_class_t ccrreeaattee__ppeeeerr__ccllaassss (char const* name);
│ │ │ │ -Creates a new peer class (see _p_e_e_r_ _c_l_a_s_s_e_s) with the given name. The returned
│ │ │ │ -integer is the new peer class identifier. Peer classes may have the same name,
│ │ │ │ -so each invocation of this function creates a new class and returns a unique
│ │ │ │ -identifier.
│ │ │ │ -Identifiers are assigned from low numbers to higher. So if you plan on using
│ │ │ │ -certain peer classes in a call to _s_e_t___p_e_e_r___c_l_a_s_s___f_i_l_t_e_r_(_), make sure to create
│ │ │ │ -those early on, to get low identifiers.
│ │ │ │ -For more information on peer classes, see _p_e_e_r_ _c_l_a_s_s_e_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddeelleettee__ppeeeerr__ccllaassss(()) **********
│ │ │ │ -void ddeelleettee__ppeeeerr__ccllaassss (peer_class_t cid);
│ │ │ │ -This call dereferences the reference count of the specified peer class. When
│ │ │ │ -creating a peer class it's automatically referenced by 1. If you want to
│ │ │ │ -recycle a peer class, you may call this function. You may only call this
│ │ │ │ -function oonnccee per peer class you create. Calling it more than once for the same
│ │ │ │ -class will lead to memory corruption.
│ │ │ │ -Since peer classes are reference counted, this function will not remove the
│ │ │ │ -peer class if it's still assigned to torrents or peers. It will however remove
│ │ │ │ -it once the last peer and torrent drops their references to it.
│ │ │ │ -There is no need to call this function for custom peer classes. All peer
│ │ │ │ -classes will be properly destructed when the _s_e_s_s_i_o_n object destructs.
│ │ │ │ -For more information on peer classes, see _p_e_e_r_ _c_l_a_s_s_e_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__ppeeeerr__ccllaassss(()) ggeett__ppeeeerr__ccllaassss(()) **********
│ │ │ │ -void sseett__ppeeeerr__ccllaassss (peer_class_t cid, peer_class_info const& pci);
│ │ │ │ -peer_class_info ggeett__ppeeeerr__ccllaassss (peer_class_t cid) const;
│ │ │ │ -These functions queries information from a peer class and updates the
│ │ │ │ -configuration of a peer class, respectively.
│ │ │ │ -cid must refer to an existing peer class. If it does not, the return value of
│ │ │ │ -get_peer_class() is undefined.
│ │ │ │ -set_peer_class() sets all the information in the _p_e_e_r___c_l_a_s_s___i_n_f_o object in the
│ │ │ │ -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
│ │ │ │ -any of its classes is the one that is taken into account.
│ │ │ │ -For more information, see _p_e_e_r_ _c_l_a_s_s_e_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreemmoovvee__ttoorrrreenntt(()) **********
│ │ │ │ -void rreemmoovvee__ttoorrrreenntt (const torrent_handle&, remove_flags_t = {});
│ │ │ │ -remove_torrent() will close all peer connections associated with the torrent
│ │ │ │ -and tell the tracker that we've stopped participating in the swarm. This
│ │ │ │ -operation cannot fail. When it completes, you will receive a
│ │ │ │ -_t_o_r_r_e_n_t___r_e_m_o_v_e_d___a_l_e_r_t.
│ │ │ │ -_r_e_m_o_v_e___t_o_r_r_e_n_t_(_) is non-blocking, but will remove the torrent from the _s_e_s_s_i_o_n
│ │ │ │ -synchronously. Calling _s_e_s_s_i_o_n___h_a_n_d_l_e_:_:_a_d_d___t_o_r_r_e_n_t_(_) immediately afterward with
│ │ │ │ -the same torrent will succeed. Note that this creates a new handle which is not
│ │ │ │ -equal to the removed one.
│ │ │ │ -The optional second argument options can be used to delete all the files
│ │ │ │ -downloaded by this torrent. To do so, pass in the value session_handle::
│ │ │ │ -delete_files. Once the torrent is deleted, a _t_o_r_r_e_n_t___d_e_l_e_t_e_d___a_l_e_r_t is posted.
│ │ │ │ -The _t_o_r_r_e_n_t___h_a_n_d_l_e remains valid for some time after _r_e_m_o_v_e___t_o_r_r_e_n_t_(_) is
│ │ │ │ -called. It will become invalid only after all libtorrent tasks (such as I/
│ │ │ │ -O tasks) release their references to the torrent. Until this happens,
│ │ │ │ -_t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_i_s___v_a_l_i_d_(_) will return true, and other calls such as
│ │ │ │ -_t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_s_t_a_t_u_s_(_) will succeed. Because of this, and because
│ │ │ │ -_r_e_m_o_v_e___t_o_r_r_e_n_t_(_) is non-blocking, the following sequence usually succeeds (does
│ │ │ │ -not throw system_error): .. code:: c++
│ │ │ │ - session.remove_handle(handle); handle.save_resume_data();
│ │ │ │ -Note that when a queued or downloading torrent is removed, its position in the
│ │ │ │ -download queue is vacated and every subsequent torrent in the queue has their
│ │ │ │ -queue positions updated. This can potentially cause a large state_update to be
│ │ │ │ -posted. When removing all torrents, it is advised to remove them from the back
│ │ │ │ -of the queue, to minimize the shifting.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aappppllyy__sseettttiinnggss(()) ggeett__sseettttiinnggss(()) **********
│ │ │ │ -void aappppllyy__sseettttiinnggss (settings_pack&&);
│ │ │ │ -settings_pack ggeett__sseettttiinnggss () const;
│ │ │ │ -void aappppllyy__sseettttiinnggss (settings_pack const&);
│ │ │ │ -Applies the settings specified by the _s_e_t_t_i_n_g_s___p_a_c_k s. This is an asynchronous
│ │ │ │ -operation that will return immediately and actually apply the settings to the
│ │ │ │ -main thread of libtorrent some time later.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__aalleerrtt__nnoottiiffyy(()) wwaaiitt__ffoorr__aalleerrtt(()) ppoopp__aalleerrttss(()) **********
│ │ │ │ -alert* wwaaiitt__ffoorr__aalleerrtt (time_duration max_wait);
│ │ │ │ -void sseett__aalleerrtt__nnoottiiffyy (std::function const& fun);
│ │ │ │ -void ppoopp__aalleerrttss (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
│ │ │ │ -_s_e_s_s_i_o_n still owns these alerts and they will stay valid until the next time
│ │ │ │ -pop_alerts is called. You may not delete the _a_l_e_r_t objects.
│ │ │ │ -It is safe to call pop_alerts from multiple different threads, as long as the
│ │ │ │ -alerts themselves are not accessed once another thread calls pop_alerts. Doing
│ │ │ │ -this requires manual synchronization between the popping threads.
│ │ │ │ -wait_for_alert will block the current thread for max_wait time duration, or
│ │ │ │ -until another _a_l_e_r_t is posted. If an _a_l_e_r_t is available at the time of the
│ │ │ │ -call, it returns immediately. The returned _a_l_e_r_t pointer is the head of the
│ │ │ │ -_a_l_e_r_t queue. wait_for_alert does not pop alerts from the queue, it merely peeks
│ │ │ │ -at it. The returned _a_l_e_r_t will stay valid until pop_alerts is called twice. The
│ │ │ │ -first time will pop it and the second will free it.
│ │ │ │ -If there is no _a_l_e_r_t in the queue and no _a_l_e_r_t arrives within the specified
│ │ │ │ -timeout, wait_for_alert returns nullptr. If there are alerts available to be
│ │ │ │ -popped, the non-null pointer that's returned is of an unspecified _a_l_e_r_t.
│ │ │ │ -In the python binding, wait_for_alert takes the number of milliseconds to wait
│ │ │ │ -as an integer.
│ │ │ │ -The _a_l_e_r_t queue in the _s_e_s_s_i_o_n will not grow indefinitely. Make sure to pop
│ │ │ │ -periodically to not miss notifications. To control the max number of alerts
│ │ │ │ -that's queued by the _s_e_s_s_i_o_n, see settings_pack::alert_queue_size.
│ │ │ │ -Some alerts are considered so important that they are posted even when the
│ │ │ │ -_a_l_e_r_t queue is full. Some alerts are considered mandatory and cannot be
│ │ │ │ -disabled by the alert_mask. For instance, _s_a_v_e___r_e_s_u_m_e___d_a_t_a___a_l_e_r_t and
│ │ │ │ -_s_a_v_e___r_e_s_u_m_e___d_a_t_a___f_a_i_l_e_d___a_l_e_r_t are always posted, regardless of the _a_l_e_r_t mask.
│ │ │ │ -To control which alerts are posted, set the alert_mask (_s_e_t_t_i_n_g_s___p_a_c_k_:_:
│ │ │ │ -_a_l_e_r_t___m_a_s_k).
│ │ │ │ -If the _a_l_e_r_t queue fills up to the point where alerts are dropped, this will be
│ │ │ │ -indicated by a _a_l_e_r_t_s___d_r_o_p_p_e_d___a_l_e_r_t, which contains a bitmask of which types of
│ │ │ │ -alerts were dropped. Generally it is a good idea to make sure the _a_l_e_r_t queue
│ │ │ │ -is large enough, the alert_mask doesn't have unnecessary categories enabled and
│ │ │ │ -to call pop_alert() frequently, to avoid alerts being dropped.
│ │ │ │ -the set_alert_notify function lets the client set a function object to be
│ │ │ │ -invoked every time the _a_l_e_r_t queue goes from having 0 alerts to 1 _a_l_e_r_t. This
│ │ │ │ -function is called from within libtorrent, it may be the main thread, or it may
│ │ │ │ -be from within a user call. The intention of of the function is that the client
│ │ │ │ -wakes up its main thread, to poll for more alerts using pop_alerts(). If the
│ │ │ │ -notify function fails to do so, it won't be called again, until pop_alerts is
│ │ │ │ -called for some other reason. For instance, it could signal an eventfd, post a
│ │ │ │ -message to an HWND or some other main message pump. The actual retrieval of
│ │ │ │ -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 _a_l_e_r_t is returned by the polymorphic function alert::type() but
│ │ │ │ -can also be queries from a concrete type via T::alert_type, as a static
│ │ │ │ -constant.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddeelleettee__ppoorrtt__mmaappppiinngg(()) aadddd__ppoorrtt__mmaappppiinngg(()) **********
│ │ │ │ -void ddeelleettee__ppoorrtt__mmaappppiinngg (port_mapping_t handle);
│ │ │ │ -std::vector aadddd__ppoorrtt__mmaappppiinngg (portmap_protocol t, int
│ │ │ │ -external_port, int local_port);
│ │ │ │ -add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,
│ │ │ │ -whichever is enabled. A mapping is created for each listen socket in the
│ │ │ │ -_s_e_s_s_i_o_n. The return values are all handles referring to the port mappings that
│ │ │ │ -were just created. Pass them to _d_e_l_e_t_e___p_o_r_t___m_a_p_p_i_n_g_(_) to remove them.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreeooppeenn__nneettwwoorrkk__ssoocckkeettss(()) **********
│ │ │ │ -void rreeooppeenn__nneettwwoorrkk__ssoocckkeettss (reopen_network_flags_t options =
│ │ │ │ -reopen_map_ports);
│ │ │ │ -Instructs the _s_e_s_s_i_o_n to reopen all listen and outgoing sockets.
│ │ │ │ -It's useful in the case your platform doesn't support the built in IP notifier
│ │ │ │ -mechanism, or if you have a better more reliable way to detect changes in the
│ │ │ │ -IP routing table.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnaattiivvee__hhaannddllee(()) **********
│ │ │ │ -std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ -This function is intended only for use by plugins. This type does not have a
│ │ │ │ -stable API and should be relied on as little as possible.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - save_settings
│ │ │ │ - saves settings (i.e. the _s_e_t_t_i_n_g_s___p_a_c_k)
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - save_dht_state
│ │ │ │ - saves dht state such as nodes and node-id, possibly accelerating joining
│ │ │ │ - the DHT if provided at next _s_e_s_s_i_o_n startup.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - save_extension_state
│ │ │ │ - load or save state from plugins
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - save_ip_filter
│ │ │ │ - load or save the IP filter set on the _s_e_s_s_i_o_n
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - global_peer_class_id tcp_peer_class_id local_peer_class_id
│ │ │ │ - built-in peer classes
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - delete_files
│ │ │ │ - delete the files belonging to the torrent from disk. including the part-
│ │ │ │ - file, if there is one
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - delete_partfile
│ │ │ │ - delete just the part-file associated with this torrent
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - paused
│ │ │ │ - when set, the _s_e_s_s_i_o_n will start paused. Call _s_e_s_s_i_o_n___h_a_n_d_l_e_:_:_r_e_s_u_m_e_(_) to
│ │ │ │ - start
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - udp tcp
│ │ │ │ - protocols used by _a_d_d___p_o_r_t___m_a_p_p_i_n_g_(_)
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - reopen_map_ports
│ │ │ │ - This option indicates if the ports are mapped using natpmp and upnp. If
│ │ │ │ - mapping was already made, they are deleted and added again. This only
│ │ │ │ - works if natpmp and/or upnp are configured to be enable.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ sseessssiioonn__pprrooxxyy ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n_._h_p_p"
│ │ │ │ -this is a holder for the internal _s_e_s_s_i_o_n implementation object. Once the
│ │ │ │ -_s_e_s_s_i_o_n destruction is explicitly initiated, this holder is used to synchronize
│ │ │ │ -the completion of the shutdown. The lifetime of this object may outlive
│ │ │ │ -_s_e_s_s_i_o_n, causing the _s_e_s_s_i_o_n destructor to not block. The _s_e_s_s_i_o_n___p_r_o_x_y
│ │ │ │ -destructor will block however, until the underlying _s_e_s_s_i_o_n is done shutting
│ │ │ │ -down.
│ │ │ │ -struct session_proxy
│ │ │ │ -{
│ │ │ │ - session_proxy& ooppeerraattoorr== (session_proxy&&) & noexcept;
│ │ │ │ - ~~sseessssiioonn__pprrooxxyy ();
│ │ │ │ - sseessssiioonn__pprrooxxyy (session_proxy const&);
│ │ │ │ - sseessssiioonn__pprrooxxyy ();
│ │ │ │ - session_proxy& ooppeerraattoorr== (session_proxy const&) &;
│ │ │ │ - sseessssiioonn__pprrooxxyy (session_proxy&&) noexcept;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseessssiioonn__pprrooxxyy(()) ooppeerraattoorr==(()) ~~sseessssiioonn__pprrooxxyy(()) **********
│ │ │ │ -session_proxy& ooppeerraattoorr== (session_proxy&&) & noexcept;
│ │ │ │ -~~sseessssiioonn__pprrooxxyy ();
│ │ │ │ -sseessssiioonn__pprrooxxyy (session_proxy const&);
│ │ │ │ -sseessssiioonn__pprrooxxyy ();
│ │ │ │ -session_proxy& ooppeerraattoorr== (session_proxy const&) &;
│ │ │ │ -sseessssiioonn__pprrooxxyy (session_proxy&&) noexcept;
│ │ │ │ -default constructor, does not refer to any _s_e_s_s_i_o_n implementation object.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ sseessssiioonn ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n_._h_p_p"
│ │ │ │ -The _s_e_s_s_i_o_n holds all state that spans multiple torrents. Among other things it
│ │ │ │ -runs the network loop and manages all torrents. Once it's created, the _s_e_s_s_i_o_n
│ │ │ │ -object will spawn the main thread that will do all the work. The main thread
│ │ │ │ -will be idle as long it doesn't have any torrents to participate in.
│ │ │ │ -You have some control over _s_e_s_s_i_o_n configuration through the session_handle::
│ │ │ │ -apply_settings() member function. To change one or more configuration options,
│ │ │ │ -create a _s_e_t_t_i_n_g_s___p_a_c_k. object and fill it with the settings to be set and pass
│ │ │ │ -it in to session::apply_settings().
│ │ │ │ -see _a_p_p_l_y___s_e_t_t_i_n_g_s_(_).
│ │ │ │ -struct session : session_handle
│ │ │ │ -{
│ │ │ │ - explicit sseessssiioonn (session_params const& params);
│ │ │ │ - sseessssiioonn ();
│ │ │ │ - sseessssiioonn (session_params&& params, session_flags_t flags);
│ │ │ │ - explicit sseessssiioonn (session_params&& params);
│ │ │ │ - sseessssiioonn (session_params const& params, session_flags_t flags);
│ │ │ │ - sseessssiioonn (session_params const& params, io_context& ios, session_flags_t);
│ │ │ │ - sseessssiioonn (session_params&& params, io_context& ios, session_flags_t);
│ │ │ │ - sseessssiioonn (session_params const& params, io_context& ios);
│ │ │ │ - sseessssiioonn (session_params&& params, io_context& ios);
│ │ │ │ - ~~sseessssiioonn ();
│ │ │ │ - session_proxy aabboorrtt ();
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseessssiioonn(()) **********
│ │ │ │ -explicit sseessssiioonn (session_params const& params);
│ │ │ │ -sseessssiioonn ();
│ │ │ │ -sseessssiioonn (session_params&& params, session_flags_t flags);
│ │ │ │ -explicit sseessssiioonn (session_params&& params);
│ │ │ │ -sseessssiioonn (session_params const& params, session_flags_t flags);
│ │ │ │ -Constructs the _s_e_s_s_i_o_n objects which acts as the container of torrents. In
│ │ │ │ -order to avoid a race condition between starting the _s_e_s_s_i_o_n and configuring
│ │ │ │ -it, you can pass in a _s_e_s_s_i_o_n___p_a_r_a_m_s object. Its settings will take effect
│ │ │ │ -before the _s_e_s_s_i_o_n starts up.
│ │ │ │ -The overloads taking flags can be used to start a _s_e_s_s_i_o_n in paused mode (by
│ │ │ │ -passing in session::paused). Note that add_default_plugins do not have an
│ │ │ │ -affect on constructors that take a _s_e_s_s_i_o_n___p_a_r_a_m_s object. It already contains
│ │ │ │ -the plugins to use.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseessssiioonn(()) **********
│ │ │ │ -sseessssiioonn (session_params const& params, io_context& ios, session_flags_t);
│ │ │ │ -sseessssiioonn (session_params&& params, io_context& ios, session_flags_t);
│ │ │ │ -sseessssiioonn (session_params const& params, io_context& ios);
│ │ │ │ -sseessssiioonn (session_params&& params, io_context& ios);
│ │ │ │ -Overload of the constructor that takes an external io_context to run the
│ │ │ │ -_s_e_s_s_i_o_n object on. This is primarily useful for tests that may want to run
│ │ │ │ -multiple sessions on a single io_context, or low resource systems where
│ │ │ │ -additional threads are expensive and sharing an io_context with other events is
│ │ │ │ -fine.
│ │ │ │ -Warning
│ │ │ │ -The _s_e_s_s_i_o_n object does not cleanly terminate with an external io_context. The
│ │ │ │ -io_context::run() call mmuusstt have returned before it's safe to destruct the
│ │ │ │ -_s_e_s_s_i_o_n. Which means you MMUUSSTT call _s_e_s_s_i_o_n_:_:_a_b_o_r_t_(_) and save the _s_e_s_s_i_o_n___p_r_o_x_y
│ │ │ │ -first, then destruct the _s_e_s_s_i_o_n object, then sync with the io_context, then
│ │ │ │ -destruct the _s_e_s_s_i_o_n___p_r_o_x_y object.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ~~sseessssiioonn(()) **********
│ │ │ │ -~~sseessssiioonn ();
│ │ │ │ -The destructor of _s_e_s_s_i_o_n will notify all trackers that our torrents have been
│ │ │ │ -shut down. If some trackers are down, they will time out. All this before the
│ │ │ │ -destructor of _s_e_s_s_i_o_n returns. So, it's advised that any kind of interface
│ │ │ │ -(such as windows) are closed before destructing the _s_e_s_s_i_o_n object. Because it
│ │ │ │ -can take a few second for it to finish. The timeout can be set with
│ │ │ │ -_a_p_p_l_y___s_e_t_t_i_n_g_s_(_).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aabboorrtt(()) **********
│ │ │ │ -session_proxy aabboorrtt ();
│ │ │ │ -In case you want to destruct the _s_e_s_s_i_o_n asynchronously, you can request a
│ │ │ │ -_s_e_s_s_i_o_n destruction proxy. If you don't do this, the destructor of the _s_e_s_s_i_o_n
│ │ │ │ -object will block while the trackers are contacted. If you keep one
│ │ │ │ -session_proxy to the _s_e_s_s_i_o_n when destructing it, the destructor will not
│ │ │ │ -block, but start to close down the _s_e_s_s_i_o_n, the destructor of the proxy will
│ │ │ │ -then synchronize the threads. So, the destruction of the _s_e_s_s_i_o_n is performed
│ │ │ │ -from the session destructor call until the session_proxy destructor call. The
│ │ │ │ -session_proxy does not have any operations on it (since the _s_e_s_s_i_o_n is being
│ │ │ │ -closed down, no operations are allowed on it). The only valid operation is
│ │ │ │ -calling the destructor:
│ │ │ │ -struct session_proxy {};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ wwrriittee__sseessssiioonn__ppaarraammss__bbuuff(()) rreeaadd__sseessssiioonn__ppaarraammss(()) wwrriittee__sseessssiioonn__ppaarraammss(())
│ │ │ │ -************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_e_s_s_i_o_n___p_a_r_a_m_s_._h_p_p"
│ │ │ │ -std::vector wwrriittee__sseessssiioonn__ppaarraammss__bbuuff (session_params const& sp
│ │ │ │ - , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ -session_params rreeaadd__sseessssiioonn__ppaarraammss (bdecode_node const& e
│ │ │ │ - , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ -entry wwrriittee__sseessssiioonn__ppaarraammss (session_params const& sp
│ │ │ │ - , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ -session_params rreeaadd__sseessssiioonn__ppaarraammss (span buf
│ │ │ │ - , save_state_flags_t flags = save_state_flags_t::all());
│ │ │ │ -These functions serialize and de-serialize a session_params object to and from
│ │ │ │ -bencoded form. The _s_e_s_s_i_o_n___p_a_r_a_m_s object is used to initialize a new _s_e_s_s_i_o_n
│ │ │ │ -using the state from a previous one (or by programmatically configure the
│ │ │ │ -_s_e_s_s_i_o_n up-front). The flags parameter can be used to only save and load
│ │ │ │ -certain aspects of the session's state. The _buf suffix indicates the function
│ │ │ │ -operates on buffer rather than the bencoded structure. The torrents in a
│ │ │ │ -_s_e_s_s_i_o_n are not part of the _s_e_s_s_i_o_n___p_a_r_a_m_s state, they have to be restored
│ │ │ │ -separately.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppiieeccee__bblloocckk ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_i_e_c_e___b_l_o_c_k_._h_p_p"
│ │ │ │ -struct piece_block
│ │ │ │ -{
│ │ │ │ - ppiieeccee__bblloocckk (piece_index_t p_index, int b_index);
│ │ │ │ - ppiieeccee__bblloocckk () = default;
│ │ │ │ - bool ooppeerraattoorr<< (piece_block const& b) const;
│ │ │ │ - bool ooppeerraattoorr==== (piece_block const& b) const;
│ │ │ │ - bool ooppeerraattoorr!!== (piece_block const& b) const;
│ │ │ │ -
│ │ │ │ - static const piece_block invalid;
│ │ │ │ - piece_index_t piece_index {0};
│ │ │ │ - int bblloocckk__iinnddeexx = 0;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppeeeerr__rreeqquueesstt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___r_e_q_u_e_s_t_._h_p_p"
│ │ │ │ -represents a byte range within a piece. Internally this is is used for incoming
│ │ │ │ -piece requests.
│ │ │ │ -struct peer_request
│ │ │ │ -{
│ │ │ │ - bool ooppeerraattoorr==== (peer_request const& r) const;
│ │ │ │ -
│ │ │ │ - piece_index_t piece;
│ │ │ │ - int start;
│ │ │ │ - int length;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ooppeerraattoorr====(()) **********
│ │ │ │ -bool ooppeerraattoorr==== (peer_request const& r) const;
│ │ │ │ -returns true if the right hand side _p_e_e_r___r_e_q_u_e_s_t refers to the same range as
│ │ │ │ -this does.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - piece
│ │ │ │ - The index of the piece in which the range starts.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - start
│ │ │ │ - The byte offset within that piece where the range starts.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - length
│ │ │ │ - The size of the range, in bytes.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppeeeerr__iinnffoo ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___i_n_f_o_._h_p_p"
│ │ │ │ -holds information and statistics about one peer that libtorrent is connected to
│ │ │ │ -struct peer_info
│ │ │ │ -{
│ │ │ │ - sha256_hash ii22pp__ddeessttiinnaattiioonn () const;
│ │ │ │ -
│ │ │ │ - std::string client;
│ │ │ │ - typed_bitfield pieces;
│ │ │ │ - std::int64_t total_download;
│ │ │ │ - std::int64_t total_upload;
│ │ │ │ - time_duration last_request;
│ │ │ │ - time_duration last_active;
│ │ │ │ - time_duration download_queue_time;
│ │ │ │ - static constexpr peer_flags_t iinntteerreessttiinngg = 0_bit;
│ │ │ │ - static constexpr peer_flags_t cchhookkeedd = 1_bit;
│ │ │ │ - static constexpr peer_flags_t rreemmoottee__iinntteerreesstteedd = 2_bit;
│ │ │ │ - static constexpr peer_flags_t rreemmoottee__cchhookkeedd = 3_bit;
│ │ │ │ - static constexpr peer_flags_t ssuuppppoorrttss__eexxtteennssiioonnss = 4_bit;
│ │ │ │ - static constexpr peer_flags_t oouuttggooiinngg__ccoonnnneeccttiioonn = 5_bit;
│ │ │ │ - static constexpr peer_flags_t llooccaall__ccoonnnneeccttiioonn = 5_bit;
│ │ │ │ - static constexpr peer_flags_t hhaannddsshhaakkee = 6_bit;
│ │ │ │ - static constexpr peer_flags_t ccoonnnneeccttiinngg = 7_bit;
│ │ │ │ - static constexpr peer_flags_t oonn__ppaarroollee = 9_bit;
│ │ │ │ - static constexpr peer_flags_t sseeeedd = 10_bit;
│ │ │ │ - static constexpr peer_flags_t ooppttiimmiissttiicc__uunncchhookkee = 11_bit;
│ │ │ │ - static constexpr peer_flags_t ssnnuubbbbeedd = 12_bit;
│ │ │ │ - static constexpr peer_flags_t uuppllooaadd__oonnllyy = 13_bit;
│ │ │ │ - static constexpr peer_flags_t eennddggaammee__mmooddee = 14_bit;
│ │ │ │ - static constexpr peer_flags_t hhoolleeppuunncchheedd = 15_bit;
│ │ │ │ - static constexpr peer_flags_t ii22pp__ssoocckkeett = 16_bit;
│ │ │ │ - static constexpr peer_flags_t uuttpp__ssoocckkeett = 17_bit;
│ │ │ │ - static constexpr peer_flags_t ssssll__ssoocckkeett = 18_bit;
│ │ │ │ - static constexpr peer_flags_t rrcc44__eennccrryypptteedd = 19_bit;
│ │ │ │ - static constexpr peer_flags_t ppllaaiinntteexxtt__eennccrryypptteedd = 20_bit;
│ │ │ │ - peer_flags_t flags;
│ │ │ │ - static constexpr peer_source_flags_t ttrraacckkeerr = 0_bit;
│ │ │ │ - static constexpr peer_source_flags_t ddhhtt = 1_bit;
│ │ │ │ - static constexpr peer_source_flags_t ppeexx = 2_bit;
│ │ │ │ - static constexpr peer_source_flags_t llssdd = 3_bit;
│ │ │ │ - static constexpr peer_source_flags_t rreessuummee__ddaattaa = 4_bit;
│ │ │ │ - static constexpr peer_source_flags_t iinnccoommiinngg = 5_bit;
│ │ │ │ - peer_source_flags_t source;
│ │ │ │ - int up_speed;
│ │ │ │ - int down_speed;
│ │ │ │ - int payload_up_speed;
│ │ │ │ - int payload_down_speed;
│ │ │ │ - peer_id pid;
│ │ │ │ - int queue_bytes;
│ │ │ │ - int request_timeout;
│ │ │ │ - int send_buffer_size;
│ │ │ │ - int used_send_buffer;
│ │ │ │ - int receive_buffer_size;
│ │ │ │ - int used_receive_buffer;
│ │ │ │ - int receive_buffer_watermark;
│ │ │ │ - int num_hashfails;
│ │ │ │ - int download_queue_length;
│ │ │ │ - int timed_out_requests;
│ │ │ │ - int busy_requests;
│ │ │ │ - int requests_in_buffer;
│ │ │ │ - int target_dl_queue_length;
│ │ │ │ - int upload_queue_length;
│ │ │ │ - int failcount;
│ │ │ │ - piece_index_t downloading_piece_index;
│ │ │ │ - int downloading_block_index;
│ │ │ │ - int downloading_progress;
│ │ │ │ - int downloading_total;
│ │ │ │ - static constexpr connection_type_t ssttaannddaarrdd__bbiittttoorrrreenntt = 0_bit;
│ │ │ │ - static constexpr connection_type_t wweebb__sseeeedd = 1_bit;
│ │ │ │ - static constexpr connection_type_t hhttttpp__sseeeedd = 2_bit;
│ │ │ │ - connection_type_t connection_type;
│ │ │ │ - int pending_disk_bytes;
│ │ │ │ - int pending_disk_read_bytes;
│ │ │ │ - int send_quota;
│ │ │ │ - int receive_quota;
│ │ │ │ - int rtt;
│ │ │ │ - int num_pieces;
│ │ │ │ - int download_rate_peak;
│ │ │ │ - int upload_rate_peak;
│ │ │ │ - float progress;
│ │ │ │ - int progress_ppm;
│ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t ip;
│ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t local_endpoint;
│ │ │ │ - static constexpr bandwidth_state_flags_t bbww__iiddllee = 0_bit;
│ │ │ │ - static constexpr bandwidth_state_flags_t bbww__lliimmiitt = 1_bit;
│ │ │ │ - static constexpr bandwidth_state_flags_t bbww__nneettwwoorrkk = 2_bit;
│ │ │ │ - static constexpr bandwidth_state_flags_t bbww__ddiisskk = 4_bit;
│ │ │ │ - bandwidth_state_flags_t read_state;
│ │ │ │ - bandwidth_state_flags_t write_state;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ii22pp__ddeessttiinnaattiioonn(()) **********
│ │ │ │ -sha256_hash ii22pp__ddeessttiinnaattiioonn () const;
│ │ │ │ -If this peer is an i2p peer, this function returns the destination address of
│ │ │ │ -the peer
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - client
│ │ │ │ - A human readable string describing the software at the other end of the
│ │ │ │ - connection. In some cases this information is not available, then it will
│ │ │ │ - contain a string that may give away something about which software is
│ │ │ │ - running in the other end. In the case of a web seed, the server type and
│ │ │ │ - version will be a part of this string. This is UTF-8 encoded.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - pieces
│ │ │ │ - a _b_i_t_f_i_e_l_d, with one bit per piece in the torrent. Each bit tells you if
│ │ │ │ - the peer has that piece (if it's set to 1) or if the peer miss that piece
│ │ │ │ - (set to 0).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - total_download total_upload
│ │ │ │ - the total number of bytes downloaded from and uploaded to this peer.
│ │ │ │ - These numbers do not include the protocol chatter, but only the payload
│ │ │ │ - data.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - last_request last_active
│ │ │ │ - the time since we last sent a request to this peer and since any transfer
│ │ │ │ - occurred with this peer
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - download_queue_time
│ │ │ │ - the time until all blocks in the request queue will be downloaded
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - interesting
│ │ │ │ - wwee are interested in pieces from this peer.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - choked
│ │ │ │ - wwee have choked this peer.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - remote_interested
│ │ │ │ - the peer is interested in uuss
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - remote_choked
│ │ │ │ - the peer has choked uuss.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - supports_extensions
│ │ │ │ - means that this peer supports the _e_x_t_e_n_s_i_o_n_ _p_r_o_t_o_c_o_l.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - outgoing_connection
│ │ │ │ - The connection was initiated by us, the peer has a listen port open, and
│ │ │ │ - that port is the same as in the address of this peer. If this flag is not
│ │ │ │ - set, this peer connection was opened by this peer connecting to us.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - local_connection
│ │ │ │ - deprecated synonym for outgoing_connection
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - handshake
│ │ │ │ - The connection is opened, and waiting for the handshake. Until the
│ │ │ │ - handshake is done, the peer cannot be identified.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - connecting
│ │ │ │ - The connection is in a half-open state (i.e. it is being connected).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - on_parole
│ │ │ │ - The peer has participated in a piece that failed the hash check, and is
│ │ │ │ - now "on parole", which means we're only requesting whole pieces from this
│ │ │ │ - peer until it either fails that piece or proves that it doesn't send bad
│ │ │ │ - data.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - seed
│ │ │ │ - This peer is a seed (it has all the pieces).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - optimistic_unchoke
│ │ │ │ - This peer is subject to an optimistic unchoke. It has been unchoked for a
│ │ │ │ - while to see if it might unchoke us in return an earn an upload/unchoke
│ │ │ │ - slot. If it doesn't within some period of time, it will be choked and
│ │ │ │ - another peer will be optimistically unchoked.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - snubbed
│ │ │ │ - This peer has recently failed to send a block within the request timeout
│ │ │ │ - from when the request was sent. We're currently picking one block at a
│ │ │ │ - time from this peer.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - upload_only
│ │ │ │ - This peer has either explicitly (with an extension) or implicitly (by
│ │ │ │ - becoming a seed) told us that it will not downloading anything more,
│ │ │ │ - regardless of which pieces we have.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - endgame_mode
│ │ │ │ - This means the last time this peer picket a piece, it could not pick as
│ │ │ │ - many as it wanted because there were not enough free ones. i.e. all
│ │ │ │ - pieces this peer has were already requested from other peers.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - holepunched
│ │ │ │ - This flag is set if the peer was in holepunch mode when the connection
│ │ │ │ - succeeded. This typically only happens if both peers are behind a NAT and
│ │ │ │ - the peers connect via the NAT holepunch mechanism.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - i2p_socket
│ │ │ │ - indicates that this socket is running on top of the I2P transport.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - utp_socket
│ │ │ │ - indicates that this socket is a uTP socket
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - ssl_socket
│ │ │ │ - indicates that this socket is running on top of an SSL (TLS) channel
│ │ │ │ + ssl_socket
│ │ │ │ + indicates that this socket is running on top of an SSL (TLS) channel
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ rc4_encrypted
│ │ │ │ this connection is obfuscated with RC4
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ plaintext_encrypted
│ │ │ │ the handshake of this connection was obfuscated with a Diffie-Hellman
│ │ │ │ exchange
│ │ │ │ @@ -6963,84 +4012,43 @@
│ │ │ │ to disk before downloading more.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ read_state write_state
│ │ │ │ bitmasks indicating what state this peer is in with regards to sending
│ │ │ │ and receiving data. The states are defined as independent flags of type
│ │ │ │ bandwidth_state_flags_t, in this class.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ iinnffoo__hhaasshh__tt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_n_f_o___h_a_s_h_._h_p_p"
│ │ │ │ -class holding the info-hash of a torrent. It can hold a v1 info-hash (SHA-1) or
│ │ │ │ -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
│ │ │ │ -{
│ │ │ │ - iinnffoo__hhaasshh__tt (sha1_hash h1, sha256_hash h2) noexcept;
│ │ │ │ - explicit iinnffoo__hhaasshh__tt (sha1_hash h1) noexcept;
│ │ │ │ - explicit iinnffoo__hhaasshh__tt (sha256_hash h2) noexcept;
│ │ │ │ - iinnffoo__hhaasshh__tt () noexcept = default;
│ │ │ │ - bool hhaass__vv22 () const;
│ │ │ │ - bool hhaass__vv11 () const;
│ │ │ │ - bool hhaass (protocol_version v) const;
│ │ │ │ - sha1_hash ggeett (protocol_version v) const;
│ │ │ │ - sha1_hash ggeett__bbeesstt () const;
│ │ │ │ - friend bool ooppeerraattoorr!!== (info_hash_t const& lhs, info_hash_t const& rhs);
│ │ │ │ - friend bool ooppeerraattoorr==== (info_hash_t const& lhs, info_hash_t const& rhs)
│ │ │ │ -noexcept;
│ │ │ │ - bool ooppeerraattoorr<< (info_hash_t const& o) const;
│ │ │ │ - friend std::ostream& ooppeerraattoorr<<<< (std::ostream& os, info_hash_t const& ih);
│ │ │ │ -
│ │ │ │ - sha1_hash v1;
│ │ │ │ - sha256_hash v2;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iinnffoo__hhaasshh__tt(()) **********
│ │ │ │ -iinnffoo__hhaasshh__tt (sha1_hash h1, sha256_hash h2) noexcept;
│ │ │ │ -explicit iinnffoo__hhaasshh__tt (sha1_hash h1) noexcept;
│ │ │ │ -explicit iinnffoo__hhaasshh__tt (sha256_hash h2) noexcept;
│ │ │ │ -iinnffoo__hhaasshh__tt () noexcept = default;
│ │ │ │ -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 iimmpplliicciitt conversion from a v1 hash, but the
│ │ │ │ -implicitness is deprecated.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** hhaass__vv22(()) hhaass__vv11(()) hhaass(()) **********
│ │ │ │ -bool hhaass__vv22 () const;
│ │ │ │ -bool hhaass__vv11 () const;
│ │ │ │ -bool hhaass (protocol_version v) const;
│ │ │ │ -returns true if the corresponding info hash is present in this object.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett(()) **********
│ │ │ │ -sha1_hash ggeett (protocol_version v) const;
│ │ │ │ -returns the has for the specified protocol version
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett__bbeesstt(()) **********
│ │ │ │ -sha1_hash ggeett__bbeesstt () const;
│ │ │ │ -returns the v2 (truncated) info-hash, if there is one, otherwise returns the v1
│ │ │ │ -info-hash
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ vveerrssiioonn(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_v_e_r_s_i_o_n_._h_p_p"
│ │ │ │ -char const* vveerrssiioonn ();
│ │ │ │ -returns the libtorrent version as string form in this format:
│ │ │ │ -"..."
│ │ │ │ +************ llooaadd__ttoorrrreenntt__ppaarrsseedd(()) llooaadd__ttoorrrreenntt__ffiillee(()) llooaadd__ttoorrrreenntt__bbuuffffeerr(()) ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_l_o_a_d___t_o_r_r_e_n_t_._h_p_p"
│ │ │ │ +add_torrent_params llooaadd__ttoorrrreenntt__bbuuffffeerr (
│ │ │ │ + span buffer, load_torrent_limits const& cfg);
│ │ │ │ +add_torrent_params llooaadd__ttoorrrreenntt__bbuuffffeerr (
│ │ │ │ + span buffer);
│ │ │ │ +add_torrent_params llooaadd__ttoorrrreenntt__ffiillee (
│ │ │ │ + std::string const& filename, load_torrent_limits const& cfg);
│ │ │ │ +add_torrent_params llooaadd__ttoorrrreenntt__ffiillee (
│ │ │ │ + std::string const& filename);
│ │ │ │ +add_torrent_params llooaadd__ttoorrrreenntt__ppaarrsseedd (
│ │ │ │ + bdecode_node const& torrent_file);
│ │ │ │ +add_torrent_params llooaadd__ttoorrrreenntt__ppaarrsseedd (
│ │ │ │ + bdecode_node const& torrent_file, load_torrent_limits const& cfg);
│ │ │ │ +These functions load the content of a .torrent file into an _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s
│ │ │ │ +object. The immutable part of a torrent file (the info-dictionary) is stored in
│ │ │ │ +the ti field in the _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s object (as a _t_o_r_r_e_n_t___i_n_f_o object). The
│ │ │ │ +returned object is suitable to be:
│ │ │ │ + * added to a _s_e_s_s_i_o_n via _a_d_d___t_o_r_r_e_n_t_(_) or _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_)
│ │ │ │ + * saved as a .torrent_file via _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_)
│ │ │ │ + * turned into a magnet link via _m_a_k_e___m_a_g_n_e_t___u_r_i_(_)
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ ttrruunnccaattee__ffiilleess(()) ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_r_u_n_c_a_t_e_._h_p_p"
│ │ │ │ void ttrruunnccaattee__ffiilleess (file_storage const& fs, std::string const& save_path,
│ │ │ │ storage_error& ec);
│ │ │ │ Truncates files larger than specified in the _f_i_l_e___s_t_o_r_a_g_e, saved under the
│ │ │ │ specified save_path.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ttoorrrreenntt__ppeeeerr__eeqquuaall(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___p_e_e_r_._h_p_p"
│ │ │ │ -inline bool ttoorrrreenntt__ppeeeerr__eeqquuaall (torrent_peer const* lhs, torrent_peer const*
│ │ │ │ -rhs);
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ mmaakkee__mmaaggnneett__uurrii(()) ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_m_a_g_n_e_t___u_r_i_._h_p_p"
│ │ │ │ std::string mmaakkee__mmaaggnneett__uurrii (add_torrent_params const& atp);
│ │ │ │ std::string mmaakkee__mmaaggnneett__uurrii (torrent_info const& info);
│ │ │ │ std::string mmaakkee__mmaaggnneett__uurrii (torrent_handle const& handle);
│ │ │ │ Generates a magnet URI from the specified torrent.
│ │ │ │ Several fields from the _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s objects are recorded in the magnet
│ │ │ │ @@ -7060,68 +4068,59 @@
│ │ │ │ The overload that takes a _t_o_r_r_e_n_t___h_a_n_d_l_e 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 _m_a_g_n_e_t_ _l_i_n_k_s.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ ppaarrssee__mmaaggnneett__uurrii(()) ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_m_a_g_n_e_t___u_r_i_._h_p_p"
│ │ │ │ +add_torrent_params ppaarrssee__mmaaggnneett__uurrii (string_view uri, error_code& ec);
│ │ │ │ add_torrent_params ppaarrssee__mmaaggnneett__uurrii (string_view uri);
│ │ │ │ void ppaarrssee__mmaaggnneett__uurrii (string_view uri, add_torrent_params& p, error_code& ec);
│ │ │ │ -add_torrent_params ppaarrssee__mmaaggnneett__uurrii (string_view uri, error_code& ec);
│ │ │ │ This function parses out information from the magnet link and populates the
│ │ │ │ _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s 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.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ llooaadd__ttoorrrreenntt__bbuuffffeerr(()) llooaadd__ttoorrrreenntt__ppaarrsseedd(()) llooaadd__ttoorrrreenntt__ffiillee(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_l_o_a_d___t_o_r_r_e_n_t_._h_p_p"
│ │ │ │ -add_torrent_params llooaadd__ttoorrrreenntt__ppaarrsseedd (
│ │ │ │ - bdecode_node const& torrent_file);
│ │ │ │ -add_torrent_params llooaadd__ttoorrrreenntt__ffiillee (
│ │ │ │ - std::string const& filename, load_torrent_limits const& cfg);
│ │ │ │ -add_torrent_params llooaadd__ttoorrrreenntt__bbuuffffeerr (
│ │ │ │ - span buffer);
│ │ │ │ -add_torrent_params llooaadd__ttoorrrreenntt__bbuuffffeerr (
│ │ │ │ - span buffer, load_torrent_limits const& cfg);
│ │ │ │ -add_torrent_params llooaadd__ttoorrrreenntt__ppaarrsseedd (
│ │ │ │ - bdecode_node const& torrent_file, load_torrent_limits const& cfg);
│ │ │ │ -add_torrent_params llooaadd__ttoorrrreenntt__ffiillee (
│ │ │ │ - std::string const& filename);
│ │ │ │ -These functions load the content of a .torrent file into an _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s
│ │ │ │ -object. The immutable part of a torrent file (the info-dictionary) is stored in
│ │ │ │ -the ti field in the _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s object (as a _t_o_r_r_e_n_t___i_n_f_o object). The
│ │ │ │ -returned object is suitable to be:
│ │ │ │ - * added to a _s_e_s_s_i_o_n via _a_d_d___t_o_r_r_e_n_t_(_) or _a_s_y_n_c___a_d_d___t_o_r_r_e_n_t_(_)
│ │ │ │ - * saved as a .torrent_file via _w_r_i_t_e___t_o_r_r_e_n_t___f_i_l_e_(_)
│ │ │ │ - * turned into a magnet link via _m_a_k_e___m_a_g_n_e_t___u_r_i_(_)
│ │ │ │ +************ ttoorrrreenntt__ppeeeerr__eeqquuaall(()) ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_o_r_r_e_n_t___p_e_e_r_._h_p_p"
│ │ │ │ +inline bool ttoorrrreenntt__ppeeeerr__eeqquuaall (torrent_peer const* lhs, torrent_peer const*
│ │ │ │ +rhs);
│ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ +************ vveerrssiioonn(()) ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_v_e_r_s_i_o_n_._h_p_p"
│ │ │ │ +char const* vveerrssiioonn ();
│ │ │ │ +returns the libtorrent version as string form in this format:
│ │ │ │ +"..."
│ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ +************ eennuumm pprroottooccooll__vveerrssiioonn ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_n_f_o___h_a_s_h_._h_p_p"
│ │ │ │ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ +|_nn_aa_mm_ee_|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_V_1_ _ _|_0_ _ _ _ _|_T_h_e_ _o_r_i_g_i_n_a_l_ _B_i_t_T_o_r_r_e_n_t_ _v_e_r_s_i_o_n_,_ _u_s_i_n_g_ _S_H_A_-_1_ _h_a_s_h_e_s_ _ _ _ _ _ _ |
│ │ │ │ +|_V_2_ _ _|_1_ _ _ _ _|_V_e_r_s_i_o_n_ _2_ _o_f_ _t_h_e_ _B_i_t_T_o_r_r_e_n_t_ _p_r_o_t_o_c_o_l_,_ _u_s_i_n_g_ _S_H_A_-_2_5_6_ _h_a_s_h_e_s|
│ │ │ │ +|_N_U_M_ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ eennuumm eevveenntt__tt ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_t_r_a_c_k_e_r___m_a_n_a_g_e_r_._h_p_p"
│ │ │ │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ |_nn_aa_mm_ee_ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ |_n_o_n_e_ _ _ _ _ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_c_o_m_p_l_e_t_e_d_|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_s_t_a_r_t_e_d_ _ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_s_t_o_p_p_e_d_ _ _|_3_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_p_a_u_s_e_d_ _ _ _|_4_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm ssoocckkeett__ttyyppee__tt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_o_c_k_e_t___t_y_p_e_._h_p_p"
│ │ │ │ +************ eennuumm ccoonnnneeccttiioonn__ttyyppee ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n_._h_p_p"
│ │ │ │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ |_nn_aa_mm_ee_ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_t_c_p_ _ _ _ _ _ _ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_s_o_c_k_s_5_ _ _ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_h_t_t_p_ _ _ _ _ _ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_t_p_ _ _ _ _ _ _ _|_3_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_2_p_ _ _ _ _ _ _ _|_4_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_t_c_p___s_s_l_ _ _ _|_5_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_s_o_c_k_s_5___s_s_l_|_6_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_h_t_t_p___s_s_l_ _ _|_7_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_t_p___s_s_l_ _ _ _|_8_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_b_i_t_t_o_r_r_e_n_t_|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_u_r_l___s_e_e_d_ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_h_t_t_p___s_e_e_d_ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ eennuumm ppoorrttmmaapp__ttrraannssppoorrtt ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_o_r_t_m_a_p_._h_p_p"
│ │ │ │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ |_nn_aa_mm_ee_ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_n_a_t_p_m_p_|_0_ _ _ _ _|_n_a_t_p_m_p_ _c_a_n_ _b_e_ _N_A_T_-_P_M_P_ _o_r_ _P_C_P|
│ │ │ │ |_u_p_n_p_ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ @@ -7130,39 +4129,64 @@
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_o_r_t_m_a_p_._h_p_p"
│ │ │ │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ |_nn_aa_mm_ee_|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ |_n_o_n_e_|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_t_c_p_ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ |_u_d_p_ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm ccoonnnneeccttiioonn__ttyyppee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n_._h_p_p"
│ │ │ │ +************ eennuumm ssoocckkeett__ttyyppee__tt ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_o_c_k_e_t___t_y_p_e_._h_p_p"
│ │ │ │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ |_nn_aa_mm_ee_ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_b_i_t_t_o_r_r_e_n_t_|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_r_l___s_e_e_d_ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_h_t_t_p___s_e_e_d_ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm pprroottooccooll__vveerrssiioonn ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_n_f_o___h_a_s_h_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_V_1_ _ _|_0_ _ _ _ _|_T_h_e_ _o_r_i_g_i_n_a_l_ _B_i_t_T_o_r_r_e_n_t_ _v_e_r_s_i_o_n_,_ _u_s_i_n_g_ _S_H_A_-_1_ _h_a_s_h_e_s_ _ _ _ _ _ _ |
│ │ │ │ -|_V_2_ _ _|_1_ _ _ _ _|_V_e_r_s_i_o_n_ _2_ _o_f_ _t_h_e_ _B_i_t_T_o_r_r_e_n_t_ _p_r_o_t_o_c_o_l_,_ _u_s_i_n_g_ _S_H_A_-_2_5_6_ _h_a_s_h_e_s|
│ │ │ │ -|_N_U_M_ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_t_c_p_ _ _ _ _ _ _ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_s_o_c_k_s_5_ _ _ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_h_t_t_p_ _ _ _ _ _ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_u_t_p_ _ _ _ _ _ _ _|_3_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_i_2_p_ _ _ _ _ _ _ _|_4_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_t_c_p___s_s_l_ _ _ _|_5_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_s_o_c_k_s_5___s_s_l_|_6_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_h_t_t_p___s_s_l_ _ _|_7_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ +|_u_t_p___s_s_l_ _ _ _|_8_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ iinntt ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_v_e_r_s_i_o_n_._h_p_p"
│ │ │ │ version_major
│ │ │ │ the major, minor and tiny versions of libtorrent
│ │ │ │ version_minor
│ │ │ │ the major, minor and tiny versions of libtorrent
│ │ │ │ version_tiny
│ │ │ │ the major, minor and tiny versions of libtorrent
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ +************ ddoowwnnllooaadd__pprriioorriittyy__tt ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_o_w_n_l_o_a_d___p_r_i_o_r_i_t_y_._h_p_p"
│ │ │ │ + dont_download
│ │ │ │ + Don't download the file or piece. Partial pieces may still be downloaded
│ │ │ │ + when setting file priorities.
│ │ │ │ + default_priority
│ │ │ │ + The default priority for files and pieces.
│ │ │ │ + low_priority
│ │ │ │ + The lowest priority for files and pieces.
│ │ │ │ + top_priority
│ │ │ │ + The highest priority for files and pieces.
│ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ +************ ppeexx__ffllaaggss__tt ************
│ │ │ │ +Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_x___f_l_a_g_s_._h_p_p"
│ │ │ │ + pex_encryption
│ │ │ │ + the peer supports protocol encryption
│ │ │ │ + pex_seed
│ │ │ │ + the peer is a seed
│ │ │ │ + pex_utp
│ │ │ │ + the peer supports the uTP, transport protocol over UDP.
│ │ │ │ + pex_holepunch
│ │ │ │ + the peer supports the holepunch extension If this flag is received from a
│ │ │ │ + peer, it can be used as a rendezvous point in case direct connections to
│ │ │ │ + the peer fail
│ │ │ │ + pex_lt_v2
│ │ │ │ + protocol v2 this is not a standard flag, it is only used internally
│ │ │ │ +[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ cchhaarr ccoonnsstt** ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_v_e_r_s_i_o_n_._h_p_p"
│ │ │ │ version_str
│ │ │ │ the libtorrent version in string form
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ ssttdd::::uuiinntt6644__tt ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_v_e_r_s_i_o_n_._h_p_p"
│ │ │ │ @@ -7341,630 +4365,14 @@
│ │ │ │ This flag is set automatically when adding a torrent that has at least
│ │ │ │ one tracker whose hostname ends with .i2p. It's also set by
│ │ │ │ _p_a_r_s_e___m_a_g_n_e_t___u_r_i_(_) if the tracker list contains such URL.
│ │ │ │ all
│ │ │ │ all torrent flags combined. Can conveniently be used when creating masks
│ │ │ │ for flags
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppeexx__ffllaaggss__tt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_x___f_l_a_g_s_._h_p_p"
│ │ │ │ - pex_encryption
│ │ │ │ - the peer supports protocol encryption
│ │ │ │ - pex_seed
│ │ │ │ - the peer is a seed
│ │ │ │ - pex_utp
│ │ │ │ - the peer supports the uTP, transport protocol over UDP.
│ │ │ │ - pex_holepunch
│ │ │ │ - the peer supports the holepunch extension If this flag is received from a
│ │ │ │ - peer, it can be used as a rendezvous point in case direct connections to
│ │ │ │ - the peer fail
│ │ │ │ - pex_lt_v2
│ │ │ │ - protocol v2 this is not a standard flag, it is only used internally
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ddoowwnnllooaadd__pprriioorriittyy__tt ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_d_o_w_n_l_o_a_d___p_r_i_o_r_i_t_y_._h_p_p"
│ │ │ │ - dont_download
│ │ │ │ - Don't download the file or piece. Partial pieces may still be downloaded
│ │ │ │ - when setting file priorities.
│ │ │ │ - default_priority
│ │ │ │ - The default priority for files and pieces.
│ │ │ │ - low_priority
│ │ │ │ - The lowest priority for files and pieces.
│ │ │ │ - top_priority
│ │ │ │ - The highest priority for files and pieces.
│ │ │ │ -libtorrent has a _p_l_u_g_i_n interface for implementing extensions to the protocol.
│ │ │ │ -These can be general extensions for transferring metadata or peer exchange
│ │ │ │ -extensions, or it could be used to provide a way to customize the protocol to
│ │ │ │ -fit a particular (closed) network.
│ │ │ │ -In short, the _p_l_u_g_i_n interface makes it possible to:
│ │ │ │ - * register extension messages (sent in the extension handshake), see
│ │ │ │ - _e_x_t_e_n_s_i_o_n_s.
│ │ │ │ - * add data and parse data from the extension handshake.
│ │ │ │ - * send extension messages and standard bittorrent messages.
│ │ │ │ - * override or block the handling of standard bittorrent messages.
│ │ │ │ - * save and restore state via the _s_e_s_s_i_o_n state
│ │ │ │ - * see all alerts that are posted
│ │ │ │ -************ aa wwoorrdd ooff ccaauuttiioonn ************
│ │ │ │ -Writing your own _p_l_u_g_i_n is a very easy way to introduce serious bugs such as
│ │ │ │ -dead locks and race conditions. Since a _p_l_u_g_i_n has access to internal
│ │ │ │ -structures it is also quite easy to sabotage libtorrent's operation.
│ │ │ │ -All the callbacks are always called from the libtorrent network thread. In case
│ │ │ │ -portions of your _p_l_u_g_i_n are called from other threads, typically the main
│ │ │ │ -thread, you cannot use any of the member functions on the internal structures
│ │ │ │ -in libtorrent, since those require being called from the libtorrent network
│ │ │ │ -thread . Furthermore, you also need to synchronize your own shared data within
│ │ │ │ -the _p_l_u_g_i_n, to make sure it is not accessed at the same time from the
│ │ │ │ -libtorrent thread (through a callback). If you need to send out a message from
│ │ │ │ -another thread, it is advised to use an internal queue, and do the actual
│ │ │ │ -sending in tick().
│ │ │ │ -Since the _p_l_u_g_i_n interface gives you easy access to internal structures, it is
│ │ │ │ -not supported as a stable API. Plugins should be considered specific to a
│ │ │ │ -specific version of libtorrent. Although, in practice the internals mostly
│ │ │ │ -don't change that dramatically.
│ │ │ │ -************ pplluuggiinn--iinntteerrffaaccee ************
│ │ │ │ -The _p_l_u_g_i_n interface consists of three base classes that the _p_l_u_g_i_n may
│ │ │ │ -implement. These are called _p_l_u_g_i_n, _t_o_r_r_e_n_t___p_l_u_g_i_n and _p_e_e_r___p_l_u_g_i_n. They are
│ │ │ │ -found in the header.
│ │ │ │ -These plugins are instantiated for each _s_e_s_s_i_o_n, torrent and possibly each
│ │ │ │ -peer, respectively.
│ │ │ │ -For plugins that only need per torrent state, it is enough to only implement
│ │ │ │ -torrent_plugin and pass a constructor function or function object to session::
│ │ │ │ -add_extension() or torrent_handle::add_extension() (if the torrent has already
│ │ │ │ -been started and you want to hook in the extension at run-time).
│ │ │ │ -The signature of the function is:
│ │ │ │ -std::shared_ptr (*)(torrent_handle const&, client_data_t);
│ │ │ │ -The second argument is the userdata passed to session::add_torrent() or
│ │ │ │ -torrent_handle::add_extension().
│ │ │ │ -The function should return a std::shared_ptr which may or may
│ │ │ │ -not be 0. If it is a nullptr, the extension is simply ignored for this torrent.
│ │ │ │ -If it is a valid pointer (to a class inheriting torrent_plugin), it will be
│ │ │ │ -associated with this torrent and callbacks will be made on torrent events.
│ │ │ │ -For more elaborate plugins which require _s_e_s_s_i_o_n wide state, you would
│ │ │ │ -implement plugin, construct an object (in a std::shared_ptr) and pass it in to
│ │ │ │ -session::add_extension().
│ │ │ │ -************ ccuussttoomm aalleerrttss ************
│ │ │ │ -Since plugins are running within internal libtorrent threads, one convenient
│ │ │ │ -way to communicate with the client is to post custom alerts.
│ │ │ │ -The expected interface of any _a_l_e_r_t, apart from deriving from the _a_l_e_r_t base
│ │ │ │ -class, looks like this:
│ │ │ │ -static const int alert_type = <>;
│ │ │ │ -virtual int type() const { return alert_type; }
│ │ │ │ -
│ │ │ │ -virtual std::string message() const;
│ │ │ │ -
│ │ │ │ -static const alert_category_t static_category = <>;
│ │ │ │ -virtual alert_category_t category() const { return static_category; }
│ │ │ │ -
│ │ │ │ -virtual char const* what() const { return <
>; }
│ │ │ │ -The alert_type is used for the type-checking in alert_cast. It must not collide
│ │ │ │ -with any other _a_l_e_r_t. The built-in alerts in libtorrent will not use _a_l_e_r_t type
│ │ │ │ -IDs greater than user_alert_id. When defining your own _a_l_e_r_t, make sure it's
│ │ │ │ -greater than this constant.
│ │ │ │ -type() is the run-time equivalence of the alert_type.
│ │ │ │ -The message() virtual function is expected to construct a useful string
│ │ │ │ -representation of the _a_l_e_r_t and the event or data it represents. Something
│ │ │ │ -convenient to put in a log file for instance.
│ │ │ │ -clone() is used internally to copy alerts. The suggested implementation of
│ │ │ │ -simply allocating a new instance as a copy of *this is all that's expected.
│ │ │ │ -The static category is required for checking whether or not the category for a
│ │ │ │ -specific _a_l_e_r_t is enabled or not, without instantiating the _a_l_e_r_t. The category
│ │ │ │ -virtual function is the run-time equivalence.
│ │ │ │ -The what() virtual function may simply be a string literal of the class name of
│ │ │ │ -your _a_l_e_r_t.
│ │ │ │ -For more information, see the _a_l_e_r_t_ _s_e_c_t_i_o_n.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -the _p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e class provides a handle to the internal peer
│ │ │ │ -connection object, to be used by plugins. This is a low level interface that
│ │ │ │ -may not be stable across libtorrent versions
│ │ │ │ -struct peer_connection_handle
│ │ │ │ -{
│ │ │ │ - explicit ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (std::weak_ptr impl);
│ │ │ │ - connection_type ttyyppee () const;
│ │ │ │ - peer_plugin const* ffiinndd__pplluuggiinn (string_view type) const;
│ │ │ │ - void aadddd__eexxtteennssiioonn (std::shared_ptr);
│ │ │ │ - bool iiss__sseeeedd () const;
│ │ │ │ - bool uuppllooaadd__oonnllyy () const;
│ │ │ │ - peer_id const& ppiidd () const;
│ │ │ │ - bool hhaass__ppiieeccee (piece_index_t i) const;
│ │ │ │ - bool iiss__cchhookkeedd () const;
│ │ │ │ - bool iiss__iinntteerreessttiinngg () const;
│ │ │ │ - bool hhaass__ppeeeerr__cchhookkeedd () const;
│ │ │ │ - bool iiss__ppeeeerr__iinntteerreesstteedd () const;
│ │ │ │ - void mmaayybbee__uunncchhookkee__tthhiiss__ppeeeerr ();
│ │ │ │ - void cchhookkee__tthhiiss__ppeeeerr ();
│ │ │ │ - void ggeett__ppeeeerr__iinnffoo (peer_info& p) const;
│ │ │ │ - torrent_handle aassssoocciiaatteedd__ttoorrrreenntt () const;
│ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t const& rreemmoottee () const;
│ │ │ │ - _t_c_p_:_:_e_n_d_p_o_i_n_t llooccaall__eennddppooiinntt () const;
│ │ │ │ - bool iiss__oouuttggooiinngg () const;
│ │ │ │ - bool iiss__ddiissccoonnnneeccttiinngg () const;
│ │ │ │ - bool iiss__ccoonnnneeccttiinngg () const;
│ │ │ │ - void ddiissccoonnnneecctt (error_code const& ec, operation_t op
│ │ │ │ - , disconnect_severity_t = peer_connection_interface::normal);
│ │ │ │ - bool oonn__llooccaall__nneettwwoorrkk () const;
│ │ │ │ - bool iiggnnoorree__uunncchhookkee__sslloottss () const;
│ │ │ │ - bool ffaaiilleedd () const;
│ │ │ │ - void ppeeeerr__lloogg (peer_log_alert::direction_t direction
│ │ │ │ - , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT
│ │ │ │ -(4,5);
│ │ │ │ - bool sshhoouulldd__lloogg (peer_log_alert::direction_t direction) const;
│ │ │ │ - bool ccaann__ddiissccoonnnneecctt (error_code const& ec) const;
│ │ │ │ - bool hhaass__mmeettaaddaattaa () const;
│ │ │ │ - bool iinn__hhaannddsshhaakkee () const;
│ │ │ │ - void sseenndd__bbuuffffeerr (char const* begin, int size);
│ │ │ │ - std::time_t llaasstt__sseeeenn__ccoommpplleettee () const;
│ │ │ │ - time_point ttiimmee__ooff__llaasstt__uunncchhookkee () const;
│ │ │ │ - bool ooppeerraattoorr!!== (peer_connection_handle const& o) const;
│ │ │ │ - bool ooppeerraattoorr==== (peer_connection_handle const& o) const;
│ │ │ │ - bool ooppeerraattoorr<< (peer_connection_handle const& o) const;
│ │ │ │ - std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e_._h_p_p"
│ │ │ │ -The _b_t___p_e_e_r___c_o_n_n_e_c_t_i_o_n___h_a_n_d_l_e provides a handle to the internal bittorrent peer
│ │ │ │ -connection object to plugins. It's low level and may not be a stable API across
│ │ │ │ -libtorrent versions.
│ │ │ │ -struct bt_peer_connection_handle : peer_connection_handle
│ │ │ │ -{
│ │ │ │ - explicit bbtt__ppeeeerr__ccoonnnneeccttiioonn__hhaannddllee (peer_connection_handle pc);
│ │ │ │ - bool ssuuppppoorrtt__eexxtteennssiioonnss () const;
│ │ │ │ - bool ppaacckkeett__ffiinniisshheedd () const;
│ │ │ │ - bool ssuuppppoorrttss__eennccrryyppttiioonn () const;
│ │ │ │ - void sswwiittcchh__sseenndd__ccrryyppttoo (std::shared_ptr crypto);
│ │ │ │ - void sswwiittcchh__rreeccvv__ccrryyppttoo (std::shared_ptr crypto);
│ │ │ │ - std::shared_ptr nnaattiivvee__hhaannddllee () const;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ pplluuggiinn ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_._h_p_p"
│ │ │ │ -this is the base class for a _s_e_s_s_i_o_n _p_l_u_g_i_n. One primary feature is that it is
│ │ │ │ -notified of all torrents that are added to the _s_e_s_s_i_o_n, and can add its own
│ │ │ │ -torrent_plugins.
│ │ │ │ -struct plugin
│ │ │ │ -{
│ │ │ │ - virtual feature_flags_t iimmpplleemmeenntteedd__ffeeaattuurreess ();
│ │ │ │ - virtual std::shared_ptr nneeww__ttoorrrreenntt (torrent_handle const&,
│ │ │ │ -client_data_t);
│ │ │ │ - virtual void aaddddeedd (session_handle const&);
│ │ │ │ - virtual void aabboorrtt ();
│ │ │ │ - virtual bool oonn__ddhhtt__rreeqquueesstt (string_view //** qquueerryy **//
│ │ │ │ - , udp::endpoint const& //** ssoouurrccee **//, bdecode_node const& //** mmeessssaaggee **//
│ │ │ │ - , entry& //** rreessppoonnssee **//);
│ │ │ │ - virtual void oonn__aalleerrtt (alert const*);
│ │ │ │ - virtual bool oonn__uunnkknnoowwnn__ttoorrrreenntt (info_hash_t const& //** iinnffoo__hhaasshh **//
│ │ │ │ - , peer_connection_handle const& //** ppcc **//, add_torrent_params& //** pp **//);
│ │ │ │ - virtual void oonn__ttiicckk ();
│ │ │ │ - virtual uint64_t ggeett__uunncchhookkee__pprriioorriittyy (peer_connection_handle const& //** ppeeeerr
│ │ │ │ -**//);
│ │ │ │ - virtual std::map ssaavvee__ssttaattee () const;
│ │ │ │ - virtual void llooaadd__ssttaattee (std::map const&);
│ │ │ │ -
│ │ │ │ - static constexpr feature_flags_t ooppttiimmiissttiicc__uunncchhookkee__ffeeaattuurree = 1_bit;
│ │ │ │ - static constexpr feature_flags_t ttiicckk__ffeeaattuurree = 2_bit;
│ │ │ │ - static constexpr feature_flags_t ddhhtt__rreeqquueesstt__ffeeaattuurree = 3_bit;
│ │ │ │ - static constexpr feature_flags_t aalleerrtt__ffeeaattuurree = 4_bit;
│ │ │ │ - static constexpr feature_flags_t uunnkknnoowwnn__ttoorrrreenntt__ffeeaattuurree = 5_bit;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** iimmpplleemmeenntteedd__ffeeaattuurreess(()) **********
│ │ │ │ -virtual feature_flags_t iimmpplleemmeenntteedd__ffeeaattuurreess ();
│ │ │ │ -This function is expected to return a bitmask indicating which features this
│ │ │ │ -_p_l_u_g_i_n implements. Some callbacks on this object may not be called unless the
│ │ │ │ -corresponding feature flag is returned here. Note that callbacks may still be
│ │ │ │ -called even if the corresponding feature is not specified in the return value
│ │ │ │ -here. See feature_flags_t for possible flags to return.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nneeww__ttoorrrreenntt(()) **********
│ │ │ │ -virtual std::shared_ptr nneeww__ttoorrrreenntt (torrent_handle const&,
│ │ │ │ -client_data_t);
│ │ │ │ -this is called by the _s_e_s_s_i_o_n every time a new torrent is added. The torrent*
│ │ │ │ -points to the internal torrent object created for the new torrent. The
│ │ │ │ -_c_l_i_e_n_t___d_a_t_a___t is the userdata pointer as passed in via _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s.
│ │ │ │ -If the _p_l_u_g_i_n returns a _t_o_r_r_e_n_t___p_l_u_g_i_n instance, it will be added to the new
│ │ │ │ -torrent. Otherwise, return an empty shared_ptr to a _t_o_r_r_e_n_t___p_l_u_g_i_n (the
│ │ │ │ -default).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aaddddeedd(()) **********
│ │ │ │ -virtual void aaddddeedd (session_handle const&);
│ │ │ │ -called when _p_l_u_g_i_n is added to a _s_e_s_s_i_o_n
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aabboorrtt(()) **********
│ │ │ │ -virtual void aabboorrtt ();
│ │ │ │ -called when the _s_e_s_s_i_o_n is aborted the _p_l_u_g_i_n should perform any cleanup
│ │ │ │ -necessary to allow the session's destruction (e.g. cancel outstanding async
│ │ │ │ -operations)
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ddhhtt__rreeqquueesstt(()) **********
│ │ │ │ -virtual bool oonn__ddhhtt__rreeqquueesstt (string_view //** qquueerryy **//
│ │ │ │ - , udp::endpoint const& //** ssoouurrccee **//, bdecode_node const& //** mmeessssaaggee **//
│ │ │ │ - , entry& //** rreessppoonnssee **//);
│ │ │ │ -called when a dht request is received. If your _p_l_u_g_i_n expects this to be
│ │ │ │ -called, make sure to include the flag dht_request_feature in the return value
│ │ │ │ -from _i_m_p_l_e_m_e_n_t_e_d___f_e_a_t_u_r_e_s_(_).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__aalleerrtt(()) **********
│ │ │ │ -virtual void oonn__aalleerrtt (alert const*);
│ │ │ │ -called when an _a_l_e_r_t is posted alerts that are filtered are not posted. If your
│ │ │ │ -_p_l_u_g_i_n expects this to be called, make sure to include the flag alert_feature
│ │ │ │ -in the return value from _i_m_p_l_e_m_e_n_t_e_d___f_e_a_t_u_r_e_s_(_).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__uunnkknnoowwnn__ttoorrrreenntt(()) **********
│ │ │ │ -virtual bool oonn__uunnkknnoowwnn__ttoorrrreenntt (info_hash_t const& //** iinnffoo__hhaasshh **//
│ │ │ │ - , peer_connection_handle const& //** ppcc **//, add_torrent_params& //** pp **//);
│ │ │ │ -return true if the _a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s should be added
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ttiicckk(()) **********
│ │ │ │ -virtual void oonn__ttiicckk ();
│ │ │ │ -called once per second. If your _p_l_u_g_i_n expects this to be called, make sure to
│ │ │ │ -include the flag tick_feature in the return value from _i_m_p_l_e_m_e_n_t_e_d___f_e_a_t_u_r_e_s_(_).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett__uunncchhookkee__pprriioorriittyy(()) **********
│ │ │ │ -virtual uint64_t ggeett__uunncchhookkee__pprriioorriittyy (peer_connection_handle const& //** ppeeeerr **//
│ │ │ │ -);
│ │ │ │ -called when choosing peers to optimistically unchoke. The return value
│ │ │ │ -indicates the peer's priority for unchoking. Lower return values correspond to
│ │ │ │ -higher priority. Priorities above 2^63-1 are reserved. If your _p_l_u_g_i_n has no
│ │ │ │ -priority to assign a peer it should return 2^64-1. If your _p_l_u_g_i_n expects this
│ │ │ │ -to be called, make sure to include the flag optimistic_unchoke_feature in the
│ │ │ │ -return value from _i_m_p_l_e_m_e_n_t_e_d___f_e_a_t_u_r_e_s_(_). If multiple plugins implement this
│ │ │ │ -function the lowest return value (i.e. the highest priority) is used.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** llooaadd__ssttaattee(()) **********
│ │ │ │ -virtual void llooaadd__ssttaattee (std::map const&);
│ │ │ │ -called on startup while loading settings state from the _s_e_s_s_i_o_n___p_a_r_a_m_s
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - optimistic_unchoke_feature
│ │ │ │ - include this bit if your _p_l_u_g_i_n needs to alter the order of the
│ │ │ │ - optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()
│ │ │ │ - callback be called.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - tick_feature
│ │ │ │ - include this bit if your _p_l_u_g_i_n needs to have _o_n___t_i_c_k_(_) called
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - dht_request_feature
│ │ │ │ - include this bit if your _p_l_u_g_i_n needs to have _o_n___d_h_t___r_e_q_u_e_s_t_(_) called
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - alert_feature
│ │ │ │ - include this bit if your _p_l_u_g_i_n needs to have _o_n___a_l_e_r_t_(_) called
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - unknown_torrent_feature
│ │ │ │ - include this bit if your _p_l_u_g_i_n needs to have _o_n___u_n_k_n_o_w_n___t_o_r_r_e_n_t_(_) called
│ │ │ │ - even if there is no active torrent in the _s_e_s_s_i_o_n
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ttoorrrreenntt__pplluuggiinn ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_._h_p_p"
│ │ │ │ -Torrent plugins are associated with a single torrent and have a number of
│ │ │ │ -functions called at certain events. Many of its functions have the ability to
│ │ │ │ -change or override the default libtorrent behavior.
│ │ │ │ -struct torrent_plugin
│ │ │ │ -{
│ │ │ │ - virtual std::shared_ptr nneeww__ccoonnnneeccttiioonn (peer_connection_handle
│ │ │ │ -const&);
│ │ │ │ - virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ - virtual void oonn__ppiieeccee__ppaassss (piece_index_t);
│ │ │ │ - virtual void ttiicckk ();
│ │ │ │ - virtual bool oonn__ppaauussee ();
│ │ │ │ - virtual bool oonn__rreessuummee ();
│ │ │ │ - virtual void oonn__ffiilleess__cchheecckkeedd ();
│ │ │ │ - virtual void oonn__ssttaattee (torrent_status::state_t);
│ │ │ │ - virtual void oonn__aadddd__ppeeeerr (tcp::endpoint const&,
│ │ │ │ - peer_source_flags_t, add_peer_flags_t);
│ │ │ │ -
│ │ │ │ - static constexpr add_peer_flags_t ffiirrsstt__ttiimmee = 1_bit;
│ │ │ │ - static constexpr add_peer_flags_t ffiilltteerreedd = 2_bit;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nneeww__ccoonnnneeccttiioonn(()) **********
│ │ │ │ -virtual std::shared_ptr nneeww__ccoonnnneeccttiioonn (peer_connection_handle
│ │ │ │ -const&);
│ │ │ │ -This function is called each time a new peer is connected to the torrent. You
│ │ │ │ -may choose to ignore this by just returning a default constructed shared_ptr
│ │ │ │ -(in which case you don't need to override this member function).
│ │ │ │ -If you need an extension to the peer connection (which most plugins do) you are
│ │ │ │ -supposed to return an instance of your _p_e_e_r___p_l_u_g_i_n class. Which in turn will
│ │ │ │ -have its hook functions called on event specific to that peer.
│ │ │ │ -The peer_connection_handle will be valid as long as the shared_ptr is being
│ │ │ │ -held by the torrent object. So, it is generally a good idea to not keep a
│ │ │ │ -shared_ptr to your own _p_e_e_r___p_l_u_g_i_n. If you want to keep references to it, use
│ │ │ │ -weak_ptr.
│ │ │ │ -If this function throws an exception, the connection will be closed.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ppiieeccee__ffaaiilleedd(()) oonn__ppiieeccee__ppaassss(()) **********
│ │ │ │ -virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ -virtual void oonn__ppiieeccee__ppaassss (piece_index_t);
│ │ │ │ -These hooks are called when a piece passes the hash check or fails the hash
│ │ │ │ -check, respectively. The index is the piece index that was downloaded. It is
│ │ │ │ -possible to access the list of peers that participated in sending the piece
│ │ │ │ -through the torrent and the piece_picker.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttiicckk(()) **********
│ │ │ │ -virtual void ttiicckk ();
│ │ │ │ -This hook is called approximately once per second. It is a way of making it
│ │ │ │ -easy for plugins to do timed events, for sending messages or whatever.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ppaauussee(()) oonn__rreessuummee(()) **********
│ │ │ │ -virtual bool oonn__ppaauussee ();
│ │ │ │ -virtual bool oonn__rreessuummee ();
│ │ │ │ -These hooks are called when the torrent is paused and resumed respectively. The
│ │ │ │ -return value indicates if the event was handled. A return value of true
│ │ │ │ -indicates that it was handled, and no other _p_l_u_g_i_n after this one will have
│ │ │ │ -this hook function called, and the standard handler will also not be invoked.
│ │ │ │ -So, returning true effectively overrides the standard behavior of pause or
│ │ │ │ -resume.
│ │ │ │ -Note that if you call pause() or resume() on the torrent from your handler it
│ │ │ │ -will recurse back into your handler, so in order to invoke the standard
│ │ │ │ -handler, you have to keep your own state on whether you want standard behavior
│ │ │ │ -or overridden behavior.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ffiilleess__cchheecckkeedd(()) **********
│ │ │ │ -virtual void oonn__ffiilleess__cchheecckkeedd ();
│ │ │ │ -This function is called when the initial files of the torrent have been
│ │ │ │ -checked. If there are no files to check, this function is called immediately.
│ │ │ │ -i.e. This function is always called when the torrent is in a state where it can
│ │ │ │ -start downloading.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ssttaattee(()) **********
│ │ │ │ -virtual void oonn__ssttaattee (torrent_status::state_t);
│ │ │ │ -called when the torrent changes state the state is one of _t_o_r_r_e_n_t___s_t_a_t_u_s_:_:
│ │ │ │ -_s_t_a_t_e___t enum members
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__aadddd__ppeeeerr(()) **********
│ │ │ │ -virtual void oonn__aadddd__ppeeeerr (tcp::endpoint const&,
│ │ │ │ - peer_source_flags_t, add_peer_flags_t);
│ │ │ │ -called every time a new peer is added to the peer list. This is before the peer
│ │ │ │ -is connected to. For flags, see torrent_plugin::flags_t. The source argument
│ │ │ │ -refers to the source where we learned about this peer from. It's a bitmask,
│ │ │ │ -because many sources may have told us about the same peer. For peer source
│ │ │ │ -flags, see peer_info::peer_source_flags.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - first_time
│ │ │ │ - this is the first time we see this peer
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - filtered
│ │ │ │ - this peer was not added because it was filtered by the IP filter
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppeeeerr__pplluuggiinn ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_._h_p_p"
│ │ │ │ -peer plugins are associated with a specific peer. A peer could be both a
│ │ │ │ -regular bittorrent peer (bt_peer_connection) or one of the web seed connections
│ │ │ │ -(web_peer_connection or http_seed_connection). In order to only attach to
│ │ │ │ -certain peers, make your torrent_plugin::new_connection only return a _p_l_u_g_i_n
│ │ │ │ -for certain peer connection types
│ │ │ │ -struct peer_plugin
│ │ │ │ -{
│ │ │ │ - virtual string_view ttyyppee () const;
│ │ │ │ - virtual void aadddd__hhaannddsshhaakkee (entry&);
│ │ │ │ - virtual void oonn__ddiissccoonnnneecctt (error_code const&);
│ │ │ │ - virtual void oonn__ccoonnnneecctteedd ();
│ │ │ │ - virtual bool oonn__hhaannddsshhaakkee (span);
│ │ │ │ - virtual bool oonn__eexxtteennssiioonn__hhaannddsshhaakkee (bdecode_node const&);
│ │ │ │ - virtual bool oonn__cchhookkee ();
│ │ │ │ - virtual bool oonn__uunncchhookkee ();
│ │ │ │ - virtual bool oonn__nnoott__iinntteerreesstteedd ();
│ │ │ │ - virtual bool oonn__hhaavvee__aallll ();
│ │ │ │ - virtual bool oonn__iinntteerreesstteedd ();
│ │ │ │ - virtual bool oonn__hhaavvee__nnoonnee ();
│ │ │ │ - virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t);
│ │ │ │ - virtual bool oonn__ddoonntt__hhaavvee (piece_index_t);
│ │ │ │ - virtual bool oonn__hhaavvee (piece_index_t);
│ │ │ │ - virtual bool oonn__rreeqquueesstt (peer_request const&);
│ │ │ │ - virtual bool oonn__bbiittffiieelldd (bitfield const& //**bbiittffiieelldd**//);
│ │ │ │ - virtual bool oonn__ppiieeccee (peer_request const& //**ppiieeccee**//
│ │ │ │ - , span //**bbuuff**//);
│ │ │ │ - virtual bool oonn__ccaanncceell (peer_request const&);
│ │ │ │ - virtual bool oonn__rreejjeecctt (peer_request const&);
│ │ │ │ - virtual bool oonn__ssuuggggeesstt (piece_index_t);
│ │ │ │ - virtual void sseenntt__cchhookkee ();
│ │ │ │ - virtual void sseenntt__hhaavvee__aallll ();
│ │ │ │ - virtual void sseenntt__rreeqquueesstt (peer_request const&);
│ │ │ │ - virtual void sseenntt__hhaavvee__nnoonnee ();
│ │ │ │ - virtual void sseenntt__ccaanncceell (peer_request const&);
│ │ │ │ - virtual void sseenntt__rreejjeecctt__rreeqquueesstt (peer_request const&);
│ │ │ │ - virtual void sseenntt__ssuuggggeesstt (piece_index_t);
│ │ │ │ - virtual void sseenntt__aallllooww__ffaasstt (piece_index_t);
│ │ │ │ - virtual void sseenntt__uunncchhookkee ();
│ │ │ │ - virtual void sseenntt__nnoott__iinntteerreesstteedd ();
│ │ │ │ - virtual void sseenntt__iinntteerreesstteedd ();
│ │ │ │ - virtual void sseenntt__hhaavvee (piece_index_t);
│ │ │ │ - virtual void sseenntt__ppiieeccee (peer_request const&);
│ │ │ │ - virtual void sseenntt__ppaayyllooaadd (int //** bbyytteess **//);
│ │ │ │ - virtual bool ccaann__ddiissccoonnnneecctt (error_code const& //**eecc**//);
│ │ │ │ - virtual bool oonn__eexxtteennddeedd (int //**lleennggtthh**//, int //**mmssgg**//,
│ │ │ │ - span //**bbooddyy**//);
│ │ │ │ - virtual bool oonn__uunnkknnoowwnn__mmeessssaaggee (int //**lleennggtthh**//, int //**mmssgg**//,
│ │ │ │ - span //**bbooddyy**//);
│ │ │ │ - virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ - virtual void oonn__ppiieeccee__ppaassss (piece_index_t);
│ │ │ │ - virtual void ttiicckk ();
│ │ │ │ - virtual bool wwrriittee__rreeqquueesstt (peer_request const&);
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttyyppee(()) **********
│ │ │ │ -virtual string_view ttyyppee () const;
│ │ │ │ -This function is expected to return the name of the _p_l_u_g_i_n.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__hhaannddsshhaakkee(()) **********
│ │ │ │ -virtual void aadddd__hhaannddsshhaakkee (entry&);
│ │ │ │ -can add entries to the extension handshake this is not called for web seeds
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ddiissccoonnnneecctt(()) **********
│ │ │ │ -virtual void oonn__ddiissccoonnnneecctt (error_code const&);
│ │ │ │ -called when the peer is being disconnected.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ccoonnnneecctteedd(()) **********
│ │ │ │ -virtual void oonn__ccoonnnneecctteedd ();
│ │ │ │ -called when the peer is successfully connected. Note that incoming connections
│ │ │ │ -will have been connected by the time the peer _p_l_u_g_i_n is attached to it, and
│ │ │ │ -won't have this hook called.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__hhaannddsshhaakkee(()) **********
│ │ │ │ -virtual bool oonn__hhaannddsshhaakkee (span);
│ │ │ │ -this is called when the initial bittorrent handshake is received. Returning
│ │ │ │ -false means that the other end doesn't support this extension and will remove
│ │ │ │ -it from the list of plugins. this is not called for web seeds
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__eexxtteennssiioonn__hhaannddsshhaakkee(()) **********
│ │ │ │ -virtual bool oonn__eexxtteennssiioonn__hhaannddsshhaakkee (bdecode_node const&);
│ │ │ │ -called when the extension handshake from the other end is received if this
│ │ │ │ -returns false, it means that this extension isn't supported by this peer. It
│ │ │ │ -will result in this _p_e_e_r___p_l_u_g_i_n being removed from the peer_connection and
│ │ │ │ -destructed. this is not called for web seeds
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__hhaavvee(()) oonn__aalllloowweedd__ffaasstt(()) oonn__iinntteerreesstteedd(()) oonn__uunncchhookkee(()) oonn__hhaavvee__nnoonnee(())
│ │ │ │ -oonn__nnoott__iinntteerreesstteedd(()) oonn__ddoonntt__hhaavvee(()) oonn__rreeqquueesstt(()) oonn__hhaavvee__aallll(()) oonn__bbiittffiieelldd(())
│ │ │ │ -oonn__cchhookkee(()) **********
│ │ │ │ -virtual bool oonn__cchhookkee ();
│ │ │ │ -virtual bool oonn__uunncchhookkee ();
│ │ │ │ -virtual bool oonn__nnoott__iinntteerreesstteedd ();
│ │ │ │ -virtual bool oonn__hhaavvee__aallll ();
│ │ │ │ -virtual bool oonn__iinntteerreesstteedd ();
│ │ │ │ -virtual bool oonn__hhaavvee__nnoonnee ();
│ │ │ │ -virtual bool oonn__aalllloowweedd__ffaasstt (piece_index_t);
│ │ │ │ -virtual bool oonn__ddoonntt__hhaavvee (piece_index_t);
│ │ │ │ -virtual bool oonn__hhaavvee (piece_index_t);
│ │ │ │ -virtual bool oonn__rreeqquueesstt (peer_request const&);
│ │ │ │ -virtual bool oonn__bbiittffiieelldd (bitfield const& //**bbiittffiieelldd**//);
│ │ │ │ -returning true from any of the message handlers indicates that the _p_l_u_g_i_n has
│ │ │ │ -handled the message. it will break the _p_l_u_g_i_n chain traversing and not let
│ │ │ │ -anyone else handle the message, including the default handler.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ppiieeccee(()) **********
│ │ │ │ -virtual bool oonn__ppiieeccee (peer_request const& //**ppiieeccee**//
│ │ │ │ - , span //**bbuuff**//);
│ │ │ │ -This function is called when the peer connection is receiving a piece. buf
│ │ │ │ -points (non-owning pointer) to the data in an internal immutable disk buffer.
│ │ │ │ -The length of the data is specified in the length member of the piece
│ │ │ │ -parameter. returns true to indicate that the piece is handled and the rest of
│ │ │ │ -the logic should be ignored.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseenntt__ppiieeccee(()) sseenntt__iinntteerreesstteedd(()) sseenntt__nnoott__iinntteerreesstteedd(()) sseenntt__uunncchhookkee(())
│ │ │ │ -sseenntt__hhaavvee(()) **********
│ │ │ │ -virtual void sseenntt__uunncchhookkee ();
│ │ │ │ -virtual void sseenntt__nnoott__iinntteerreesstteedd ();
│ │ │ │ -virtual void sseenntt__iinntteerreesstteedd ();
│ │ │ │ -virtual void sseenntt__hhaavvee (piece_index_t);
│ │ │ │ -virtual void sseenntt__ppiieeccee (peer_request const&);
│ │ │ │ -called after a choke message has been sent to the peer
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseenntt__ppaayyllooaadd(()) **********
│ │ │ │ -virtual void sseenntt__ppaayyllooaadd (int //** bbyytteess **//);
│ │ │ │ -called after piece data has been sent to the peer this can be used for stats
│ │ │ │ -book keeping
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ccaann__ddiissccoonnnneecctt(()) **********
│ │ │ │ -virtual bool ccaann__ddiissccoonnnneecctt (error_code const& //**eecc**//);
│ │ │ │ -called when libtorrent think this peer should be disconnected. if the _p_l_u_g_i_n
│ │ │ │ -returns false, the peer will not be disconnected.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__eexxtteennddeedd(()) **********
│ │ │ │ -virtual bool oonn__eexxtteennddeedd (int //**lleennggtthh**//, int //**mmssgg**//,
│ │ │ │ - span //**bbooddyy**//);
│ │ │ │ -called when an extended message is received. If returning true, the message is
│ │ │ │ -not processed by any other _p_l_u_g_i_n and if false is returned the next _p_l_u_g_i_n in
│ │ │ │ -the chain will receive it to be able to handle it. This is not called for web
│ │ │ │ -seeds. thus function may be called more than once per incoming message, but
│ │ │ │ -only the last of the calls will the body size equal the length. i.e. Every time
│ │ │ │ -another fragment of the message is received, this function will be called,
│ │ │ │ -until finally the whole message has been received. The purpose of this is to
│ │ │ │ -allow early disconnects for invalid messages and for reporting progress of
│ │ │ │ -receiving large messages.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__uunnkknnoowwnn__mmeessssaaggee(()) **********
│ │ │ │ -virtual bool oonn__uunnkknnoowwnn__mmeessssaaggee (int //**lleennggtthh**//, int //**mmssgg**//,
│ │ │ │ - span //**bbooddyy**//);
│ │ │ │ -this is not called for web seeds
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** oonn__ppiieeccee__ffaaiilleedd(()) oonn__ppiieeccee__ppaassss(()) **********
│ │ │ │ -virtual void oonn__ppiieeccee__ffaaiilleedd (piece_index_t);
│ │ │ │ -virtual void oonn__ppiieeccee__ppaassss (piece_index_t);
│ │ │ │ -called when a piece that this peer participated in either fails or passes the
│ │ │ │ -hash_check
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttiicckk(()) **********
│ │ │ │ -virtual void ttiicckk ();
│ │ │ │ -called approximately once every second
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** wwrriittee__rreeqquueesstt(()) **********
│ │ │ │ -virtual bool wwrriittee__rreeqquueesstt (peer_request const&);
│ │ │ │ -called each time a request message is to be sent. If true is returned, the
│ │ │ │ -original request message won't be sent and no other _p_l_u_g_i_n will have this
│ │ │ │ -function called.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ccrryyppttoo__pplluuggiinn ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_._h_p_p"
│ │ │ │ -struct crypto_plugin
│ │ │ │ -{
│ │ │ │ - virtual void sseett__oouuttggooiinngg__kkeeyy (span key) = 0;
│ │ │ │ - virtual void sseett__iinnccoommiinngg__kkeeyy (span key) = 0;
│ │ │ │ - eennccrryypptt (span> //**sseenndd__vveecc**//) = 0;
│ │ │ │ - virtual std::tuple ddeeccrryypptt (span> //**rreecceeiivvee__vveecc**//
│ │ │ │ -) = 0;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennccrryypptt(()) **********
│ │ │ │ -eennccrryypptt (span> //**sseenndd__vveecc**//) = 0;
│ │ │ │ -encrypted the provided buffers and returns the number of bytes which are now
│ │ │ │ -ready to be sent to the lower layer. This must be at least as large as the
│ │ │ │ -number of bytes passed in and may be larger if there is additional data to be
│ │ │ │ -inserted at the head of the send buffer. The additional data is returned as the
│ │ │ │ -second tuple value. Any returned buffer as well as the iovec itself, to be
│ │ │ │ -prepended to the send buffer, must be owned by the crypto _p_l_u_g_i_n and guaranteed
│ │ │ │ -to stay alive until the _c_r_y_p_t_o___p_l_u_g_i_n is destructed or this function is called
│ │ │ │ -again.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddeeccrryypptt(()) **********
│ │ │ │ -virtual std::tuple ddeeccrryypptt (span> //**rreecceeiivvee__vveecc**//) =
│ │ │ │ -0;
│ │ │ │ -decrypt the provided buffers. returns is a tuple representing the values
│ │ │ │ -(consume, produce, packet_size)
│ │ │ │ -consume is set to the number of bytes which should be trimmed from the head of
│ │ │ │ -the buffers, default is 0
│ │ │ │ -produce is set to the number of bytes of payload which are now ready to be sent
│ │ │ │ -to the upper layer. default is the number of bytes passed in receive_vec
│ │ │ │ -packet_size is set to the minimum number of bytes which must be read to advance
│ │ │ │ -the next step of decryption. default is 0
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ccrreeaattee__uutt__ppeexx__pplluuggiinn(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_/_u_t___p_e_x_._h_p_p"
│ │ │ │ -std::shared_ptr ccrreeaattee__uutt__ppeexx__pplluuggiinn (torrent_handle const&,
│ │ │ │ -client_data_t);
│ │ │ │ -constructor function for the ut_pex extension. The ut_pex extension allows
│ │ │ │ -peers to gossip about their connections, allowing the swarm stay well connected
│ │ │ │ -and peers aware of more peers in the swarm. This extension is enabled by
│ │ │ │ -default unless explicitly disabled in the _s_e_s_s_i_o_n constructor.
│ │ │ │ -This can either be passed in the add_torrent_params::extensions field, or via
│ │ │ │ -_t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_a_d_d___e_x_t_e_n_s_i_o_n_(_).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ccrreeaattee__uutt__mmeettaaddaattaa__pplluuggiinn(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_/_u_t___m_e_t_a_d_a_t_a_._h_p_p"
│ │ │ │ -std::shared_ptr ccrreeaattee__uutt__mmeettaaddaattaa__pplluuggiinn (torrent_handle
│ │ │ │ -const&, client_data_t);
│ │ │ │ -constructor function for the ut_metadata extension. The ut_metadata extension
│ │ │ │ -allows peers to request the .torrent file (or more specifically the info-
│ │ │ │ -dictionary of the .torrent file) from each other. This is the main building
│ │ │ │ -block in making magnet links work. This extension is enabled by default unless
│ │ │ │ -explicitly disabled in the _s_e_s_s_i_o_n constructor.
│ │ │ │ -This can either be passed in the add_torrent_params::extensions field, or via
│ │ │ │ -_t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_a_d_d___e_x_t_e_n_s_i_o_n_(_).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ccrreeaattee__ssmmaarrtt__bbaann__pplluuggiinn(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_x_t_e_n_s_i_o_n_s_/_s_m_a_r_t___b_a_n_._h_p_p"
│ │ │ │ -std::shared_ptr ccrreeaattee__ssmmaarrtt__bbaann__pplluuggiinn (torrent_handle const&,
│ │ │ │ -client_data_t);
│ │ │ │ -constructor function for the smart ban extension. The extension keeps track of
│ │ │ │ -the data peers have sent us for failing pieces and once the piece completes and
│ │ │ │ -passes the hash check bans the peers that turned out to have sent corrupt data.
│ │ │ │ -This function can either be passed in the add_torrent_params::extensions field,
│ │ │ │ -or via _t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_a_d_d___e_x_t_e_n_s_i_o_n_(_).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ************ ppeeeerr__ccllaassss__ttyyppee__ffiilltteerr ************
│ │ │ │ Declared in "_l_i_b_t_o_r_r_e_n_t_/_p_e_e_r___c_l_a_s_s___t_y_p_e___f_i_l_t_e_r_._h_p_p"
│ │ │ │ peer_class_type_filter is a simple container for rules for adding and
│ │ │ │ subtracting peer-classes from peers. It is applied aafftteerr the peer class filter
│ │ │ │ is applied (which is based on the peer's IP address).
│ │ │ │ struct peer_class_type_filter
│ │ │ │ {
│ │ │ │ @@ -7989,15 +4397,15 @@
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ ********** rreemmoovvee(()) aadddd(()) **********
│ │ │ │ void rreemmoovvee (socket_type_t const st, peer_class_t const peer_class);
│ │ │ │ void aadddd (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.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aallllooww(()) ddiissaallllooww(()) **********
│ │ │ │ +********** ddiissaallllooww(()) aallllooww(()) **********
│ │ │ │ void ddiissaallllooww (socket_type_t const st, peer_class_t const peer_class);
│ │ │ │ void aallllooww (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.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ @@ -8059,2131 +4467,14 @@
│ │ │ │ bytes per second and apply to the sum of all peers that are members of
│ │ │ │ this class.
│ │ │ │ [_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ upload_priority download_priority
│ │ │ │ relative priorities used by the bandwidth allocator in the rate limiter.
│ │ │ │ If no rate limits are in use, the priority is not used either. Priorities
│ │ │ │ start at 1 (0 is not a valid priority) and may not exceed 255.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ iipp__ffiilltteerr ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_p___f_i_l_t_e_r_._h_p_p"
│ │ │ │ -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 _i_p___f_i_l_t_e_r does not filter any address.
│ │ │ │ -struct ip_filter
│ │ │ │ -{
│ │ │ │ - ip_filter& ooppeerraattoorr== (ip_filter const&);
│ │ │ │ - ~~iipp__ffiilltteerr ();
│ │ │ │ - iipp__ffiilltteerr (ip_filter&&);
│ │ │ │ - ip_filter& ooppeerraattoorr== (ip_filter&&);
│ │ │ │ - iipp__ffiilltteerr ();
│ │ │ │ - iipp__ffiilltteerr (ip_filter const&);
│ │ │ │ - bool eemmppttyy () const;
│ │ │ │ - void aadddd__rruullee (address const& first, address const& last, std::uint32_t
│ │ │ │ -flags);
│ │ │ │ - std::uint32_t aacccceessss (address const& addr) const;
│ │ │ │ - filter_tuple_t eexxppoorrtt__ffiilltteerr () const;
│ │ │ │ -
│ │ │ │ - enum access_flags
│ │ │ │ - {
│ │ │ │ - blocked,
│ │ │ │ - };
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eemmppttyy(()) **********
│ │ │ │ -bool eemmppttyy () const;
│ │ │ │ -returns true if the filter does not contain any rules
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__rruullee(()) **********
│ │ │ │ -void aadddd__rruullee (address const& first, address const& last, std::uint32_t flags);
│ │ │ │ -Adds a rule to the filter. first and last defines a range of ip addresses that
│ │ │ │ -will be marked with the given flags. The flags can currently be 0, which means
│ │ │ │ -allowed, or ip_filter::blocked, which means disallowed.
│ │ │ │ -precondition: first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()
│ │ │ │ -postcondition: access(x) == flags for every x in the range [first, last]
│ │ │ │ -This means that in a case of overlapping ranges, the last one applied takes
│ │ │ │ -precedence.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aacccceessss(()) **********
│ │ │ │ -std::uint32_t aacccceessss (address const& addr) const;
│ │ │ │ -Returns the access permissions for the given address (addr). The permission can
│ │ │ │ -currently be 0 or ip_filter::blocked. The complexity of this operation is O(log
│ │ │ │ -n), where n is the minimum number of non-overlapping ranges to describe the
│ │ │ │ -current filter.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eexxppoorrtt__ffiilltteerr(()) **********
│ │ │ │ -filter_tuple_t eexxppoorrtt__ffiilltteerr () const;
│ │ │ │ -This function will return the current state of the filter in the minimum number
│ │ │ │ -of ranges possible. They are sorted from ranges in low addresses to high
│ │ │ │ -addresses. Each _e_n_t_r_y in the returned vector is a range with the access control
│ │ │ │ -specified in its flags field.
│ │ │ │ -The return value is a tuple containing two range-lists. One for IPv4 addresses
│ │ │ │ -and one for IPv6 addresses.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennuumm aacccceessss__ffllaaggss **********
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_p___f_i_l_t_e_r_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|blocked|1 |indicates that IPs in this range should not be connected to nor|
│ │ │ │ -|_ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_c_c_e_p_t_e_d_ _a_s_ _i_n_c_o_m_i_n_g_ _c_o_n_n_e_c_t_i_o_n_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppoorrtt__ffiilltteerr ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_p___f_i_l_t_e_r_._h_p_p"
│ │ │ │ -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
│ │ │ │ -{
│ │ │ │ - ppoorrtt__ffiilltteerr ();
│ │ │ │ - ppoorrtt__ffiilltteerr (port_filter&&);
│ │ │ │ - port_filter& ooppeerraattoorr== (port_filter const&);
│ │ │ │ - ~~ppoorrtt__ffiilltteerr ();
│ │ │ │ - port_filter& ooppeerraattoorr== (port_filter&&);
│ │ │ │ - ppoorrtt__ffiilltteerr (port_filter const&);
│ │ │ │ - void aadddd__rruullee (std::uint16_t first, std::uint16_t last, std::uint32_t
│ │ │ │ -flags);
│ │ │ │ - std::uint32_t aacccceessss (std::uint16_t port) const;
│ │ │ │ -
│ │ │ │ - enum access_flags
│ │ │ │ - {
│ │ │ │ - blocked,
│ │ │ │ - };
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aadddd__rruullee(()) **********
│ │ │ │ -void aadddd__rruullee (std::uint16_t first, std::uint16_t last, std::uint32_t flags);
│ │ │ │ -set the flags for the specified port range (first, last) to flags overwriting
│ │ │ │ -any existing rule for those ports. The range is inclusive, i.e. the port last
│ │ │ │ -also has the flag set on it.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aacccceessss(()) **********
│ │ │ │ -std::uint32_t aacccceessss (std::uint16_t port) const;
│ │ │ │ -test the specified port (port) for whether it is blocked or not. The returned
│ │ │ │ -value is the flags set for this port. see _a_c_c_e_s_s___f_l_a_g_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennuumm aacccceessss__ffllaaggss **********
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_p___f_i_l_t_e_r_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|blocked|1 |this flag indicates that destination ports in the range should|
│ │ │ │ -|_ _ _ _ _ _ _ _|_ _ _ _ _ _|_n_o_t_ _b_e_ _c_o_n_n_e_c_t_e_d_ _t_o_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ hhaasshheerr ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_h_a_s_h_e_r_._h_p_p"
│ │ │ │ -this is a SHA-1 hash class.
│ │ │ │ -You use it by first instantiating it, then call update() to feed it with data.
│ │ │ │ -i.e. you don't have to keep the entire buffer of which you want to create the
│ │ │ │ -hash in memory. You can feed the _h_a_s_h_e_r parts of it at a time. When You have
│ │ │ │ -fed the _h_a_s_h_e_r with all the data, you call final() and it will return the sha1-
│ │ │ │ -hash of the data.
│ │ │ │ -The constructor that takes a char const* and an integer will construct the sha1
│ │ │ │ -context and feed it the data passed in.
│ │ │ │ -If you want to reuse the _h_a_s_h_e_r 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
│ │ │ │ -{
│ │ │ │ - hhaasshheerr ();
│ │ │ │ - hhaasshheerr (char const* data, int len);
│ │ │ │ - explicit hhaasshheerr (span data);
│ │ │ │ - hhaasshheerr (hasher const&);
│ │ │ │ - hasher& ooppeerraattoorr== (hasher const&) &;
│ │ │ │ - hasher& uuppddaattee (char const* data, int len);
│ │ │ │ - hasher& uuppddaattee (span data);
│ │ │ │ - sha1_hash ffiinnaall ();
│ │ │ │ - void rreesseett ();
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** hhaasshheerr(()) ooppeerraattoorr==(()) **********
│ │ │ │ -hhaasshheerr (char const* data, int len);
│ │ │ │ -explicit hhaasshheerr (span data);
│ │ │ │ -hhaasshheerr (hasher const&);
│ │ │ │ -hasher& ooppeerraattoorr== (hasher const&) &;
│ │ │ │ -this is the same as default constructing followed by a call to update(data,
│ │ │ │ -len).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** uuppddaattee(()) **********
│ │ │ │ -hasher& uuppddaattee (char const* data, int len);
│ │ │ │ -hasher& uuppddaattee (span data);
│ │ │ │ -append the following bytes to what is being hashed
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiinnaall(()) **********
│ │ │ │ -sha1_hash ffiinnaall ();
│ │ │ │ -returns the SHA-1 digest of the buffers previously passed to _u_p_d_a_t_e_(_) and the
│ │ │ │ -_h_a_s_h_e_r constructor.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreesseett(()) **********
│ │ │ │ -void rreesseett ();
│ │ │ │ -restore the _h_a_s_h_e_r state to be as if the _h_a_s_h_e_r has just been default
│ │ │ │ -constructed.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ hhaasshheerr225566 ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_h_a_s_h_e_r_._h_p_p"
│ │ │ │ -class hasher256
│ │ │ │ -{
│ │ │ │ - hhaasshheerr225566 ();
│ │ │ │ - explicit hhaasshheerr225566 (span data);
│ │ │ │ - hhaasshheerr225566 (char const* data, int len);
│ │ │ │ - hhaasshheerr225566 (hasher256 const&);
│ │ │ │ - hasher256& ooppeerraattoorr== (hasher256 const&) &;
│ │ │ │ - hasher256& uuppddaattee (span data);
│ │ │ │ - hasher256& uuppddaattee (char const* data, int len);
│ │ │ │ - sha256_hash ffiinnaall ();
│ │ │ │ - void rreesseett ();
│ │ │ │ - ~~hhaasshheerr225566 ();
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** hhaasshheerr225566(()) ooppeerraattoorr==(()) **********
│ │ │ │ -explicit hhaasshheerr225566 (span data);
│ │ │ │ -hhaasshheerr225566 (char const* data, int len);
│ │ │ │ -hhaasshheerr225566 (hasher256 const&);
│ │ │ │ -hasher256& ooppeerraattoorr== (hasher256 const&) &;
│ │ │ │ -this is the same as default constructing followed by a call to update(data,
│ │ │ │ -len).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** uuppddaattee(()) **********
│ │ │ │ -hasher256& uuppddaattee (span data);
│ │ │ │ -hasher256& uuppddaattee (char const* data, int len);
│ │ │ │ -append the following bytes to what is being hashed
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiinnaall(()) **********
│ │ │ │ -sha256_hash ffiinnaall ();
│ │ │ │ -returns the SHA-1 digest of the buffers previously passed to _u_p_d_a_t_e_(_) and the
│ │ │ │ -_h_a_s_h_e_r constructor.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** rreesseett(()) **********
│ │ │ │ -void rreesseett ();
│ │ │ │ -restore the _h_a_s_h_e_r state to be as if the _h_a_s_h_e_r has just been default
│ │ │ │ -constructed.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ bbiittffiieelldd ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_b_i_t_f_i_e_l_d_._h_p_p"
│ │ │ │ -The _b_i_t_f_i_e_l_d type stores any number of bits as a _b_i_t_f_i_e_l_d in a heap allocated
│ │ │ │ -array.
│ │ │ │ -struct bitfield
│ │ │ │ -{
│ │ │ │ - bbiittffiieelldd (bitfield const& rhs);
│ │ │ │ - explicit bbiittffiieelldd (int bits);
│ │ │ │ - bbiittffiieelldd (bitfield&& rhs) noexcept = default;
│ │ │ │ - bbiittffiieelldd () noexcept = default;
│ │ │ │ - bbiittffiieelldd (int bits, bool val);
│ │ │ │ - bbiittffiieelldd (char const* b, int bits);
│ │ │ │ - void aassssiiggnn (char const* b, int const bits);
│ │ │ │ - bool ooppeerraattoorr[[]] (int index) const noexcept;
│ │ │ │ - bool ggeett__bbiitt (int index) const noexcept;
│ │ │ │ - void cclleeaarr__bbiitt (int index) noexcept;
│ │ │ │ - void sseett__bbiitt (int index) noexcept;
│ │ │ │ - bool aallll__sseett () const noexcept;
│ │ │ │ - bool nnoonnee__sseett () const noexcept;
│ │ │ │ - int ssiizzee () const noexcept;
│ │ │ │ - int nnuumm__wwoorrddss () const noexcept;
│ │ │ │ - int nnuumm__bbyytteess () const noexcept;
│ │ │ │ - bool eemmppttyy () const noexcept;
│ │ │ │ - char* ddaattaa () noexcept;
│ │ │ │ - char const* ddaattaa () const noexcept;
│ │ │ │ - void sswwaapp (bitfield& rhs) noexcept;
│ │ │ │ - int ccoouunntt () const noexcept;
│ │ │ │ - int ffiinndd__ffiirrsstt__sseett () const noexcept;
│ │ │ │ - int ffiinndd__llaasstt__cclleeaarr () const noexcept;
│ │ │ │ - bool ooppeerraattoorr==== (lt::bitfield const& rhs) const;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** bbiittffiieelldd(()) **********
│ │ │ │ -bbiittffiieelldd (bitfield const& rhs);
│ │ │ │ -explicit bbiittffiieelldd (int bits);
│ │ │ │ -bbiittffiieelldd (bitfield&& rhs) noexcept = default;
│ │ │ │ -bbiittffiieelldd () noexcept = default;
│ │ │ │ -bbiittffiieelldd (int bits, bool val);
│ │ │ │ -bbiittffiieelldd (char const* b, int bits);
│ │ │ │ -constructs a new _b_i_t_f_i_e_l_d. The default constructor creates an empty _b_i_t_f_i_e_l_d.
│ │ │ │ -bits is the size of the _b_i_t_f_i_e_l_d (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 _b_i_t_f_i_e_l_d from the
│ │ │ │ -specified buffer, and bits number of bits (rounded up to the nearest byte
│ │ │ │ -boundary).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aassssiiggnn(()) **********
│ │ │ │ -void aassssiiggnn (char const* b, int const bits);
│ │ │ │ -copy _b_i_t_f_i_e_l_d from buffer b of bits number of bits, rounded up to the nearest
│ │ │ │ -byte boundary.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ggeett__bbiitt(()) ooppeerraattoorr[[]](()) **********
│ │ │ │ -bool ooppeerraattoorr[[]] (int index) const noexcept;
│ │ │ │ -bool ggeett__bbiitt (int index) const noexcept;
│ │ │ │ -query bit at index. Returns true if bit is 1, otherwise false.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sseett__bbiitt(()) cclleeaarr__bbiitt(()) **********
│ │ │ │ -void cclleeaarr__bbiitt (int index) noexcept;
│ │ │ │ -void sseett__bbiitt (int index) noexcept;
│ │ │ │ -set bit at index to 0 (clear_bit) or 1 (set_bit).
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** aallll__sseett(()) **********
│ │ │ │ -bool aallll__sseett () const noexcept;
│ │ │ │ -returns true if all bits in the _b_i_t_f_i_e_l_d are set
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnoonnee__sseett(()) **********
│ │ │ │ -bool nnoonnee__sseett () const noexcept;
│ │ │ │ -returns true if no bit in the _b_i_t_f_i_e_l_d is set
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ssiizzee(()) **********
│ │ │ │ -int ssiizzee () const noexcept;
│ │ │ │ -returns the size of the _b_i_t_f_i_e_l_d in bits.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnuumm__wwoorrddss(()) **********
│ │ │ │ -int nnuumm__wwoorrddss () const noexcept;
│ │ │ │ -returns the number of 32 bit words are needed to represent all bits in this
│ │ │ │ -_b_i_t_f_i_e_l_d.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** nnuumm__bbyytteess(()) **********
│ │ │ │ -int nnuumm__bbyytteess () const noexcept;
│ │ │ │ -returns the number of bytes needed to represent all bits in this _b_i_t_f_i_e_l_d
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eemmppttyy(()) **********
│ │ │ │ -bool eemmppttyy () const noexcept;
│ │ │ │ -returns true if the _b_i_t_f_i_e_l_d has zero size.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ddaattaa(()) **********
│ │ │ │ -char* ddaattaa () noexcept;
│ │ │ │ -char const* ddaattaa () const noexcept;
│ │ │ │ -returns a pointer to the internal buffer of the _b_i_t_f_i_e_l_d, or nullptr if it's
│ │ │ │ -empty.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sswwaapp(()) **********
│ │ │ │ -void sswwaapp (bitfield& rhs) noexcept;
│ │ │ │ -swaps the bit-fields two variables refer to
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ccoouunntt(()) **********
│ │ │ │ -int ccoouunntt () const noexcept;
│ │ │ │ -count the number of bits in the _b_i_t_f_i_e_l_d that are set to 1.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiinndd__ffiirrsstt__sseett(()) **********
│ │ │ │ -int ffiinndd__ffiirrsstt__sseett () const noexcept;
│ │ │ │ -returns the index of the first set bit in the _b_i_t_f_i_e_l_d, i.e. 1 bit.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiinndd__llaasstt__cclleeaarr(()) **********
│ │ │ │ -int ffiinndd__llaasstt__cclleeaarr () const noexcept;
│ │ │ │ -returns the index to the last cleared bit in the _b_i_t_f_i_e_l_d, i.e. 0 bit.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ssttoorraaggee__eerrrroorr ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_r_r_o_r___c_o_d_e_._h_p_p"
│ │ │ │ -used by storage to return errors also includes which underlying file the error
│ │ │ │ -happened on
│ │ │ │ -struct storage_error
│ │ │ │ -{
│ │ │ │ - explicit operator bbooooll () const;
│ │ │ │ - file_index_t ffiillee () const;
│ │ │ │ - void ffiillee (file_index_t f);
│ │ │ │ -
│ │ │ │ - error_code ec;
│ │ │ │ - operation_t operation;
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** bbooooll(()) **********
│ │ │ │ -explicit operator bbooooll () const;
│ │ │ │ -explicitly converts to true if this object represents an error, and false if it
│ │ │ │ -does not.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiillee(()) **********
│ │ │ │ -file_index_t ffiillee () const;
│ │ │ │ -void ffiillee (file_index_t f);
│ │ │ │ -set and query the index (in the torrent) of the file this error occurred on.
│ │ │ │ -This may also have special values defined in _t_o_r_r_e_n_t___s_t_a_t_u_s.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - ec
│ │ │ │ - the error that occurred
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ - operation
│ │ │ │ - A code from _o_p_e_r_a_t_i_o_n___t enum, indicating what kind of operation failed.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ uuppnnpp__ccaatteeggoorryy(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_u_p_n_p_._h_p_p"
│ │ │ │ -boost::system::error_category& uuppnnpp__ccaatteeggoorryy ();
│ │ │ │ -the boost.system error category for UPnP errors
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ssoocckkss__ccaatteeggoorryy(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_o_c_k_s_5___s_t_r_e_a_m_._h_p_p"
│ │ │ │ -boost::system::error_category& ssoocckkss__ccaatteeggoorryy ();
│ │ │ │ -returns the error_category for SOCKS5 errors
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ppccpp__ccaatteeggoorryy(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_n_a_t_p_m_p_._h_p_p"
│ │ │ │ -boost::system::error_category& ppccpp__ccaatteeggoorryy ();
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ii22pp__ccaatteeggoorryy(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_2_p___s_t_r_e_a_m_._h_p_p"
│ │ │ │ -boost::system::error_category& ii22pp__ccaatteeggoorryy ();
│ │ │ │ -returns the error category for I2P errors
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ggzziipp__ccaatteeggoorryy(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_g_z_i_p_._h_p_p"
│ │ │ │ -boost::system::error_category& ggzziipp__ccaatteeggoorryy ();
│ │ │ │ -get the error_category for zip errors
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ lliibbttoorrrreenntt__ccaatteeggoorryy(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_r_r_o_r___c_o_d_e_._h_p_p"
│ │ │ │ -boost::system::error_category& lliibbttoorrrreenntt__ccaatteeggoorryy ();
│ │ │ │ -return the instance of the libtorrent_error_category which maps libtorrent
│ │ │ │ -error codes to human readable error messages.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ hhttttpp__ccaatteeggoorryy(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_r_r_o_r___c_o_d_e_._h_p_p"
│ │ │ │ -boost::system::error_category& hhttttpp__ccaatteeggoorryy ();
│ │ │ │ -returns the error_category for HTTP errors
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ bbddeeccooddee__ccaatteeggoorryy(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_b_d_e_c_o_d_e_._h_p_p"
│ │ │ │ -boost::system::error_category& bbddeeccooddee__ccaatteeggoorryy ();
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm eerrrroorr__ccooddee__eennuumm ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_u_p_n_p_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_0_ _ _ _ _|_N_o_ _e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_argument |402 |One of the arguments in the request |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_s_ _i_n_v_a_l_i_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_a_c_t_i_o_n___f_a_i_l_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_5_0_1_ _ _|_T_h_e_ _r_e_q_u_e_s_t_ _f_a_i_l_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|value_not_in_array |714 |The specified value does not exist |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_ _t_h_e_ _a_r_r_a_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The source IP address cannot be |
│ │ │ │ -|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_p_e_c_i_f_i_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|external_port_cannot_be_wildcarded|716 |The external port cannot be a |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_w_i_l_d_c_a_r_d_,_ _b_u_t_ _m_u_s_t_ _b_e_ _s_p_e_c_i_f_i_e_d_ _ _ _ _ |
│ │ │ │ -| | |The port mapping _e_n_t_r_y specified |
│ │ │ │ -|port_mapping_conflict |718 |conflicts with a mapping assigned |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_r_e_v_i_o_u_s_l_y_ _t_o_ _a_n_o_t_h_e_r_ _c_l_i_e_n_t_ _ _ _ _ _ _ _ |
│ │ │ │ -|internal_port_must_match_external |724 |Internal and external port value |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_u_s_t_ _b_e_ _t_h_e_ _s_a_m_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The NAT implementation only supports|
│ │ │ │ -|only_permanent_leases_supported |725 |permanent lease times on port |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_a_p_p_i_n_g_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |RemoteHost must be a wildcard and |
│ │ │ │ -|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_D_N_S_ _n_a_m_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_a_n_n_o_t_ _b_e_ _a_ _s_p_e_c_i_f_i_c_ _p_o_r_t_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm ssoocckkss__eerrrroorr__ccooddee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_s_o_c_k_s_5___s_t_r_e_a_m_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_n_o___e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_n_s_u_p_p_o_r_t_e_d___v_e_r_s_i_o_n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_n_s_u_p_p_o_r_t_e_d___a_u_t_h_e_n_t_i_c_a_t_i_o_n___m_e_t_h_o_d_ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_n_s_u_p_p_o_r_t_e_d___a_u_t_h_e_n_t_i_c_a_t_i_o_n___v_e_r_s_i_o_n_|_3_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_a_u_t_h_e_n_t_i_c_a_t_i_o_n___e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_4_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_s_e_r_n_a_m_e___r_e_q_u_i_r_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_5_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_g_e_n_e_r_a_l___f_a_i_l_u_r_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_6_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_c_o_m_m_a_n_d___n_o_t___s_u_p_p_o_r_t_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _|_7_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___i_d_e_n_t_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_8_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_d_e_n_t_d___e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_9_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_u_m___e_r_r_o_r_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_0_ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm ppccpp__eerrrroorrss ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_n_a_t_p_m_p_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_p_c_p___s_u_c_c_e_s_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___u_n_s_u_p_p___v_e_r_s_i_o_n_ _ _ _ _ _ _ _ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___n_o_t___a_u_t_h_o_r_i_z_e_d_ _ _ _ _ _ _ _ _ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___m_a_l_f_o_r_m_e_d___r_e_q_u_e_s_t_ _ _ _ _ _ _|_3_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___u_n_s_u_p_p___o_p_c_o_d_e_ _ _ _ _ _ _ _ _ _ _|_4_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___u_n_s_u_p_p___o_p_t_i_o_n_ _ _ _ _ _ _ _ _ _ _|_5_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___m_a_l_f_o_r_m_e_d___o_p_t_i_o_n_ _ _ _ _ _ _ _|_6_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___n_e_t_w_o_r_k___f_a_i_l_u_r_e_ _ _ _ _ _ _ _ _|_7_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___n_o___r_e_s_o_u_r_c_e_s_ _ _ _ _ _ _ _ _ _ _ _|_8_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___u_n_s_u_p_p___p_r_o_t_o_c_o_l_ _ _ _ _ _ _ _ _|_9_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___u_s_e_r___e_x___q_u_o_t_a_ _ _ _ _ _ _ _ _ _ _|_1_0_ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___c_a_n_n_o_t___p_r_o_v_i_d_e___e_x_t_e_r_n_a_l_|_1_1_ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___a_d_d_r_e_s_s___m_i_s_m_a_t_c_h_ _ _ _ _ _ _ _|_1_2_ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_c_p___e_x_c_e_s_s_i_v_e___r_e_m_o_t_e___p_e_e_r_s_ _|_1_3_ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm ii22pp__eerrrroorr__ccooddee ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_i_2_p___s_t_r_e_a_m_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_n_o___e_r_r_o_r_ _ _ _ _ _ _ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_a_r_s_e___f_a_i_l_e_d_ _ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_c_a_n_t___r_e_a_c_h___p_e_e_r_|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_2_p___e_r_r_o_r_ _ _ _ _ _ _|_3_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___k_e_y_ _ _ _ _|_4_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___i_d_ _ _ _ _ _|_5_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_t_i_m_e_o_u_t_ _ _ _ _ _ _ _ _|_6_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_k_e_y___n_o_t___f_o_u_n_d_ _ _|_7_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_d_u_p_l_i_c_a_t_e_d___i_d_ _ _|_8_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_u_m___e_r_r_o_r_s_ _ _ _ _ _|_9_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm eerrrroorr__ccooddee__eennuumm ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_g_z_i_p_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_0_ _ _ _ _|_N_o_t_ _a_n_ _e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_gzip_header |1 |the supplied gzip buffer has |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _h_e_a_d_e_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |the gzip buffer would inflate to |
│ │ │ │ -|inflated_data_too_large |2 |more bytes than the specified |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_a_x_i_m_u_m_ _s_i_z_e_,_ _a_n_d_ _w_a_s_ _r_e_j_e_c_t_e_d_._ _ _ _ |
│ │ │ │ -|data_did_not_terminate |3 |available inflate data did not |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_e_r_m_i_n_a_t_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|space_exhausted |4 |output space exhausted before |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_m_p_l_e_t_i_n_g_ _i_n_f_l_a_t_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___b_l_o_c_k___t_y_p_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_5_ _ _ _ _|_i_n_v_a_l_i_d_ _b_l_o_c_k_ _t_y_p_e_ _(_t_y_p_e_ _=_=_ _3_)_ _ _ _ _ |
│ │ │ │ -|invalid_stored_block_length |6 |stored block length did not match |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_n_e_'_s_ _c_o_m_p_l_e_m_e_n_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|too_many_length_or_distance_codes |7 |dynamic block code description: too|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_a_n_y_ _l_e_n_g_t_h_ _o_r_ _d_i_s_t_a_n_c_e_ _c_o_d_e_s_ _ _ _ _ _ |
│ │ │ │ -|code_lengths_codes_incomplete |8 |dynamic block code description: |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_d_e_ _l_e_n_g_t_h_s_ _c_o_d_e_s_ _i_n_c_o_m_p_l_e_t_e_ _ _ _ _ _ |
│ │ │ │ -|repeat_lengths_with_no_first_length|9 |dynamic block code description: |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_p_e_a_t_ _l_e_n_g_t_h_s_ _w_i_t_h_ _n_o_ _f_i_r_s_t_ _l_e_n_g_t_h|
│ │ │ │ -|repeat_more_than_specified_lengths |10 |dynamic block code description: |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_p_e_a_t_ _m_o_r_e_ _t_h_a_n_ _s_p_e_c_i_f_i_e_d_ _l_e_n_g_t_h_s_ |
│ │ │ │ -|invalid_literal_length_code_lengths|11 |dynamic block code description: |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _l_i_t_e_r_a_l_/_l_e_n_g_t_h_ _c_o_d_e_ _l_e_n_g_t_h_s|
│ │ │ │ -|invalid_distance_code_lengths |12 |dynamic block code description: |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _d_i_s_t_a_n_c_e_ _c_o_d_e_ _l_e_n_g_t_h_s_ _ _ _ _ _ |
│ │ │ │ -|invalid_literal_code_in_block |13 |invalid literal/length or distance |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_d_e_ _i_n_ _f_i_x_e_d_ _o_r_ _d_y_n_a_m_i_c_ _b_l_o_c_k_ _ _ _ _ |
│ │ │ │ -|distance_too_far_back_in_block |14 |distance is too far back in fixed |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_r_ _d_y_n_a_m_i_c_ _b_l_o_c_k_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|unknown_gzip_error |15 |an unknown error occurred during |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_g_z_i_p_ _i_n_f_l_a_t_i_o_n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_e_r_r_o_r___c_o_d_e___m_a_x_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_6_ _ _ _|_t_h_e_ _n_u_m_b_e_r_ _o_f_ _e_r_r_o_r_ _c_o_d_e_s_ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm eerrrroorr__ccooddee__eennuumm ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_r_r_o_r___c_o_d_e_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_0_ _ _ _ _|_N_o_t_ _a_n_ _e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|file_collision |1 |Two torrents has files which end |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_u_p_ _o_v_e_r_w_r_i_t_i_n_g_ _e_a_c_h_ _o_t_h_e_r_ _ _ _ _ _ _ _ _ |
│ │ │ │ -|failed_hash_check |2 |A piece did not match its piece |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_h_a_s_h_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The .torrent file does not contain|
│ │ │ │ -|torrent_is_no_dict |3 |a bencoded dictionary at its top |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_l_e_v_e_l_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_missing_info |4 |The .torrent file does not have an|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_f_o_ _d_i_c_t_i_o_n_a_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_info_no_dict |5 |The .torrent file's info _e_n_t_r_y is |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_n_o_t_ _a_ _d_i_c_t_i_o_n_a_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_missing_piece_length |6 |The .torrent file does not have a |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_i_e_c_e_ _l_e_n_g_t_h_ _e_n_t_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_missing_name |7 |The .torrent file does not have a |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_n_a_m_e_ _e_n_t_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_invalid_name |8 |The .torrent file's name _e_n_t_r_y is |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The length of a file, or of the |
│ │ │ │ -|torrent_invalid_length |9 |whole .torrent file is invalid. |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_E_i_t_h_e_r_ _n_e_g_a_t_i_v_e_ _o_r_ _n_o_t_ _a_n_ _i_n_t_e_g_e_r_ |
│ │ │ │ -|torrent_file_parse_failed |10 |Failed to parse a file _e_n_t_r_y in |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_e_ _._t_o_r_r_e_n_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_missing_pieces |11 |The pieces field is missing or |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _i_n_ _t_h_e_ _._t_o_r_r_e_n_t_ _f_i_l_e_ _ _ _ _ _ |
│ │ │ │ -|torrent_invalid_hashes |12 |The pieces string has incorrect |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_l_e_n_g_t_h_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|too_many_pieces_in_torrent |13 |The .torrent file has more pieces |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_a_n_ _i_s_ _s_u_p_p_o_r_t_e_d_ _b_y_ _l_i_b_t_o_r_r_e_n_t_ _ _ |
│ │ │ │ -| | |The metadata (.torrent file) that |
│ │ │ │ -|invalid_swarm_metadata |14 |was received from the swarm |
│ │ │ │ -| | |matched the info-hash, but failed |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_o_ _b_e_ _p_a_r_s_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_bencoding |15 |The file or buffer is not |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_r_r_e_c_t_l_y_ _b_e_n_c_o_d_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|no_files_in_torrent |16 |The .torrent file does not contain|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_n_y_ _f_i_l_e_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_escaped_string |17 |The string was not properly url- |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_e_n_c_o_d_e_d_ _a_s_ _e_x_p_e_c_t_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|session_is_closing |18 |Operation is not permitted since |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_e_ _s_e_s_s_i_o_n_ _i_s_ _s_h_u_t_t_i_n_g_ _d_o_w_n_ _ _ _ _ _ |
│ │ │ │ -| | |There's already a torrent with |
│ │ │ │ -|duplicate_torrent |19 |that info-hash added to the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_e_s_s_i_o_n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_torrent_handle |20 |The supplied _t_o_r_r_e_n_t___h_a_n_d_l_e is not|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_f_e_r_r_i_n_g_ _t_o_ _a_ _v_a_l_i_d_ _t_o_r_r_e_n_t_ _ _ _ _ _ |
│ │ │ │ -|invalid_entry_type |21 |The type requested from the _e_n_t_r_y |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_d_i_d_ _n_o_t_ _m_a_t_c_h_ _i_t_s_ _t_y_p_e_ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|missing_info_hash_in_uri |22 |The specified URI does not contain|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_ _v_a_l_i_d_ _i_n_f_o_-_h_a_s_h_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |One of the files in the torrent |
│ │ │ │ -|file_too_short |23 |was unexpectedly small. This might|
│ │ │ │ -| | |be caused by files being changed |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_b_y_ _a_n_ _e_x_t_e_r_n_a_l_ _p_r_o_c_e_s_s_ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The URL used an unknown protocol. |
│ │ │ │ -| | |Currently http and https (if built|
│ │ │ │ -|unsupported_url_protocol |24 |with openssl support) are |
│ │ │ │ -| | |recognized. For trackers udp is |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_c_o_g_n_i_z_e_d_ _a_s_ _w_e_l_l_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|url_parse_error |25 |The URL did not conform to URL |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_y_n_t_a_x_ _a_n_d_ _f_a_i_l_e_d_ _t_o_ _b_e_ _p_a_r_s_e_d_ _ _ _ |
│ │ │ │ -|peer_sent_empty_piece |26 |The peer sent a piece message of |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_l_e_n_g_t_h_ _0_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|parse_failed |27 |A bencoded structure was corrupt |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_n_d_ _f_a_i_l_e_d_ _t_o_ _b_e_ _p_a_r_s_e_d_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_file_tag |28 |The fast resume file was missing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_r_ _h_a_d_ _a_n_ _i_n_v_a_l_i_d_ _f_i_l_e_ _v_e_r_s_i_o_n_ _t_a_g|
│ │ │ │ -|missing_info_hash |29 |The fast resume file was missing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_r_ _h_a_d_ _a_n_ _i_n_v_a_l_i_d_ _i_n_f_o_-_h_a_s_h_ _ _ _ _ _ _ |
│ │ │ │ -|mismatching_info_hash |30 |The info-hash did not match the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_o_r_r_e_n_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_hostname |31 |The URL contained an invalid |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_h_o_s_t_n_a_m_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___p_o_r_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_3_2_ _ _ _|_T_h_e_ _U_R_L_ _h_a_d_ _a_n_ _i_n_v_a_l_i_d_ _p_o_r_t_ _ _ _ _ _ _ |
│ │ │ │ -| | |The port is blocked by the port- |
│ │ │ │ -|port_blocked |33 |filter, and prevented the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_n_n_e_c_t_i_o_n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|expected_close_bracket_in_address |34 |The IPv6 address was expected to |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_e_n_d_ _w_i_t_h_ _"_]_"_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The torrent is being destructed, |
│ │ │ │ -|destructing_torrent |35 |preventing the operation to |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_u_c_c_e_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_t_i_m_e_d___o_u_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_3_6_ _ _ _|_T_h_e_ _c_o_n_n_e_c_t_i_o_n_ _t_i_m_e_d_ _o_u_t_ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer is upload only, and we |
│ │ │ │ -|upload_upload_connection |37 |are upload only. There's no point |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_ _k_e_e_p_i_n_g_ _t_h_e_ _c_o_n_n_e_c_t_i_o_n_ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer is upload only, and we're|
│ │ │ │ -|uninteresting_upload_peer |38 |not interested in it. There's no |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_o_i_n_t_ _i_n_ _k_e_e_p_i_n_g_ _t_h_e_ _c_o_n_n_e_c_t_i_o_n_ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___i_n_f_o___h_a_s_h_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_3_9_ _ _ _|_T_h_e_ _p_e_e_r_ _s_e_n_t_ _a_n_ _u_n_k_n_o_w_n_ _i_n_f_o_-_h_a_s_h|
│ │ │ │ -|torrent_paused |40 |The torrent is paused, preventing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_e_ _o_p_e_r_a_t_i_o_n_ _f_r_o_m_ _s_u_c_c_e_e_d_i_n_g_ _ _ _ _ |
│ │ │ │ -| | |The peer sent an invalid have |
│ │ │ │ -|invalid_have |41 |message, either wrong size or |
│ │ │ │ -| | |referring to a piece that doesn't |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_e_x_i_s_t_ _i_n_ _t_h_e_ _t_o_r_r_e_n_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_bitfield_size |42 |The _b_i_t_f_i_e_l_d message had the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_c_o_r_r_e_c_t_ _s_i_z_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer kept requesting pieces |
│ │ │ │ -|too_many_requests_when_choked |43 |after it was choked, possible |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_b_u_s_e_ _a_t_t_e_m_p_t_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer sent a piece message that|
│ │ │ │ -|invalid_piece |44 |does not correspond to a piece |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_q_u_e_s_t_ _s_e_n_t_ _b_y_ _t_h_e_ _c_l_i_e_n_t_ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___m_e_m_o_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_4_5_ _ _ _|_m_e_m_o_r_y_ _a_l_l_o_c_a_t_i_o_n_ _f_a_i_l_e_d_ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_aborted |46 |The torrent is aborted, preventing|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_e_ _o_p_e_r_a_t_i_o_n_ _t_o_ _s_u_c_c_e_e_d_ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|self_connection |47 |The peer is a connection to |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_u_r_s_e_l_f_,_ _n_o_ _p_o_i_n_t_ _i_n_ _k_e_e_p_i_n_g_ _i_t_ _ _ |
│ │ │ │ -| | |The peer sent a piece message with|
│ │ │ │ -|invalid_piece_size |48 |invalid size, either negative or |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_g_r_e_a_t_e_r_ _t_h_a_n_ _o_n_e_ _b_l_o_c_k_ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer has not been interesting |
│ │ │ │ -|timed_out_no_interest |49 |or interested in us for too long, |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_n_o_ _p_o_i_n_t_ _i_n_ _k_e_e_p_i_n_g_ _i_t_ _a_r_o_u_n_d_ _ _ _ _ |
│ │ │ │ -|timed_out_inactivity |50 |The peer has not said anything in |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_ _l_o_n_g_ _t_i_m_e_,_ _p_o_s_s_i_b_l_y_ _d_e_a_d_ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer did not send a handshake |
│ │ │ │ -|timed_out_no_handshake |51 |within a reasonable amount of |
│ │ │ │ -| | |time, it might not be a bittorrent|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_e_e_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer has been unchoked for too|
│ │ │ │ -|timed_out_no_request |52 |long without requesting any data. |
│ │ │ │ -| | |It might be lying about its |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_t_e_r_e_s_t_ _i_n_ _u_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_choke |53 |The peer sent an invalid choke |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_unchoke |54 |The peer send an invalid unchoke |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_interested |55 |The peer sent an invalid |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_t_e_r_e_s_t_e_d_ _m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_not_interested |56 |The peer sent an invalid not- |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_t_e_r_e_s_t_e_d_ _m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_request |57 |The peer sent an invalid piece |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_q_u_e_s_t_ _m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer sent an invalid hash-list|
│ │ │ │ -|invalid_hash_list |58 |message (this is part of the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_r_k_l_e_-_t_o_r_r_e_n_t_ _e_x_t_e_n_s_i_o_n_)_ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer sent an invalid hash- |
│ │ │ │ -|invalid_hash_piece |59 |piece message (this is part of the|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_r_k_l_e_-_t_o_r_r_e_n_t_ _e_x_t_e_n_s_i_o_n_)_ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_cancel |60 |The peer sent an invalid cancel |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_dht_port |61 |The peer sent an invalid DHT port-|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_suggest |62 |The peer sent an invalid suggest |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_i_e_c_e_-_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_have_all |63 |The peer sent an invalid have all-|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_have_none |64 |The peer sent an invalid have |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_n_o_n_e_-_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_reject |65 |The peer sent an invalid reject |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_allow_fast |66 |The peer sent an invalid allow |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_f_a_s_t_-_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_extended |67 |The peer sent an invalid extension|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _I_D_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_message |68 |The peer sent an invalid message |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_I_D_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|sync_hash_not_found |69 |The synchronization hash was not |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_f_o_u_n_d_ _i_n_ _t_h_e_ _e_n_c_r_y_p_t_e_d_ _h_a_n_d_s_h_a_k_e_ _ |
│ │ │ │ -|invalid_encryption_constant |70 |The encryption constant in the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_h_a_n_d_s_h_a_k_e_ _i_s_ _i_n_v_a_l_i_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|no_plaintext_mode |71 |The peer does not support plain |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_e_x_t_,_ _w_h_i_c_h_ _i_s_ _t_h_e_ _s_e_l_e_c_t_e_d_ _m_o_d_e_ _ |
│ │ │ │ -|no_rc4_mode |72 |The peer does not support RC4, |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_w_h_i_c_h_ _i_s_ _t_h_e_ _s_e_l_e_c_t_e_d_ _m_o_d_e_ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer does not support any of |
│ │ │ │ -|unsupported_encryption_mode |73 |the encryption modes that the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_l_i_e_n_t_ _s_u_p_p_o_r_t_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer selected an encryption |
│ │ │ │ -|unsupported_encryption_mode_selected|74 |mode that the client did not |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_d_v_e_r_t_i_s_e_ _a_n_d_ _d_o_e_s_ _n_o_t_ _s_u_p_p_o_r_t_ _ _ _ |
│ │ │ │ -| | |The pad size used in the |
│ │ │ │ -|invalid_pad_size |75 |encryption handshake is of invalid|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_i_z_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_encrypt_handshake |76 |The encryption handshake is |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The client is set to not support |
│ │ │ │ -|no_incoming_encrypted |77 |incoming encrypted connections and|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_i_s_ _i_s_ _a_n_ _e_n_c_r_y_p_t_e_d_ _c_o_n_n_e_c_t_i_o_n_ _ _ |
│ │ │ │ -| | |The client is set to not support |
│ │ │ │ -|no_incoming_regular |78 |incoming regular bittorrent |
│ │ │ │ -| | |connections, and this is a regular|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_n_n_e_c_t_i_o_n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|duplicate_peer_id |79 |The client is already connected to|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_i_s_ _p_e_e_r_-_I_D_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_t_o_r_r_e_n_t___r_e_m_o_v_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_8_0_ _ _ _|_T_o_r_r_e_n_t_ _w_a_s_ _r_e_m_o_v_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|packet_too_large |81 |The packet size exceeded the upper|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_a_n_i_t_y_ _c_h_e_c_k_-_l_i_m_i_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_r_e_s_e_r_v_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_8_2_ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|http_error |83 |The web server responded with an |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|missing_location |84 |The web server response is missing|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_ _l_o_c_a_t_i_o_n_ _h_e_a_d_e_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The web seed redirected to a path |
│ │ │ │ -|invalid_redirection |85 |that no longer matches the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_._t_o_r_r_e_n_t_ _d_i_r_e_c_t_o_r_y_ _s_t_r_u_c_t_u_r_e_ _ _ _ _ _ |
│ │ │ │ -|redirecting |86 |The connection was closed because |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_t_ _r_e_d_i_r_e_c_t_e_d_ _t_o_ _a_ _d_i_f_f_e_r_e_n_t_ _U_R_L_ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___r_a_n_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_8_7_ _ _ _|_T_h_e_ _H_T_T_P_ _r_a_n_g_e_ _h_e_a_d_e_r_ _i_s_ _i_n_v_a_l_i_d_ _ |
│ │ │ │ -|no_content_length |88 |The HTTP response did not have a |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_n_t_e_n_t_ _l_e_n_g_t_h_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_b_a_n_n_e_d___b_y___i_p___f_i_l_t_e_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_8_9_ _ _ _|_T_h_e_ _I_P_ _i_s_ _b_l_o_c_k_e_d_ _b_y_ _t_h_e_ _I_P_ _f_i_l_t_e_r|
│ │ │ │ -|_t_o_o___m_a_n_y___c_o_n_n_e_c_t_i_o_n_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_9_0_ _ _ _|_A_t_ _t_h_e_ _c_o_n_n_e_c_t_i_o_n_ _l_i_m_i_t_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_e_e_r___b_a_n_n_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_9_1_ _ _ _|_T_h_e_ _p_e_e_r_ _i_s_ _m_a_r_k_e_d_ _a_s_ _b_a_n_n_e_d_ _ _ _ _ _ |
│ │ │ │ -|stopping_torrent |92 |The torrent is stopping, causing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_e_ _o_p_e_r_a_t_i_o_n_ _t_o_ _f_a_i_l_ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|too_many_corrupt_pieces |93 |The peer has sent too many corrupt|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_i_e_c_e_s_ _a_n_d_ _i_s_ _b_a_n_n_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_not_ready |94 |The torrent is not ready to |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_c_e_i_v_e_ _p_e_e_r_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|peer_not_constructed |95 |The peer is not completely |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_o_n_s_t_r_u_c_t_e_d_ _y_e_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|session_closing |96 |The _s_e_s_s_i_o_n is closing, causing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_e_ _o_p_e_r_a_t_i_o_n_ _t_o_ _f_a_i_l_ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer was disconnected in order|
│ │ │ │ -|optimistic_disconnect |97 |to leave room for a potentially |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_b_e_t_t_e_r_ _p_e_e_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_t_o_r_r_e_n_t___f_i_n_i_s_h_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_9_8_ _ _ _|_T_h_e_ _t_o_r_r_e_n_t_ _i_s_ _f_i_n_i_s_h_e_d_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___r_o_u_t_e_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_9_9_ _ _ _|_N_o_ _U_P_n_P_ _r_o_u_t_e_r_ _f_o_u_n_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|metadata_too_large |100 |The metadata message says the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_t_a_d_a_t_a_ _e_x_c_e_e_d_s_ _t_h_e_ _l_i_m_i_t_ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_metadata_request |101 |The peer sent an invalid metadata |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_q_u_e_s_t_ _m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_metadata_size |102 |The peer advertised an invalid |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_t_a_d_a_t_a_ _s_i_z_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_metadata_offset |103 |The peer sent a message with an |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _m_e_t_a_d_a_t_a_ _o_f_f_s_e_t_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_metadata_message |104 |The peer sent an invalid metadata |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|pex_message_too_large |105 |The peer sent a peer exchange |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_s_s_a_g_e_ _t_h_a_t_ _w_a_s_ _t_o_o_ _l_a_r_g_e_ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_pex_message |106 |The peer sent an invalid peer |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_e_x_c_h_a_n_g_e_ _m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_lt_tracker_message |107 |The peer sent an invalid tracker |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_e_x_c_h_a_n_g_e_ _m_e_s_s_a_g_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer sent an pex messages too |
│ │ │ │ -|too_frequent_pex |108 |often. This is a possible attempt |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_f_ _a_n_d_ _a_t_t_a_c_k_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The operation failed because it |
│ │ │ │ -| | |requires the torrent to have the |
│ │ │ │ -| | |metadata (.torrent file) and it |
│ │ │ │ -|no_metadata |109 |doesn't have it yet. This happens |
│ │ │ │ -| | |for magnet links before they have |
│ │ │ │ -| | |downloaded the metadata, and also |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_o_r_r_e_n_t_s_ _a_d_d_e_d_ _b_y_ _U_R_L_._ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer sent an invalid dont_have|
│ │ │ │ -| | |message. The don't have message is|
│ │ │ │ -|invalid_dont_have |110 |an extension to allow peers to |
│ │ │ │ -| | |advertise that the no longer has a|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_i_e_c_e_ _t_h_e_y_ _p_r_e_v_i_o_u_s_l_y_ _h_a_d_._ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer tried to connect to an |
│ │ │ │ -|requires_ssl_connection |111 |SSL torrent without connecting |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_v_e_r_ _S_S_L_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The peer tried to connect to a |
│ │ │ │ -|invalid_ssl_cert |112 |torrent with a certificate for a |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_d_i_f_f_e_r_e_n_t_ _t_o_r_r_e_n_t_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |the torrent is not an SSL torrent,|
│ │ │ │ -|not_an_ssl_torrent |113 |and the operation requires an SSL |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_o_r_r_e_n_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |peer was banned because its listen|
│ │ │ │ -|banned_by_port_filter |114 |port is within a banned port |
│ │ │ │ -| | |range, as specified by the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_o_r_t___f_i_l_t_e_r_._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_session_handle |115 |The _s_e_s_s_i_o_n___h_a_n_d_l_e is not |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_f_e_r_r_i_n_g_ _t_o_ _a_ _v_a_l_i_d_ _s_e_s_s_i_o_n___i_m_p_l_ |
│ │ │ │ -|invalid_listen_socket |116 |the listen socket associated with |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_i_s_ _r_e_q_u_e_s_t_ _w_a_s_ _c_l_o_s_e_d_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___h_a_s_h___r_e_q_u_e_s_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_1_7_ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___h_a_s_h_e_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_1_8_ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___h_a_s_h___r_e_j_e_c_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_1_9_ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_d_e_p_r_e_c_a_t_e_d___1_2_0_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_2_0_ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_d_e_p_r_e_c_a_t_e_d___1_2_1_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_2_1_ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_d_e_p_r_e_c_a_t_e_d___1_2_2_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_2_2_ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_d_e_p_r_e_c_a_t_e_d___1_2_3_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_2_3_ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_d_e_p_r_e_c_a_t_e_d___1_2_4_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_2_4_ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|missing_file_sizes |130 |The resume data file is missing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_e_ _f_i_l_e_ _s_i_z_e_s_ _e_n_t_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|no_files_in_resume_data |131 |The resume data file file sizes |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_e_n_t_r_y_ _i_s_ _e_m_p_t_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|missing_pieces |132 |The resume data file is missing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_h_e_ _p_i_e_c_e_s_ _a_n_d_ _s_l_o_t_s_ _e_n_t_r_y_ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The number of files in the resume |
│ │ │ │ -|mismatching_number_of_files |133 |data does not match the number of |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_f_i_l_e_s_ _i_n_ _t_h_e_ _t_o_r_r_e_n_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |One of the files on disk has a |
│ │ │ │ -|mismatching_file_size |134 |different size than in the fast |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_s_u_m_e_ _f_i_l_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |One of the files on disk has a |
│ │ │ │ -|mismatching_file_timestamp |135 |different timestamp than in the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_f_a_s_t_ _r_e_s_u_m_e_ _f_i_l_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|not_a_dictionary |136 |The resume data file is not a |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_d_i_c_t_i_o_n_a_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_blocks_per_piece |137 |The blocks per piece _e_n_t_r_y is |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _i_n_ _t_h_e_ _r_e_s_u_m_e_ _d_a_t_a_ _f_i_l_e_ _ _ |
│ │ │ │ -| | |The resume file is missing the |
│ │ │ │ -|missing_slots |138 |slots _e_n_t_r_y, which is required for|
│ │ │ │ -| | |torrents with compact allocation. |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_DD_EE_PP_RR_EE_CC_AA_TT_EE_DD_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|too_many_slots |139 |The resume file contains more |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_l_o_t_s_ _t_h_a_n_ _t_h_e_ _t_o_r_r_e_n_t_ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_slot_list |140 |The slot _e_n_t_r_y is invalid in the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_r_e_s_u_m_e_ _d_a_t_a_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_piece_index |141 |One index in the slot list is |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The pieces on disk needs to be re-|
│ │ │ │ -| | |ordered for the specified |
│ │ │ │ -| | |allocation mode. This happens if |
│ │ │ │ -|pieces_need_reorder |142 |you specify sparse allocation and |
│ │ │ │ -| | |the files on disk are using |
│ │ │ │ -| | |compact storage. The pieces needs |
│ │ │ │ -| | |to be moved to their right |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_o_s_i_t_i_o_n_._ _DD_EE_PP_RR_EE_CC_AA_TT_EE_DD_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |this error is returned when asking|
│ │ │ │ -| | |to save resume data and specifying|
│ │ │ │ -|resume_data_not_modified |143 |the flag to only save when there's|
│ │ │ │ -| | |anything new to save |
│ │ │ │ -| | |(_t_o_r_r_e_n_t___h_a_n_d_l_e_:_:_o_n_l_y___i_f___m_o_d_i_f_i_e_d)|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_n_d_ _t_h_e_r_e_ _w_a_s_n_'_t_ _a_n_y_t_h_i_n_g_ _c_h_a_n_g_e_d_.|
│ │ │ │ -|invalid_save_path |144 |the save_path in |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_d_d___t_o_r_r_e_n_t___p_a_r_a_m_s_ _i_s_ _n_o_t_ _v_a_l_i_d_ _ _ |
│ │ │ │ -|http_parse_error |150 |The HTTP header was not correctly |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_f_o_r_m_a_t_t_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The HTTP response was in the 300- |
│ │ │ │ -|http_missing_location |151 |399 range but lacked a location |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_h_e_a_d_e_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |The HTTP response was encoded with|
│ │ │ │ -|http_failed_decompress |152 |gzip or deflate but decompressing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_t_ _f_a_i_l_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|no_i2p_router |160 |The URL specified an i2p address, |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_b_u_t_ _n_o_ _i_2_p_ _r_o_u_t_e_r_ _i_s_ _c_o_n_f_i_g_u_r_e_d_ _ _ |
│ │ │ │ -|no_i2p_endpoint |161 |i2p acceptor is not available yet,|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_c_a_n_'_t_ _a_n_n_o_u_n_c_e_ _w_i_t_h_o_u_t_ _e_n_d_p_o_i_n_t_ _ _ |
│ │ │ │ -| | |The tracker URL doesn't support |
│ │ │ │ -|scrape_not_available |170 |transforming it into a scrape URL.|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_._e_._ _i_t_ _d_o_e_s_n_'_t_ _c_o_n_t_a_i_n_ _"_a_n_n_o_u_n_c_e_.|
│ │ │ │ -|_i_n_v_a_l_i_d___t_r_a_c_k_e_r___r_e_s_p_o_n_s_e_ _ _ _ _ _ _ _ _ _ _ _ _|_1_7_1_ _ _|_i_n_v_a_l_i_d_ _t_r_a_c_k_e_r_ _r_e_s_p_o_n_s_e_ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_peer_dict |172 |invalid peer dictionary _e_n_t_r_y. Not|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_ _d_i_c_t_i_o_n_a_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_t_r_a_c_k_e_r___f_a_i_l_u_r_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_7_3_ _ _|_t_r_a_c_k_e_r_ _s_e_n_t_ _a_ _f_a_i_l_u_r_e_ _m_e_s_s_a_g_e_ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___f_i_l_e_s___e_n_t_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_7_4_ _ _|_m_i_s_s_i_n_g_ _o_r_ _i_n_v_a_l_i_d_ _f_i_l_e_s_ _e_n_t_r_y_ _ _ _ |
│ │ │ │ -|_i_n_v_a_l_i_d___h_a_s_h___e_n_t_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_7_5_ _ _|_m_i_s_s_i_n_g_ _o_r_ _i_n_v_a_l_i_d_ _h_a_s_h_ _e_n_t_r_y_ _ _ _ _ |
│ │ │ │ -|invalid_peers_entry |176 |missing or invalid peers and |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_e_e_r_s_6_ _e_n_t_r_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_tracker_response_length |177 |UDP tracker response packet has |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_i_n_v_a_l_i_d_ _s_i_z_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_tracker_transaction_id |178 |invalid transaction id in UDP |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_r_a_c_k_e_r_ _r_e_s_p_o_n_s_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|invalid_tracker_action |179 |invalid action field in UDP |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_r_a_c_k_e_r_ _r_e_s_p_o_n_s_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -| | |skipped announce (because it's |
│ │ │ │ -|announce_skipped |180 |assumed to be unreachable over the|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_g_i_v_e_n_ _s_o_u_r_c_e_ _n_e_t_w_o_r_k_ _i_n_t_e_r_f_a_c_e_)_ _ _ |
│ │ │ │ -|_n_o___e_n_t_r_o_p_y_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_2_0_0_ _ _|_r_a_n_d_o_m_ _n_u_m_b_e_r_ _g_e_n_e_r_a_t_i_o_n_ _f_a_i_l_e_d_ _ _ |
│ │ │ │ -|_s_s_r_f___m_i_t_i_g_a_t_i_o_n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_2_0_1_ _ _|_b_l_o_c_k_e_d_ _b_y_ _S_S_R_F_ _m_i_t_i_g_a_t_i_o_n_ _ _ _ _ _ _ _ |
│ │ │ │ -|blocked_by_idna |202 |blocked because IDNA host names |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_a_r_e_ _b_a_n_n_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_unknown_version |210 |the torrent file has an unknown |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_m_e_t_a_ _v_e_r_s_i_o_n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_missing_file_tree |211 |the v2 torrent file has no file |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_t_r_e_e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_missing_meta_version |212 |the torrent contains v2 keys but |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_d_o_e_s_ _n_o_t_ _s_p_e_c_i_f_y_ _m_e_t_a_ _v_e_r_s_i_o_n_ _2_ _ _ |
│ │ │ │ -|torrent_inconsistent_files |213 |the v1 and v2 file metadata does |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_n_o_t_ _m_a_t_c_h_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_missing_piece_layer |214 |one or more files are missing |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_i_e_c_e_ _l_a_y_e_r_ _h_a_s_h_e_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_invalid_piece_layer |215 |a piece layer has the wrong size |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_o_r_ _f_a_i_l_e_d_ _h_a_s_h_ _c_h_e_c_k_ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_t_o_r_r_e_n_t___m_i_s_s_i_n_g___p_i_e_c_e_s___r_o_o_t_ _ _ _ _ _ _ _ _ _|_2_1_6_ _ _|_a_ _v_2_ _f_i_l_e_ _e_n_t_r_y_ _h_a_s_ _n_o_ _r_o_o_t_ _h_a_s_h_ _ |
│ │ │ │ -|torrent_inconsistent_hashes |217 |the v1 and v2 hashes do not |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_d_e_s_c_r_i_b_e_ _t_h_e_ _s_a_m_e_ _d_a_t_a_ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|torrent_invalid_pad_file |218 |a file in the v2 metadata has the |
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_p_a_d_ _a_t_t_r_i_b_u_t_e_ _s_e_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_e_r_r_o_r___c_o_d_e___m_a_x_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_2_1_9_ _ _|_t_h_e_ _n_u_m_b_e_r_ _o_f_ _e_r_r_o_r_ _c_o_d_e_s_ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm hhttttpp__eerrrroorrss ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_r_r_o_r___c_o_d_e_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_c_o_n_t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_1_0_0_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_o_k_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_2_0_0_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_c_r_e_a_t_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_2_0_1_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_a_c_c_e_p_t_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _|_2_0_2_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___c_o_n_t_e_n_t_ _ _ _ _ _ _ _ _ _ _ _|_2_0_4_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_m_u_l_t_i_p_l_e___c_h_o_i_c_e_s_ _ _ _ _ _|_3_0_0_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_m_o_v_e_d___p_e_r_m_a_n_e_n_t_l_y_ _ _ _ _|_3_0_1_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_m_o_v_e_d___t_e_m_p_o_r_a_r_i_l_y_ _ _ _ _|_3_0_2_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o_t___m_o_d_i_f_i_e_d_ _ _ _ _ _ _ _ _ _|_3_0_4_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_b_a_d___r_e_q_u_e_s_t_ _ _ _ _ _ _ _ _ _ _|_4_0_0_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_n_a_u_t_h_o_r_i_z_e_d_ _ _ _ _ _ _ _ _ _|_4_0_1_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_f_o_r_b_i_d_d_e_n_ _ _ _ _ _ _ _ _ _ _ _ _|_4_0_3_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o_t___f_o_u_n_d_ _ _ _ _ _ _ _ _ _ _ _ _|_4_0_4_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_i_n_t_e_r_n_a_l___s_e_r_v_e_r___e_r_r_o_r_|_5_0_0_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o_t___i_m_p_l_e_m_e_n_t_e_d_ _ _ _ _ _ _|_5_0_1_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_b_a_d___g_a_t_e_w_a_y_ _ _ _ _ _ _ _ _ _ _|_5_0_2_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_s_e_r_v_i_c_e___u_n_a_v_a_i_l_a_b_l_e_ _ _|_5_0_3_ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennuumm eerrrroorr__ccooddee__eennuumm ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_b_d_e_c_o_d_e_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_n_o___e_r_r_o_r_ _ _ _ _ _ _|_0_ _ _ _ _|_N_o_t_ _a_n_ _e_r_r_o_r_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_e_x_p_e_c_t_e_d___d_i_g_i_t_|_1_ _ _ _ _|_e_x_p_e_c_t_e_d_ _d_i_g_i_t_ _i_n_ _b_e_n_c_o_d_e_d_ _s_t_r_i_n_g_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_e_x_p_e_c_t_e_d___c_o_l_o_n_|_2_ _ _ _ _|_e_x_p_e_c_t_e_d_ _c_o_l_o_n_ _i_n_ _b_e_n_c_o_d_e_d_ _s_t_r_i_n_g_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_n_e_x_p_e_c_t_e_d___e_o_f_|_3_ _ _ _ _|_u_n_e_x_p_e_c_t_e_d_ _e_n_d_ _o_f_ _f_i_l_e_ _i_n_ _b_e_n_c_o_d_e_d_ _s_t_r_i_n_g_ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|expected_value|4 |expected value (list, dict, _i_n_t or string) in bencoded|
│ │ │ │ -|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _|_s_t_r_i_n_g_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_d_e_p_t_h___e_x_c_e_e_d_e_d_|_5_ _ _ _ _|_b_e_n_c_o_d_e_d_ _r_e_c_u_r_s_i_o_n_ _d_e_p_t_h_ _l_i_m_i_t_ _e_x_c_e_e_d_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_l_i_m_i_t___e_x_c_e_e_d_e_d_|_6_ _ _ _ _|_b_e_n_c_o_d_e_d_ _i_t_e_m_ _c_o_u_n_t_ _l_i_m_i_t_ _e_x_c_e_e_d_e_d_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_o_v_e_r_f_l_o_w_ _ _ _ _ _ _|_7_ _ _ _ _|_i_n_t_e_g_e_r_ _o_v_e_r_f_l_o_w_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_e_r_r_o_r___c_o_d_e___m_a_x_|_8_ _ _ _ _|_t_h_e_ _n_u_m_b_e_r_ _o_f_ _e_r_r_o_r_ _c_o_d_e_s_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -Bencoding is a common representation in bittorrent used for dictionary, list,
│ │ │ │ -_i_n_t and string hierarchies. It's used to encode .torrent files and some
│ │ │ │ -messages in the network protocol. libtorrent also uses it to store settings,
│ │ │ │ -resume data and other _s_e_s_s_i_o_n state.
│ │ │ │ -Strings in bencoded structures do not necessarily represent text. Strings are
│ │ │ │ -raw byte buffers of a certain length. If a string is meant to be interpreted as
│ │ │ │ -text, it is required to be UTF-8 encoded. See _B_E_P_ _3.
│ │ │ │ -The function for decoding bencoded data _b_d_e_c_o_d_e_(_), returning a _b_d_e_c_o_d_e___n_o_d_e.
│ │ │ │ -This function builds a tree that points back into the original buffer. The
│ │ │ │ -returned _b_d_e_c_o_d_e___n_o_d_e will not be valid once the buffer it was parsed out of is
│ │ │ │ -discarded.
│ │ │ │ -It's possible to construct an _e_n_t_r_y from a _b_d_e_c_o_d_e___n_o_d_e, if a structure needs
│ │ │ │ -to be altered and re-encoded.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ eennttrryy ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_n_t_r_y_._h_p_p"
│ │ │ │ -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 ttyyppee () const;
│ │ │ │ - eennttrryy (dictionary_type);
│ │ │ │ - eennttrryy (preformatted_type);
│ │ │ │ - eennttrryy (list_type);
│ │ │ │ - eennttrryy (span);
│ │ │ │ - eennttrryy (integer_type);
│ │ │ │ - eennttrryy (data_type t);
│ │ │ │ - eennttrryy (bdecode_node const& n);
│ │ │ │ - entry& ooppeerraattoorr== (bdecode_node const&) &;
│ │ │ │ - entry& ooppeerraattoorr== (list_type) &;
│ │ │ │ - entry& ooppeerraattoorr== (dictionary_type) &;
│ │ │ │ - entry& ooppeerraattoorr== (preformatted_type) &;
│ │ │ │ - entry& ooppeerraattoorr== (integer_type) &;
│ │ │ │ - entry& ooppeerraattoorr== (span) &;
│ │ │ │ - entry& ooppeerraattoorr== (entry&&) & noexcept;
│ │ │ │ - entry& ooppeerraattoorr== (entry const&) &;
│ │ │ │ - preformatted_type const& pprreeffoorrmmaatttteedd () const;
│ │ │ │ - list_type const& lliisstt () const;
│ │ │ │ - string_type& ssttrriinngg ();
│ │ │ │ - dictionary_type const& ddiicctt () const;
│ │ │ │ - string_type const& ssttrriinngg () const;
│ │ │ │ - preformatted_type& pprreeffoorrmmaatttteedd ();
│ │ │ │ - integer_type& iinntteeggeerr ();
│ │ │ │ - dictionary_type& ddiicctt ();
│ │ │ │ - integer_type const& iinntteeggeerr () const;
│ │ │ │ - list_type& lliisstt ();
│ │ │ │ - void sswwaapp (entry& e);
│ │ │ │ - entry& ooppeerraattoorr[[]] (string_view key);
│ │ │ │ - entry const& ooppeerraattoorr[[]] (string_view key) const;
│ │ │ │ - entry* ffiinndd__kkeeyy (string_view key);
│ │ │ │ - entry const* ffiinndd__kkeeyy (string_view key) const;
│ │ │ │ - std::string ttoo__ssttrriinngg (bool single_line = false) const;
│ │ │ │ -
│ │ │ │ - enum data_type
│ │ │ │ - {
│ │ │ │ - int_t,
│ │ │ │ - string_t,
│ │ │ │ - list_t,
│ │ │ │ - dictionary_t,
│ │ │ │ - undefined_t,
│ │ │ │ - preformatted_t,
│ │ │ │ - };
│ │ │ │ -};
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttyyppee(()) **********
│ │ │ │ -data_type ttyyppee () const;
│ │ │ │ -returns the concrete type of the _e_n_t_r_y
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennttrryy(()) **********
│ │ │ │ -eennttrryy (dictionary_type);
│ │ │ │ -eennttrryy (preformatted_type);
│ │ │ │ -eennttrryy (list_type);
│ │ │ │ -eennttrryy (span);
│ │ │ │ -eennttrryy (integer_type);
│ │ │ │ -constructors directly from a specific type. The content of the argument is
│ │ │ │ -copied into the newly constructed _e_n_t_r_y
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennttrryy(()) **********
│ │ │ │ -eennttrryy (data_type t);
│ │ │ │ -construct an empty _e_n_t_r_y of the specified type. see _d_a_t_a___t_y_p_e enum.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennttrryy(()) **********
│ │ │ │ -eennttrryy (bdecode_node const& n);
│ │ │ │ -construct from _b_d_e_c_o_d_e___n_o_d_e parsed form (see _b_d_e_c_o_d_e_(_))
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ooppeerraattoorr==(()) **********
│ │ │ │ -entry& ooppeerraattoorr== (bdecode_node const&) &;
│ │ │ │ -entry& ooppeerraattoorr== (list_type) &;
│ │ │ │ -entry& ooppeerraattoorr== (dictionary_type) &;
│ │ │ │ -entry& ooppeerraattoorr== (preformatted_type) &;
│ │ │ │ -entry& ooppeerraattoorr== (integer_type) &;
│ │ │ │ -entry& ooppeerraattoorr== (span) &;
│ │ │ │ -entry& ooppeerraattoorr== (entry&&) & noexcept;
│ │ │ │ -entry& ooppeerraattoorr== (entry const&) &;
│ │ │ │ -copies the structure of the right hand side into this _e_n_t_r_y.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** lliisstt(()) iinntteeggeerr(()) ddiicctt(()) ssttrriinngg(()) pprreeffoorrmmaatttteedd(()) **********
│ │ │ │ -preformatted_type const& pprreeffoorrmmaatttteedd () const;
│ │ │ │ -list_type const& lliisstt () const;
│ │ │ │ -string_type& ssttrriinngg ();
│ │ │ │ -dictionary_type const& ddiicctt () const;
│ │ │ │ -string_type const& ssttrriinngg () const;
│ │ │ │ -preformatted_type& pprreeffoorrmmaatttteedd ();
│ │ │ │ -integer_type& iinntteeggeerr ();
│ │ │ │ -dictionary_type& ddiicctt ();
│ │ │ │ -integer_type const& iinntteeggeerr () const;
│ │ │ │ -list_type& lliisstt ();
│ │ │ │ -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.
│ │ │ │ -The typical code to get info from a torrent file will then look like this:
│ │ │ │ -entry torrent_file;
│ │ │ │ -// ...
│ │ │ │ -
│ │ │ │ -// throws if this is not a dictionary
│ │ │ │ -entry::dictionary_type const& dict = torrent_file.dict();
│ │ │ │ -entry::dictionary_type::const_iterator i;
│ │ │ │ -i = dict.find("announce");
│ │ │ │ -if (i != dict.end())
│ │ │ │ -{
│ │ │ │ - std::string tracker_url = i->second.string();
│ │ │ │ - std::cout << tracker_url << "\n";
│ │ │ │ -}
│ │ │ │ -The following code is equivalent, but a little bit shorter:
│ │ │ │ -entry torrent_file;
│ │ │ │ -// ...
│ │ │ │ -
│ │ │ │ -// throws if this is not a dictionary
│ │ │ │ -if (entry* i = torrent_file.find_key("announce"))
│ │ │ │ -{
│ │ │ │ - std::string tracker_url = i->string();
│ │ │ │ - std::cout << tracker_url << "\n";
│ │ │ │ -}
│ │ │ │ -To make it easier to extract information from a torrent file, the class
│ │ │ │ -_t_o_r_r_e_n_t___i_n_f_o exists.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** sswwaapp(()) **********
│ │ │ │ -void sswwaapp (entry& e);
│ │ │ │ -swaps the content of tthhiiss with e.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ooppeerraattoorr[[]](()) **********
│ │ │ │ -entry& ooppeerraattoorr[[]] (string_view key);
│ │ │ │ -entry const& ooppeerraattoorr[[]] (string_view key) const;
│ │ │ │ -All of these functions requires the _e_n_t_r_y 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ffiinndd__kkeeyy(()) **********
│ │ │ │ -entry* ffiinndd__kkeeyy (string_view key);
│ │ │ │ -entry const* ffiinndd__kkeeyy (string_view key) const;
│ │ │ │ -These functions requires the _e_n_t_r_y 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.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** ttoo__ssttrriinngg(()) **********
│ │ │ │ -std::string ttoo__ssttrriinngg (bool single_line = false) const;
│ │ │ │ -returns a pretty-printed string representation of the bencoded structure, with
│ │ │ │ -JSON-style syntax
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -********** eennuumm ddaattaa__ttyyppee **********
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_n_t_r_y_._h_p_p"
│ │ │ │ - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
│ │ │ │ -|_nn_aa_mm_ee_ _ _ _ _ _ _ _ _ _ _|_vv_aa_ll_uu_ee_|_dd_ee_ss_cc_rr_ii_pp_tt_ii_oo_nn|
│ │ │ │ -|_i_n_t___t_ _ _ _ _ _ _ _ _ _|_0_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_s_t_r_i_n_g___t_ _ _ _ _ _ _|_1_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_l_i_s_t___t_ _ _ _ _ _ _ _ _|_2_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_d_i_c_t_i_o_n_a_r_y___t_ _ _|_3_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_u_n_d_e_f_i_n_e_d___t_ _ _ _|_4_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -|_p_r_e_f_o_r_m_a_t_t_e_d___t_|_5_ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ |
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ ooppeerraattoorr<<<<(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_e_n_t_r_y_._h_p_p"
│ │ │ │ -inline std::ostream& ooppeerraattoorr<<<< (std::ostream& os, const entry& e);
│ │ │ │ -prints the bencoded structure to the ostream as a JSON-style structure.
│ │ │ │ -[_r_e_p_o_r_t_ _i_s_s_u_e]
│ │ │ │ -************ bbeennccooddee(()) ************
│ │ │ │ -Declared in "_l_i_b_t_o_r_r_e_n_t_/_b_e_n_c_o_d_e_._h_p_p"
│ │ │ │ -template int bbeennccooddee (OutIt out, const entry& e);
│ │ │ │ -This function will encode data to bencoded form.
│ │ │ │ -The _e_n_t_r_y class is the internal representation of the bencoded data and it can
│ │ │ │ -be used to retrieve information, an _e_n_t_r_y can also be build by the program and
│ │ │ │ -given to bencode() to encode it into the OutIt iterator.
│ │ │ │ -OutIt is an _O_u_t_p_u_t_I_t_e_r_a_t_o_r. It's a template and usually instantiated as
│ │ │ │ -_o_s_t_r_e_a_m___i_t_e_r_a_t_o_r or _b_a_c_k___i_n_s_e_r_t___i_t_e_r_a_t_o_r. This function assumes the value_type
│ │ │ │ -of the iterator is a char. In order to encode _e_n_t_r_y e into a buffer, do:
│ │ │ │ -std::vector buf;
│ │ │ │ -bencode(std::back_inserter(buf), e);
│ │ │ │ -This section describes the functions and classes that are used to create
│ │ │ │ -torrent files. It is a layered API with low level classes and higher level
│ │ │ │ -convenience functions. A torrent is created in 4 steps:
│ │ │ │ - 1. first the files that will be part of the torrent are determined.
│ │ │ │ - 2. the torrent properties are set, such as tracker url, web seeds, DHT nodes
│ │ │ │ - etc.
│ │ │ │ - 3. Read through all the files in the torrent, SHA-1 all the data and set the
│ │ │ │ - piece hashes.
│ │ │ │ - 4. The torrent is bencoded into a file or buffer.
│ │ │ │ -If there are a lot of files and or deep directory hierarchies to traverse, step
│ │ │ │ -one can be time consuming.
│ │ │ │ -Typically step 3 is by far the most time consuming step, since it requires to
│ │ │ │ -read all the bytes from all the files in the torrent.
│ │ │ │ -All of these classes and functions are declared by including libtorrent/
│ │ │ │ -create_torrent.hpp.
│ │ │ │ -example:
│ │ │ │ -file_storage fs;
│ │ │ │ -
│ │ │ │ -// recursively adds files in directories
│ │ │ │ -add_files(fs, "./my_torrent");
│ │ │ │ -
│ │ │ │ -create_torrent t(fs);
│ │ │ │ -t.add_tracker("http://my.tracker.com/announce");
│ │ │ │ -t.set_creator("libtorrent example");
│ │ │ │ -
│ │ │ │ -// reads the files and calculates the hashes
│ │ │ │ -set_piece_hashes(t, ".");
│ │ │ │ -
│ │ │ │ -ofstream out("my_torrent.torrent", std::ios_base::binary);
│ │ │ │ -std::vector